Skip to content

Commit

Permalink
Fix regression causing hole removal to not work correctly.
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasRahm committed Jun 4, 2024
1 parent cc8147b commit 11b4a76
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions src/TreeSupport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2980,14 +2980,6 @@ void TreeSupport::removeFloatingHoles(std::vector<Polygons>& support_layer_stora
std::vector<std::set<size_t>>& non_removable_holes,
std::vector<std::map<size_t, std::vector<size_t>>>& hole_rest_map)
{
std::function<void(Polygons&)> reversePolygon = [&](Polygons& poly)
{
for (size_t idx = 0; idx < poly.size(); idx++)
{
poly[idx].reverse();
}
};

std::unordered_set<size_t> removed_holes_by_idx;
std::vector<Polygons> 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
Expand Down Expand Up @@ -3046,9 +3038,8 @@ void TreeSupport::removeFloatingHoles(std::vector<Polygons>& 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]);
});

}
Expand Down

0 comments on commit 11b4a76

Please sign in to comment.