SVG Path Parser
A really un-opinionated library for reading SVG paths. So un-opinionated, in fact, that you're just returned lists of points and whether the path is closed or not. If the path is closed, just assume there's a line between the last point and the first point.
Usage
First of all, extract the path string from the d
tag. I dunno, use regex or something, it's a free world. Next, feed it into the parser:
let paths = parse.;
The bool
indicates whether the path is closed and the Vec
is a vector of all the points. Treat it as a continuous connect the dots thing.
By default, curves are rendered as 64 different line segments spaced at equal angles from each other. In order to change this, use:
let resolution = 32;
let paths = parse_with_resolution.;
Creating lines from a list of points
I get that a list of points is not very helpful.