I’m converting someone’s oF 9 code to 10 and they’re appending a polyline to a path by :
path.getOutline().push_back(poly);
but this no longer works as getOutline returns a const ofPolylines object. Is there another way to do it?
thanks!
Seb
I’m converting someone’s oF 9 code to 10 and they’re appending a polyline to a path by :
path.getOutline().push_back(poly);
but this no longer works as getOutline returns a const ofPolylines object. Is there another way to do it?
thanks!
Seb
Hi,
You can add the polyline points one by one:
path.moveTo( polyline[0] );
for( size_t i = 1; i < polyline.size(); ++i ) path.lineTo( polyline[ int(i) ] );
If the path is not empty, you have to call path.newSubPath() first:
path.newSubPath();
path.moveTo( polyline[0] );
for( size_t i = 1; i < polyline.size(); ++i ) path.lineTo( polyline[ int(i) ] );
thanks for that, I was kinda hoping there’d be a less manual way but that works
Perhaps, but never found it !