I'm trying to get at the paths from an svg, and having some real troubles. I can't use a library like geomeratives, because this will eventually be ported to processing.js, which doesn't really support libraries.
I'm trying to access the vertices of individual paths, so that I can manipulate them / redraw new shapes. Ultimately, I'd like to be able to also use the (undocumented) PShape.contains() function, which works fine unless you matrix transform (scale / translate etc) a shape. I'm thinking I can get around this by redrawing new shapes after the transform, and using those for the PShape.contains() call.
For now, though, I'm trying to understand what's going on behind the scenes in the getVertexCode() function - the javadoc says:
int
getVertexCode(int index) One of VERTEX, BEZIER_VERTEX, CURVE_VERTEX, or BREAK.
when I incorporate it into a sketch, though, I can't really figure out what's happening. Here's my code - the svg i have is just a test - a 7-point, closed squiggle from illustrator with different kinds of vertices.
first of all, it says there are 22 vertices, which don't make no damn sense, and then their codes are either 0 or 1 - i guess these might correspond to "VERTEX" and "BEZIER_VERTEX", but one of them should be a BREAK.