From c9109d41adacc4853d09348460490c28ed95e719 Mon Sep 17 00:00:00 2001 From: igiannakas Date: Fri, 27 Sep 2024 14:15:45 +0100 Subject: [PATCH] Fixes for XCode 16.0 --- src/libslic3r/Fill/Fill.cpp | 3 ++- src/libslic3r/PerimeterGenerator.cpp | 2 +- src/libslic3r/PrintObject.cpp | 5 ++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/libslic3r/Fill/Fill.cpp b/src/libslic3r/Fill/Fill.cpp index 6e3886d6dbb..4d8f6a5eda3 100644 --- a/src/libslic3r/Fill/Fill.cpp +++ b/src/libslic3r/Fill/Fill.cpp @@ -290,7 +290,8 @@ void split_solid_surface(size_t layer_id, const SurfaceFill &fill, ExPolygons &n [](const Line &s) { return s.a == s.b; }), polygon_sections[section_idx].end()); std::sort(polygon_sections[section_idx].begin(), polygon_sections[section_idx].end(), - [](const Line &a, const Line &b) { return a.a.y() < b.b.y(); }); + [](const Line &a, const Line &b) { if (a == b) return false; // Ensure irreflexivity + return a.a.y() < b.b.y(); }); } Polygons reconstructed_area{}; diff --git a/src/libslic3r/PerimeterGenerator.cpp b/src/libslic3r/PerimeterGenerator.cpp index 6cae4756a3b..eded2ef6dab 100644 --- a/src/libslic3r/PerimeterGenerator.cpp +++ b/src/libslic3r/PerimeterGenerator.cpp @@ -3152,7 +3152,7 @@ void PerimeterGenerator::process_arachne() // printf("Layer ID %d, Outer index %d, inner index %d, second inner index %d, maximum internal perimeter %d \n",layer_id,outer,first_internal,second_internal, max_internal); if (outer > -1 && first_internal > -1 && second_internal > -1) { // found all three perimeters to re-order? If not the perimeters will be processed outside in. std::vector inner_outer_extrusions; // temporary array to hold extrusions for reordering - inner_outer_extrusions.reserve(max_internal - position + 1); // reserve array containing the number of perimeters before a new island. Variables are array indexes hence need to add +1 to convert to position allocations + inner_outer_extrusions.resize(max_internal - position + 1); // reserve array containing the number of perimeters before a new island. Variables are array indexes hence need to add +1 to convert to position allocations // printf("Allocated array size %d, max_internal index %d, start position index %d \n",max_internal-position+1,max_internal,position); for (arr_j = max_internal; arr_j >=position; --arr_j){ // go inside out towards the external perimeter (perimeters in reverse order) and store all internal perimeters until the first one identified with inset index 2 diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index fc83b1a8d97..b68930c1dd8 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -2513,7 +2513,10 @@ void PrintObject::bridge_over_infill() [](const Line &s) { return s.a == s.b; }), polygon_sections[i].end()); std::sort(polygon_sections[i].begin(), polygon_sections[i].end(), - [](const Line &a, const Line &b) { return a.a.y() < b.b.y(); }); + [](const Line &a, const Line &b) { + if (a == b) return false; // Ensure irreflexivity + return a.a.y() < b.b.y(); + }); } // reconstruct polygon from polygon sections