We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi, i have a svg file that i import with PShape fama = loadShape("test.svg");
, i'm trying to add a dashed stroke on its path and i discovered this library but i need to get the vertex of my shape so that i can use the BeginShape();
How could i do it?
Answers
what have you tried?
https://processing.org/reference/PShape.html
getChild()? getVertex()?
getVertex(); and i cant make it work, for the moment i wrote a python script that takes the polygon lines from a .svg file and print a better syntax, but its a long work each time i modify the svg itself
The getVertex method almost certainly won't work in you case
As I recall, the docs should say that a loadShape SVG is almost certainly defined explicitly -- you will need to use getChildCount / getChild / getChildren. If svg element names aren't known and/or accessible then you can use the getChildCount to get the number of indexes and then loop through with getChild(index) to get each child.
See also the javadoc:
http://processing.github.io/processing-javadocs/core/processing/core/PShape.html