turn curved svg paths into paths with only line segments
npm install svg-linearizeturn curved svg paths into paths with only line segments
`` js
var linearize = require('svg-linearize');
var loadsvg = require('load-svg');
loadsvg('face.svg', function (err, svg) {
var nsvg = linearize(svg, { tolerance: 3 });
document.body.appendChild(nsvg);
});
`
` js`
var linearize = require('svg-linearize')
Create a new svg, nsvg from an existing svg element.
Any curved paths in svg will be converted to line segment paths.
Optionally specify:
* opts.tolerance - tolerance to feed intoopts.segments
simplify-geometry, higher values
mean fewer points. Default: 3.
* - number of points to sample each path. Default: 100.
With npm do:
```
npm install svg-linearize
MIT