{"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":"http://registry-npm.ywwl.com/polyline-normals/download/polyline-normals-2.0.0.tgz","integrity":"sha512-GZXPAQsvj+L7f374vBsQgVxbaR30iLlTkKC8eCv47RMovuX7oEOXInYAj75si57VPnaT54PRCTYooDE5gM58RQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDjC3Tjp5qdwlSqv8NbPCAKcRj+/sZa9JeDPI7f9/W/UwIgZf1r/6P+lu1ZE+Ld4BUwH6CXHNnm6O6oZZt6R1YI8oM="}],"size":3607,"noattachment":false,"key":"/polyline-normals/-/polyline-normals-2.0.0.tgz"},"directories":{},"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","publish_time":1417194465366,"_cnpm_publish_time":1417194465366,"dist-tags":{"latest":"2.0.2"}}