I'm looking for a library with Python bindings that can do calculations on SVG paths, such as calculating the length, and finding the coordinates of a point on the paths (ie, say the coordinates of the point 24.4% the length of the path).
Is there something around already?
A C-library would be acceptable as well, as I can easily make my own Python bindings.
The "closepath" command. The "closepath" (Z or z) ends the current subpath by connecting it back to its initial point. An automatic straight line is drawn from the current point to the initial point of the current subpath.
The element in SVG is the ultimate drawing element. It can draw anything! I've heard that under the hood all the other drawing elements ultimately use path anyway. The path element takes a single attribute to describe what it draws: the d attribute.
An SVG quadratic curve will probably suffice. To draw it, you need the end points (which you have) and a control point which will determine the curve. To make a symmetrical curve, the control point needs to be on the perpendicular bisector of the line between the end points.
OK, so I wrote it, and released it as a library.
http://pypi.python.org/pypi/svg.path
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