{"maintainers":[{"name":"anonymous","email":"dave.des@gmail.com"}],"keywords":["dtype","flat","flatten","pack","array","type","typed","typedarray","vert","vertex","webgl","gl","glsl","shader","buffer"],"dist-tags":{"latest":"1.0.2"},"author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"description":"flattens nested vertex data into a typed array","readme":"# flatten-vertex-data\n\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\nCopies flat or nested array data into the specified typed array, or a new typed array. Intended to be used for WebGL buffers. If the input is nested array data, this guesses the dimensionality based on the length of the first sub-array.\n\n## Install\n\n```sh\nnpm install flatten-vertex-data --save\n```\n\n## Example\n\nAccepts a [dtype string](https://www.npmjs.com/package/dtype) (creating a new array) or an output typed array to re-use. Defaults to creating a new Float32Array.\n\n```js\nvar flatten = require('flatten-vertex-data')\n\nvar positions = [ [x1, y1], [x2, y2], [x3, y3] ]\n\nflatten(positions)\n//=> new Float32Array([ x1, y1, x2, y2, x3, y3 ])\n\nflatten(positions, 'uint16')\n//=> new Uint16Array([ x1, y1, x2, y2, x3, y3 ])\n\n// flatten & copy positions into output\nvar output = new Uint16Array(positions.length * 2)\nflatten(positions, output)\n```\n\n## Usage\n\n[![NPM](https://nodei.co/npm/flatten-vertex-data.png)](https://www.npmjs.com/package/flatten-vertex-data)\n\n#### `output = flatten(data, [output|type], [offset])`\n\nCopies flat or nested arrays into a typed array, where `data` can be:\n\n- a nested array like `[ [ x, y ], [ x, y ] ]`\n- a flat array like `[ x, y, z, x, y, z ]`\n- a typed array like `new Float32Array([ x, y ])`\n\nThe second parameter can be a `type` string for [dtype](https://www.npmjs.com/package/dtype), which creates a new array. Or, it can be an existing typed array to re-use as the `output` destination. It defaults to `'float32'` (a new Float32Array).\n\nReturns the `output` typed array.\n\nThe third parameter, `offset`, can be a number (default 0), the index in the destination array at which to start copying the `data`. If a new array is being created, its capacity will be expanded to fit `dataLength + offset` (i.e. it will have leading zeros).\n\n## License\n\nMIT, see [LICENSE.md](http://github.com/glo-js/flatten-vertex-data/blob/master/LICENSE.md) for details.\n","repository":{"type":"git","url":"git://github.com/glo-js/flatten-vertex-data.git"},"bugs":{"url":"https://github.com/glo-js/flatten-vertex-data/issues"},"license":"MIT","versions":{"1.0.0":{"name":"flatten-vertex-data","version":"1.0.0","description":"flattens nested vertex data into a typed array","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"array-pack-2d":"^0.1.1","dtype":"^2.0.0","is-typedarray":"^1.0.0"},"devDependencies":{"faucet":"0.0.1","standard":"^5.3.1","tape":"^4.2.1"},"scripts":{"test":"standard && node test.js | faucet"},"keywords":["dtype","flat","flatten","pack","array","type","typed","typedarray","vert","vertex","webgl","gl","glsl","shader","buffer"],"repository":{"type":"git","url":"git://github.com/glo-js/flatten-vertex-data.git"},"homepage":"https://github.com/glo-js/flatten-vertex-data","bugs":{"url":"https://github.com/glo-js/flatten-vertex-data/issues"},"gitHead":"71f842b0fca43e27b9dc9c1d9b20120942d2dfb0","_id":"flatten-vertex-data@1.0.0","_shasum":"d61c94f2a6564f301d6678b7261616af0004708c","_from":".","_npmVersion":"2.14.5","_nodeVersion":"0.12.7","_npmUser":{"name":"anonymous","email":"dave.des@gmail.com"},"dist":{"shasum":"d61c94f2a6564f301d6678b7261616af0004708c","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/flatten-vertex-data/-/flatten-vertex-data-1.0.0.tgz","integrity":"sha512-1sOepSSS3easeQ2Lr7aDX8YbyoNOAhXQWAw9mW/v6eMrzOEQ1YykUBkIH+AG4cfwrLdTJNjHvscC7t1AEWuaIg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2/F/T5Mxe3TpIqi7YVie0/LcYr3aQPAJcfSi+Pu+baAIhALDuUeHnf9Fn/D2CZHPY4c0Qi+ryp6SEJIF+WbnbsX6o"}]},"maintainers":[{"name":"anonymous","email":"dave.des@gmail.com"}],"directories":{}},"1.0.1":{"name":"flatten-vertex-data","version":"1.0.1","description":"flattens nested vertex data into a typed array","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"dtype":"^2.0.0"},"devDependencies":{"faucet":"0.0.1","standard":"^5.3.1","tape":"^4.9.0"},"scripts":{"test":"standard && node test.js | faucet"},"keywords":["dtype","flat","flatten","pack","array","type","typed","typedarray","vert","vertex","webgl","gl","glsl","shader","buffer"],"repository":{"type":"git","url":"git://github.com/glo-js/flatten-vertex-data.git"},"homepage":"https://github.com/glo-js/flatten-vertex-data","bugs":{"url":"https://github.com/glo-js/flatten-vertex-data/issues"},"gitHead":"9394d5edf0beeff5e2def2a469800fd2433e047b","_id":"flatten-vertex-data@1.0.1","_npmVersion":"5.7.1","_nodeVersion":"8.10.0","_npmUser":{"name":"anonymous","email":"dave.des@gmail.com"},"dist":{"integrity":"sha512-o/3JqVbjhUQoLr4c4jNK08YwqwFgjkbIa275ZF5PjLQ6tqNI5l9dxBvJaaxFeJdn2yAsKPm2aHPmvmQmUhmTZA==","shasum":"d81e0925b576a9bc11a6c113ccf06d8347212d62","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/flatten-vertex-data/-/flatten-vertex-data-1.0.1.tgz","fileCount":4,"unpackedSize":5771,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa3eK5CRA9TVsSAnZWagAAwsoQAJd7HA5f5iMx67JBM9l7\nkwBs0fvDxlcUI1lHWPPVJt/GMUpwkwYXfTNP22hwBmztGXCQrECM0Z56BudA\nP4I8r9wBJy6ydvkSfXcAC3RrzIJd5pJqx3DKxV7InwWvXRLOuw89weBlqd4+\nQ3ETNZ3rGMSp4OiA9P/60SVHY3eKPCY2dG4BqRv/QXgbBVUbBcfl6KtHeJGh\nmmvq+/yUQh4WtZxtYAgCP2anLqRNvSPu6xnTaaMmH77E5Ake7iMa1Kn2XeaI\nBzysHoBj8GVt+hTH6pfZdZ53Ucn4DHZ33GdPbifT24lfh0H43c8PudVEKwu1\nEuuS8cmEOJjt7EHBvdLFzSx1HGO7Rqukdixjc6h/ZGWVtJ0UIH4VBxsTmfLf\nHjMXmt6ooCOHW9Cx2txzJSx5dcIKhpbUaYDxPNGR7TRRGW0/OxeY9I+EDQSv\nmP5QsPpr08zzx1LvV57pAnuG4QkBV75Eb8NH2Tucjn2FmicU/ASy4xKllekF\niX1Vx4tsh9tvJc6cYGO0stdlCrltHbs5d+REDivK+lUFYXg79hutbleP/SqX\nIRwV2NgrrUPYnHarzrWTITnS8ndyREBhE+3p0TVK1m9LHe2OOLXWCnm6ofO3\n1IiRlZWLQpjfmTSWu6m0rGAKTdxl1J/MlmD3DzAw7zsbom8mdKwJI7mry6Ww\n/XaR\r\n=6dKX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEZ3NdJ345IbHcGFKreqNVHnxSD7wCE+s09QkHIiSQJyAiEAvyVlPRJTO0Cbjq1g32+FNn5ESYNTuSfB8O8/OaD+nUI="}]},"maintainers":[{"name":"anonymous","email":"dave.des@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flatten-vertex-data_1.0.1_1524490936053_0.6933920270946323"},"_hasShrinkwrap":false},"1.0.2":{"name":"flatten-vertex-data","version":"1.0.2","description":"flattens nested vertex data into a typed array","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"dtype":"^2.0.0"},"devDependencies":{"faucet":"0.0.1","standard":"^5.3.1","tape":"^4.9.0"},"scripts":{"test":"standard && node test.js | faucet"},"keywords":["dtype","flat","flatten","pack","array","type","typed","typedarray","vert","vertex","webgl","gl","glsl","shader","buffer"],"repository":{"type":"git","url":"git://github.com/glo-js/flatten-vertex-data.git"},"homepage":"https://github.com/glo-js/flatten-vertex-data","bugs":{"url":"https://github.com/glo-js/flatten-vertex-data/issues"},"gitHead":"710a1346ac5f55fefe05e7eeafabd077653dd074","_id":"flatten-vertex-data@1.0.2","_npmVersion":"5.7.1","_nodeVersion":"8.10.0","_npmUser":{"name":"anonymous","email":"dave.des@gmail.com"},"dist":{"integrity":"sha512-BvCBFK2NZqerFTdMDgqfHBwxYWnxeCkwONsw6PvBMcUXqo8U/KDWwmXhqx1x2kLIg7DqIsJfOaJFOmlua3Lxuw==","shasum":"889fd60bea506006ca33955ee1105175fb620219","tarball":"http://repository.ncinga.com/nexus/content/repositories/npm-js-registry/flatten-vertex-data/-/flatten-vertex-data-1.0.2.tgz","fileCount":4,"unpackedSize":5792,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa6MXVCRA9TVsSAnZWagAAfd4P/jCl3Qaxs8gNaL6gFQu6\ntS3atXEgw+kU8hg2MjzMX1WCR2MsbfFGjD0DEGafg9EcEOB6MZCPEh7PDAiR\nOy7dBre15FN81DP+EMg62Zsz/a5/TqygoKyKdMzJC08BkBp6Bhjm6eehebH/\na0CFH6uTiaf4kNSnwwjxo/0DM9LF9S/zGzcPwNbhnSWlCaC1sXiI22I/1AL0\nT228nnIt8HEGxYU1n2LzwGfAxUQnHNIDDOxUrbLANXZCluEbrcsK5JBgIe/H\nTFs61+/X5H6yGIdurUG0okeF7XhRAon1rWT/o8JuzAJEfrDekCTREt3Iw77d\n5H1WX7GcuPQSp4B4ltO89rGJq5heBbsVdgYmKq8oCS9KjIPWu/ryFgny/04j\n9P5MPTrrseBofU5TVsGdFSpo/w8O0rNg3/xJ4iFEdDbL1Ly591yRZpMvJ/6F\npo58tkMfHYAZI6Pb/ThfMEJI7KsojnwJBAd4feGBe/rIzVUvNKT2JFvcI6+m\n5kDco+wVQm2bYO3f0hnV4gQ5E4Oa5jf60noe9XwDUsfG4Qbue2nxPbuAOWNx\nsGP0nyvgT/DBanBKiZ5tQuZfXzg3U5bemriIJAL3DcXcTMRFX6uujrRFU1Ga\no83IG6ywqxzq6nGIKuGTfXE/LOCEfqyB7atggE3PzbmbmoPz8TaGW13WeiOk\ntpts\r\n=lMX8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0DCN9ba6C5/f6mdob9zfROwrrUV5T+ZXUmkIflP3O2AIgDbl/mKJjkEFOub0p4AauH8V/+JNGM57ETJ1yGdySoY4="}]},"maintainers":[{"name":"anonymous","email":"dave.des@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/flatten-vertex-data_1.0.2_1525204436328_0.2547520668535501"},"_hasShrinkwrap":false}},"name":"flatten-vertex-data","time":{"modified":"2022-06-18T02:00:29.851Z","created":"2015-10-13T14:11:12.578Z","1.0.0":"2015-10-13T14:11:12.578Z","1.0.1":"2018-04-23T13:42:16.109Z","1.0.2":"2018-05-01T19:53:56.455Z"},"readmeFilename":"README.md","homepage":"https://github.com/glo-js/flatten-vertex-data"}