From 11b4a76214db2c8cbc66db22f763c979737f0e58 Mon Sep 17 00:00:00 2001 From: Thomas Rahm <67757218+ThomasRahm@users.noreply.github.com> Date: Tue, 4 Jun 2024 03:53:34 +0200 Subject: [PATCH] Fix regression causing hole removal to not work correctly. --- src/TreeSupport.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/TreeSupport.cpp b/src/TreeSupport.cpp index 8bf3eab511..514db163ef 100644 --- a/src/TreeSupport.cpp +++ b/src/TreeSupport.cpp @@ -2980,14 +2980,6 @@ void TreeSupport::removeFloatingHoles(std::vector& support_layer_stora std::vector>& non_removable_holes, std::vector>>& hole_rest_map) { - std::function reversePolygon = [&](Polygons& poly) - { - for (size_t idx = 0; idx < poly.size(); idx++) - { - poly[idx].reverse(); - } - }; - std::unordered_set removed_holes_by_idx; std::vector valid_holes_areas(hole_parts.size(), Polygons()); // Check which holes have to be removed as they do not rest on anything. Only keep holes that have to be removed @@ -3046,9 +3038,8 @@ void TreeSupport::removeFloatingHoles(std::vector& support_layer_stora return; } - support_layer_storage[layer_idx] = support_layer_storage[layer_idx].getOutsidePolygons(); - reversePolygon(valid_holes_areas[layer_idx]); - support_layer_storage[layer_idx].add(valid_holes_areas[layer_idx]); + //Because the support_layer_storage could be modified (e.g. because the holes are now skin), just adding back the reversed holes is no longer working. Need to do a real difference instead. + support_layer_storage[layer_idx] = support_layer_storage[layer_idx].getOutsidePolygons().difference(valid_holes_areas[layer_idx]); }); }