array-pack-2d ![experimental](https://camo.githubusercontent.com/11ce7fd952f2eae4e5467c7f6421660a373d19029c1ca071eb74c16669d2bff1/687474703a2f2f68756768736b2e6769746875622e696f2f73746162696c6974792d6261646765732f646973742f6578706572696d656e74616c2e737667)
Quickly pack a nested 2D array into a typed array – useful for flattening point data into a WebGL-friendly format.
Usage
packed = pack(array, [type])
Takes a nested 2D array
and packs it into a flat, packed
one. By default this will be a Float32Array
, but you can specify a custom type
too: this can be a constructor such as Uint8Array
, or a dtype string such as "float32"
or "uint8"
.
License
MIT. See LICENSE.md for details.