void ClipperPolygons_to_Slic3rPolygons(const ClipperLib::Polygons &input, Slic3r::Polygons &output) { output.clear(); for (ClipperLib::Polygons::const_iterator it = input.begin(); it != input.end(); ++it) { Slic3r::Polygon p; ClipperPolygon_to_Slic3rPolygon(*it, p); output.push_back(p); } }
void scaleClipperPolygons(ClipperLib::Polygons &polygons, const double scale) { for (ClipperLib::Polygons::iterator it = polygons.begin(); it != polygons.end(); ++it) { for (ClipperLib::Polygon::iterator pit = (*it).begin(); pit != (*it).end(); ++pit) { (*pit).X *= scale; (*pit).Y *= scale; } } }
//-------------------------------------------------------------- void ofxClipper::polygons_to_ofxPolylines(ClipperLib::Polygons& polygons,ofxPolylines& polylines) { vector<ClipperLib::Polygon>::iterator iter; for(iter = polygons.begin(); iter != polygons.end(); iter++) { polylines.push_back(polygon_to_ofPolyline((*iter))); } }