diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/Create_weighted_straight_skeleton_2.cpp b/Straight_skeleton_2/examples/Straight_skeleton_2/Create_weighted_straight_skeleton_2.cpp index b8751d55dfd..192f7d00782 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/Create_weighted_straight_skeleton_2.cpp +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/Create_weighted_straight_skeleton_2.cpp @@ -1060,25 +1060,7 @@ bool outward_construction(const Polygon_with_holes_2& pwh, ob.construct_offset_contours(offset, std::back_inserter(raw_output)); // Manually filter the offset of the outer frame - Point_2 xtrm_pt = *(raw_output[0]->begin()); - std::size_t outer_id = 0; - for(std::size_t i=0; iorientation() == CGAL::COUNTERCLOCKWISE) - { - for(const Point_2& p : raw_output[i]->container()) - { - if(p < xtrm_pt) - { - xtrm_pt = p; - outer_id = i; - } - } - } - } - - if(outer_id != (raw_output.size()-1)) - std::swap(raw_output[outer_id], raw_output.back()); + std::swap(raw_output[0], raw_output.back()); raw_output.pop_back(); #ifdef CGAL_SLS_SNAP_TO_VERTICAL_SLABS diff --git a/Straight_skeleton_2/examples/Straight_skeleton_2/exterior_offset_of_multiple_polygons_with_holes.cpp b/Straight_skeleton_2/examples/Straight_skeleton_2/exterior_offset_of_multiple_polygons_with_holes.cpp index f6e0a86a931..92591eaa785 100644 --- a/Straight_skeleton_2/examples/Straight_skeleton_2/exterior_offset_of_multiple_polygons_with_holes.cpp +++ b/Straight_skeleton_2/examples/Straight_skeleton_2/exterior_offset_of_multiple_polygons_with_holes.cpp @@ -3,10 +3,9 @@ #include #include -#include - #include +#include #include #include @@ -61,21 +60,9 @@ exterior_offset_of_disjoint_polygons_with_holes(double lOffset, const std::vecto PolygonPtrVector off_polys = CGAL::create_interior_skeleton_and_offset_polygons_2(lOffset,pwh); // filter outer frame - Point xtrm_pt = *(off_polys[0]->begin()); - std::size_t outer_id=0; - for(std::size_t i=0; iorientation() == CGAL::COUNTERCLOCKWISE) - { - for (const Point& p : off_polys[i]->container()) - if (p < xtrm_pt) - { - xtrm_pt=p; - outer_id=i; - } - } - if (outer_id != (off_polys.size()-1)) - std::swap(off_polys[outer_id], off_polys.back()); + std::swap(off_polys[0], off_polys.back()); off_polys.pop_back(); + for (PolygonPtr ptr : off_polys) ptr->reverse_orientation(); diff --git a/Straight_skeleton_2/include/CGAL/create_offset_polygons_from_polygon_with_holes_2.h b/Straight_skeleton_2/include/CGAL/create_offset_polygons_from_polygon_with_holes_2.h index 745ce692b68..07a49261e9e 100644 --- a/Straight_skeleton_2/include/CGAL/create_offset_polygons_from_polygon_with_holes_2.h +++ b/Straight_skeleton_2/include/CGAL/create_offset_polygons_from_polygon_with_holes_2.h @@ -114,21 +114,9 @@ create_exterior_skeleton_and_offset_polygons_with_holes_2(const FT& aOffset, create_exterior_skeleton_and_offset_polygons_2(aOffset, aPoly, ofk, ssk); // filter offset of the outer frame - typename OfK::Point_2 xtrm_pt = *(raw_output[0]->begin()); - std::size_t outer_id=0; - for(std::size_t i=0; iorientation() == COUNTERCLOCKWISE) - { - for (const typename OfK::Point_2& p : raw_output[i]->container()) - if (p < xtrm_pt) - { - xtrm_pt=p; - outer_id=i; - } - } - if (outer_id != (raw_output.size()-1)) - std::swap(raw_output[outer_id], raw_output.back()); + std::swap(raw_output[0], raw_output.back()); raw_output.pop_back(); + for (boost::shared_ptr ptr : raw_output) ptr->reverse_orientation(); diff --git a/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h b/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h index c3eb045e849..b58e8f844c3 100644 --- a/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h +++ b/Straight_skeleton_2/include/CGAL/create_weighted_offset_polygons_from_polygon_with_holes_2.h @@ -118,25 +118,7 @@ create_exterior_weighted_skeleton_and_offset_polygons_with_holes_2(const FT& aOf create_exterior_weighted_skeleton_and_offset_polygons_2(aOffset, aPoly, aWeights, ofk, ssk); // filter offset of the outer frame - typename OfK::Point_2 xtrm_pt = *(raw_output[0]->begin()); - std::size_t outer_id=0; - for(std::size_t i=0; iorientation() == COUNTERCLOCKWISE) - { - for(const typename OfK::Point_2& p : raw_output[i]->container()) - { - if(p < xtrm_pt) - { - xtrm_pt=p; - outer_id=i; - } - } - } - } - - if(outer_id != (raw_output.size()-1)) - std::swap(raw_output[outer_id], raw_output.back()); + std::swap(raw_output[0], raw_output.back()); raw_output.pop_back(); for(boost::shared_ptr ptr : raw_output)