poly-line
Generates a polygonal line or curve from a sequence of vertices.
Install
npm install poly-line
Example
var polyLine = //Generate a pathconsole //Prints://// [[0,1], [1,2], [2,3]]// //Generate a cycle:console //Prints://// [[0,1], [1,2], [2,3], [3,0]]//
require("poly-line")(vertices[, closed])
Creates a polygonal line/cycle.
vertices
is the set of vertices to generateclosed
if set to true, then closes the polygonal curve
Returns: A list of cells representing the polygonal line
Credits
(c) 2013 Mikola Lysenko. MIT License