Refactored ClipperUtils API for a more consistent arguments convention

This commit is contained in:
Alessandro Ranellucci 2014-11-15 23:44:03 +01:00
parent 28466750e6
commit bf0eb1af0c
14 changed files with 204 additions and 205 deletions

View file

@ -41,7 +41,7 @@ MotionPlanner::initialize()
Polygons outer_holes;
for (ExPolygons::const_iterator island = this->islands.begin(); island != this->islands.end(); ++island) {
this->inner.push_back(ExPolygonCollection());
offset_ex(*island, this->inner.back(), -MP_INNER_MARGIN);
offset(*island, &this->inner.back().expolygons, -MP_INNER_MARGIN);
outer_holes.push_back(island->contour);
}
@ -49,7 +49,7 @@ MotionPlanner::initialize()
// grow island contours in order to prepare holes of the outer environment
// This is actually wrong because it might merge contours that are close,
// thus confusing the island check in shortest_path() below
//offset(outer_holes, outer_holes, +MP_OUTER_MARGIN);
//offset(outer_holes, &outer_holes, +MP_OUTER_MARGIN);
// generate outer contour as bounding box of everything
Points points;
@ -59,12 +59,12 @@ MotionPlanner::initialize()
// grow outer contour
Polygons contour;
offset(bb.polygon(), contour, +MP_OUTER_MARGIN);
offset(bb.polygon(), &contour, +MP_OUTER_MARGIN);
assert(contour.size() == 1);
// make expolygon for outer environment
ExPolygons outer;
diff(contour, outer_holes, outer);
diff(contour, outer_holes, &outer);
assert(outer.size() == 1);
this->outer = outer.front();