From 230c6a1d039bbea2fa66a09965fd728ae8118c0f Mon Sep 17 00:00:00 2001 From: Thomas Rahm <67757218+ThomasRahm@users.noreply.github.com> Date: Wed, 5 Jun 2024 00:29:02 +0200 Subject: [PATCH] Fix issue causing support lines to overlap with the model --- src/TreeSupport.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/TreeSupport.cpp b/src/TreeSupport.cpp index 21a34796de..7d5380478a 100644 --- a/src/TreeSupport.cpp +++ b/src/TreeSupport.cpp @@ -2023,6 +2023,7 @@ void TreeSupport::filterFloatingLines(std::vector& support_layer_storage) return; } + Shape relevant_forbidden = volumes_.getCollision(0, layer_idx, true); Shape outer_walls = TreeSupportUtils::toPolylines(support_layer_storage[layer_idx - 1].getOutsidePolygons()) .createTubeShape( closing_dist, @@ -2043,6 +2044,11 @@ void TreeSupport::filterFloatingLines(std::vector& support_layer_storage) { holes_resting_outside[layer_idx].emplace(idx); } + else if (! hole.intersection(PolygonUtils::clipPolygonWithAABB(relevant_forbidden, hole_aabb)).offset(-config.xy_min_distance / 2).empty()) + { + // technically not resting outside, also not valid, but the alternative is potentially having lines go through the model + holes_resting_outside[layer_idx].emplace(idx); + } else { for (auto [idx2, hole2] : holeparts[layer_idx - 1] | ranges::views::enumerate)