Open matthijskooijman opened 3 years ago
https://github.com/meerk40t/svgelements/issues svgelements
has that feature. Lets you directly use the strings like matrices.
It looks like it's somewhat in there too. Calls: https://github.com/mathandy/svgpathtools/blob/3a1fe8695dd6236af81b5477714e74a094e3b088/svgpathtools/path.py#L292 which looks about right. Though yeah, this should be built into Path much like Path("M0,0L20,20") is now a permitted value. In svgelements I let you multiply by strings of matrices. path * "scale(1.2)" is a perfectly valid and understandable command, and might even be too liberal.
I'm looking at applying matrix transformations to paths and path segments. I see there is a
translated()
,scaled()
androtated()
method on various classes, but there is no such method to apply a transformation matrix. There is asvgpathtools.path.transform()
function that works, but I wonder if that is considered public API, or if there should be wrapper methods just like for translation etc.?On a related note, I see there is a
svgpathtools.parser.parse_transform()
function that looks useful. Is that also considered public API?