I have a svg file which contains complex paths with bezier curves in it. I need to convert this path-data to use it for html map-area's, so I in fact I need just the coordinates (but for large curves, it would be very nice to have some coordinates 'between' the two end-points.
I tried Inkscape's simplify path function, but those paths still contain curves...
Is there any tool or formula to convert these curves into simple coordinates?
Maybe another Inkscape output-format that doesn't use curves in its coordinates?
In Inkscape:
These options are on the toolbar at the top - the plus icon and the straight diagonal line between two square nodes.
For automation, try the included Flatten Bezier
extension in Inkscape. Description here.
There is more technical way to simplify SVG path - https://github.com/mattdesl/simplify-path
var path = [ [250, 150], [250, 150], [25, 25], [24, 25], [10, 10] ]
var tolerance = 10
path = simplify(path, tolerance)
//result:
//[ [ 250, 150 ], [ 25, 25 ], [ 10, 10 ] ]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With