svg-line-segments
turn a linearized svg
into an array of paths of [x,y]
pairs
example
var segments = ;var linearize = ;var loadsvg = ;;
Compile with browserify and serve up the bundle in a directory with a face.svg
file:
$ beefy points.js
methods
var segments =
var points = segments(svg)
Given a linearized svg image with paths that only contain M
and L
commands,
return an array arrays of points
for each <path>
in the svg or null
if
the svg isn't linearized.
You can linearize an svg with svg-linearize.
install
With npm do:
npm install svg-line-segments
license
MIT