Parse SVG to Processing Shape Code
in
Programming Questions
•
2 years ago
Hello,
I was wondering if there was an easy way that I can
convert a SVG into Processing code that looks like this:
- beginShape();
- vertex(30, 20);
- vertex(50, 90);
- vertex(20, 50);
- endShape();
I realize that I could load the file using loadShape("myfile.svg"); but I want to have programatic access to each individual shape within the SVG. I also realize I could do this using the Geomeratives library using code like this:
- RShape mySvg = loadShape("myfile.svg");
- RShape myPath = mySvg.getChild("idOfPath");
...
but my sketch will eventually end up in Processing.js, so therefore I cannot use the Geomeratives library.
Thanks in advance for your help!
1