Loading...
Logo
Processing Forum
I have an SVG file that contains several discrete paths.  I want to animate an object moving along each path.  I have been playing with the Geomeratives library, and it seems to have the functions for dealing with the paths, and allowing me to place an object at a specific point on the path, but I can;t seem to figure out how to get a specific reference to each path from the SVG.  I can't get the SVG into a sketch as a shape, but then the paths are all grouped together.  Any suggestions or examples would be greatly appreciated.

Replies(1)

You should give names to the different paths by using the id attribute.  Inkscape allows you to do that, I don't know about other SVG editors.

Then in Processing you can try to do:

Copy code
  1. RShape mySvg = loadShape("mySvg.svg");
  2. RShape myPath = mySvg.getChild("idOfPath");

Hope it helps,
ricard