{"_id":"polyline-normals","_rev":"14-314a025361ab5ccf95b98895cfad29cc","name":"polyline-normals","description":"gets miter normals for a 2D polyline","dist-tags":{"latest":"2.0.2"},"versions":{"1.0.0":{"name":"polyline-normals","version":"1.0.0","description":"gets miter normals for a 2D polyline","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"polyline-miter-util":"^1.0.0"},"devDependencies":{"gl-vec2":"^1.0.0","three-orbit-viewer":"^69.2.2","adaptive-bezier-curve":"^1.0.3","arc-to":"^1.0.0","canvas-testbed":"^1.0.3","domready":"^1.0.7","inherits":"^2.0.1","normalize-path-scale":"^1.1.1","three":"^0.69.0","three-simplicial-complex":"^69.0.3"},"scripts":{"test":"node test.js"},"keywords":["polyline","mesh","webgl","glsl","stackgl"],"repository":{"type":"git","url":"git://github.com/mattdesl/polyline-normals.git"},"homepage":"https://github.com/mattdesl/polyline-normals","bugs":{"url":"https://github.com/mattdesl/polyline-normals/issues"},"gitHead":"0f072fb68d93aab58495f589456dfa4412b5b342","_id":"polyline-normals@1.0.0","_shasum":"16243e8b21ff7f9e23258e43efe74e88868f1a91","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.32","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"dist":{"shasum":"16243e8b21ff7f9e23258e43efe74e88868f1a91","tarball":"https://registry.npmjs.org/polyline-normals/-/polyline-normals-1.0.0.tgz","integrity":"sha512-IIFZA3ZCLHmnxf2MD0qmx7tYBXuQfg4OSAjqmGXMz5E80UrjVoSAjyYqU6ikEkaffmBwlS0bpgRpZJWAzDzuJg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFkcFeTQxAhIO/50CEAlt8lV5aKolzTeNbL7F9xPwKZgIgfsijvJIFWmwDLp3olU10OBD5FtKmmAbQf/FV912LWXk="}]}},"1.0.1":{"name":"polyline-normals","version":"1.0.1","description":"gets miter normals for a 2D polyline","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"polyline-miter-util":"^1.0.0"},"devDependencies":{"gl-vec2":"^1.0.0","three-orbit-viewer":"^69.2.2","adaptive-bezier-curve":"^1.0.3","arc-to":"^1.0.0","canvas-testbed":"^1.0.3","domready":"^1.0.7","inherits":"^2.0.1","normalize-path-scale":"^1.1.1","three":"^0.69.0","three-simplicial-complex":"^69.0.3"},"scripts":{"test":"node test.js"},"keywords":["polyline","mesh","webgl","glsl","stackgl"],"repository":{"type":"git","url":"git://github.com/mattdesl/polyline-normals.git"},"homepage":"https://github.com/mattdesl/polyline-normals","bugs":{"url":"https://github.com/mattdesl/polyline-normals/issues"},"gitHead":"ece4ac42ea43c12a75394fe768aa6cc0ff995796","_id":"polyline-normals@1.0.1","_shasum":"3893e74f7fb2d329b23c63a64223785429bd5c93","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.32","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"dist":{"shasum":"3893e74f7fb2d329b23c63a64223785429bd5c93","tarball":"https://registry.npmjs.org/polyline-normals/-/polyline-normals-1.0.1.tgz","integrity":"sha512-cJQujTdUKQFErRDB34s60XdvQ9ZDNuY7SOPRFe/xkhGo2pD1q2Sk6OZVkDDhd4ZWiwXfzwdu70M9ia2IBLd9jQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC8nRVSc1RRv2IVENjFcdQy87mpxx3usjyWu8sOhwuFsgIhAIKKOGtT6or86lfoI21VqEBj0f8pkU/675pOdDZFCYmU"}]}},"1.0.2":{"name":"polyline-normals","version":"1.0.2","description":"gets miter normals for a 2D polyline","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"polyline-miter-util":"^1.0.1"},"devDependencies":{"gl-vec2":"^1.0.0","three-orbit-viewer":"^69.2.2","adaptive-bezier-curve":"^1.0.3","arc-to":"^1.0.0","canvas-testbed":"^1.0.3","domready":"^1.0.7","inherits":"^2.0.1","normalize-path-scale":"^1.1.1","three":"^0.69.0","three-simplicial-complex":"^69.0.3"},"scripts":{"test":"node test.js"},"keywords":["polyline","mesh","webgl","glsl","stackgl"],"repository":{"type":"git","url":"git://github.com/mattdesl/polyline-normals.git"},"homepage":"https://github.com/mattdesl/polyline-normals","bugs":{"url":"https://github.com/mattdesl/polyline-normals/issues"},"gitHead":"87aac36025e222230446cf1dc543037fc62c95ae","_id":"polyline-normals@1.0.2","_shasum":"1a2c9eb857a1d2851b83e39ab7f592adc7b446f5","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.32","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"dist":{"shasum":"1a2c9eb857a1d2851b83e39ab7f592adc7b446f5","tarball":"https://registry.npmjs.org/polyline-normals/-/polyline-normals-1.0.2.tgz","integrity":"sha512-Y38q+BBTMvyNcMH+05LFOrLE9hOyGAGSCBb4Sr3XQt+vR75Yn/KLJikpNyDHzhfkU6B6PbnE8hOzfhhU5gj2pA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC14TOP2fUhBmj0a/nxpUwwBMuIJFIHWOUj5J02yCpE+wIgBRhDX2ybQivcx+7rTpmikjKI/hn+Ak7Zltlp8X5wxb4="}]}},"2.0.0":{"name":"polyline-normals","version":"2.0.0","description":"gets miter normals for a 2D polyline","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"polyline-miter-util":"^1.0.1"},"devDependencies":{"gl-vec2":"^1.0.0","three-orbit-viewer":"^69.2.2","adaptive-bezier-curve":"^1.0.3","arc-to":"^1.0.0","canvas-testbed":"^1.0.3","domready":"^1.0.7","inherits":"^2.0.1","normalize-path-scale":"^1.1.1","three":"^0.69.0","three-simplicial-complex":"^69.0.3"},"scripts":{"test":"node test.js"},"keywords":["polyline","mesh","webgl","glsl","stackgl"],"repository":{"type":"git","url":"git://github.com/mattdesl/polyline-normals.git"},"homepage":"https://github.com/mattdesl/polyline-normals","bugs":{"url":"https://github.com/mattdesl/polyline-normals/issues"},"gitHead":"b73ae94a6b9afa7a457410cf94046cdecff02004","_id":"polyline-normals@2.0.0","_shasum":"2e67e226d639b9530be99150c77681df9967d2c3","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.32","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"dist":{"shasum":"2e67e226d639b9530be99150c77681df9967d2c3","tarball":"https://registry.npmjs.org/polyline-normals/-/polyline-normals-2.0.0.tgz","integrity":"sha512-GZXPAQsvj+L7f374vBsQgVxbaR30iLlTkKC8eCv47RMovuX7oEOXInYAj75si57VPnaT54PRCTYooDE5gM58RQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjC3Tjp5qdwlSqv8NbPCAKcRj+/sZa9JeDPI7f9/W/UwIgZf1r/6P+lu1ZE+Ld4BUwH6CXHNnm6O6oZZt6R1YI8oM="}]}},"2.0.1":{"name":"polyline-normals","version":"2.0.1","description":"gets miter normals for a 2D polyline","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"polyline-miter-util":"^1.0.1"},"devDependencies":{"gl-vec2":"^1.0.0","adaptive-bezier-curve":"^1.0.3","arc-to":"^1.0.0","canvas-testbed":"^1.0.3","domready":"^1.0.7","inherits":"^2.0.1"},"scripts":{"test":"node test.js"},"keywords":["polyline","mesh","webgl","glsl","stackgl"],"repository":{"type":"git","url":"git://github.com/mattdesl/polyline-normals.git"},"homepage":"https://github.com/mattdesl/polyline-normals","bugs":{"url":"https://github.com/mattdesl/polyline-normals/issues"},"gitHead":"ec061d8205c6d3a533f1193b326b570da2441550","_id":"polyline-normals@2.0.1","_shasum":"f1352b95a722d5f4ea82f77f13c092bc3f13455c","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.32","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"dist":{"shasum":"f1352b95a722d5f4ea82f77f13c092bc3f13455c","tarball":"https://registry.npmjs.org/polyline-normals/-/polyline-normals-2.0.1.tgz","integrity":"sha512-jz88E3xhvF3CN3O9G+o6dGF5+tBP8y3GSIqcwu7EprC+4lcoD52bLMAgAjVL0gBR4vlNamSlliu+grXgDaUtvA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDLYAKNayCOSkjITNSknsiJx+pVakprgS1MWxk3bhiLwQIgdeR1nsg2oqZDRWrFB3epZJng7unaqnc6yWxHr1DeGqA="}]}},"2.0.2":{"name":"polyline-normals","version":"2.0.2","description":"gets miter normals for a 2D polyline","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{"polyline-miter-util":"^1.0.1"},"devDependencies":{"gl-vec2":"^1.0.0","adaptive-bezier-curve":"^1.0.3","arc-to":"^1.0.0","canvas-testbed":"^1.0.3","domready":"^1.0.7","inherits":"^2.0.1"},"scripts":{"test":"node test.js"},"keywords":["polyline","mesh","webgl","glsl","stackgl"],"repository":{"type":"git","url":"git://github.com/mattdesl/polyline-normals.git"},"homepage":"https://github.com/mattdesl/polyline-normals","bugs":{"url":"https://github.com/mattdesl/polyline-normals/issues"},"gitHead":"d37f6f6919e2963b70a54017c397d98c02207312","_id":"polyline-normals@2.0.2","_shasum":"a1737e75d8c0dccb1a591f9cb27f09eef4b7d135","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.32","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"dist":{"shasum":"a1737e75d8c0dccb1a591f9cb27f09eef4b7d135","tarball":"https://registry.npmjs.org/polyline-normals/-/polyline-normals-2.0.2.tgz","integrity":"sha512-dpHrAi61ymhsB4N0XlNb3YpkKJeTFnXBXDWpeH8Ucstq0TUZrCN3YK4Jlgk8ofMWN25lhGC4wnxLMv+TUK8rig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzRGFpSjIJOXw3LTnCBi48XbbQQMLrxspcsPjq2s+mDgIhAO1YWeKsD+PHPNbiCZXkXI079gX30hJVIRlL3Paq8+KG"}]}}},"readme":"# polyline-normals\n\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\n![img](http://i.imgur.com/UP2Fq12.png)\n\nComputes the normals of a polyline, using miter joins where multiple segments meet.  This is mainly useful to expand thick lines in a vertex shader on the GPU. \n\n```js\nvar getNormals = require('polyline-normals')\n\n//a triangle\nvar path = [ [0, 122], [0, 190], [90, 190] ]\n\n//get the normals as a closed loop\nvar normals = getNormals(path, true)\n\n//now draw our thick line in 2D/3D/etc\n```\n\nSee [the 2d test](test-2d.js) for an example of how these lines would be extruded. \n\nFor more complex line joins and end caps, see [extrude-polyline](https://nodei.co/npm/extrude-polyline/) (which builds an indexed mesh). \n\n## Shader Example\n\nFor an example of how to use this within a shader, see [three-line-2d](https://nodei.co/npm/three-line-2d/).\n\n## Usage\n\n[![NPM](https://nodei.co/npm/polyline-normals.png)](https://nodei.co/npm/polyline-normals/)\n\n#### `normals(path[, closed])`\n\nFor the given path, produces a new array of the same length with normal information for each point. The data contains a normal, `[nx, ny]` and the length of the miter (default to 1.0 where no join occurs). \n\n```js\n[ \n    [ [nx, ny], miterLength ],\n    [ [nx, ny], miterLength ]\n]\n```\n\nIf `closed` is true, it assumes a segment will be drawn from the last point to the first point, and adjusts those normals accordingly.\n\n## License\n\nMIT, see [LICENSE.md](http://github.com/mattdesl/polyline-normals/blob/master/LICENSE.md) for details.\n","maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"time":{"modified":"2022-06-24T07:05:13.713Z","created":"2014-11-28T15:46:23.040Z","1.0.0":"2014-11-28T15:46:23.040Z","1.0.1":"2014-11-28T15:47:15.411Z","1.0.2":"2014-11-28T15:56:16.548Z","2.0.0":"2014-11-28T17:07:45.366Z","2.0.1":"2014-11-28T18:41:12.359Z","2.0.2":"2014-11-28T18:55:23.411Z"},"homepage":"https://github.com/mattdesl/polyline-normals","keywords":["polyline","mesh","webgl","glsl","stackgl"],"repository":{"type":"git","url":"git://github.com/mattdesl/polyline-normals.git"},"author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"bugs":{"url":"https://github.com/mattdesl/polyline-normals/issues"},"license":"MIT","readmeFilename":"README.md"}