array-pack-2d

1.0.0 • Public • Published

array-pack-2d experimental

Quickly pack a nested 2D array into a typed array – useful for flattening point data into a WebGL-friendly format.

Usage

array-pack-2d

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.

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    30
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    30
  • 0.1.1
    665
  • 0.1.0
    0
  • 0.0.1
    0
  • 0.0.0
    0

Package Sidebar

Install

npm i array-pack-2d

Weekly Downloads

695

Version

1.0.0

License

MIT

Last publish

Collaborators

  • hughsk