For anyone following along at home still, I believe I’ve found a fairly helpful answer on stack overflow.
Note that the solution is intended for actual points in a polygon, so if you intend to apply the method to a Shape2d
object containing a series of Path2d
objects, I recommend looking into (and using) the subdivide
function in the Path2d
object, as that will generate the actual points along the polygon, as opposed to the more abstract (but generally more useful) representation in the Path2d object.
If you don’t know what I mean or still have issues, feel free to put that in a response below.
Unfortunately, in my instance I believe I’ve run into a bug with getting Shape2d
objects from Svg data in Cinder which I’ll be posting about, and linking to here once complete.
Cheers,
Gazoo