Closed jaggzh closed 2 years ago
I couldn't find a way, but looking through the source I found the Document api applies group transforms; now I'm stuck trying to find how to get path attributes (stroke/color) through the Doc interface. :/
If I remember correctly, the transforms are only applied if you want to output a list of svgpathtools.Path
objects, e.g. using the Document.paths()
method.
To match up those output paths with the (already applied) transform data, you can search for the relevant attributes using the ElementTree
-- the root node is stored for convenience in root
attribute of the Document
object.
I hope that helps. I wouldn't be opposed to adding an easier way to do this if someone wants to make a pull request, especially given the several potential points of confusion related to how the (still experimental) Document
class handles transforms.
In this inkscape-generated svg, the second tag contains the paths, yet the also has a transform matrix that I need access to in order to calculate the path coordinates in the document. (Actually, the 2nd contains another which then contains the paths, but only one has transform data.)
How do we handle obtaining that matrix data? Thanks a bunch. :)