From 885352e98a4a2505dc564be0f563238e27772ae2 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 10 Jul 2024 13:30:32 +0200 Subject: [PATCH 1/2] Tree-support: Create more dissalowed area; prevents model-intersection. CURA-11875 Co-authored-by: Thomas Rahm <67757218+ThomasRahm@users.noreply.github.com> --- src/TreeSupport.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/TreeSupport.cpp b/src/TreeSupport.cpp index 21a34796de..4c197a7760 100644 --- a/src/TreeSupport.cpp +++ b/src/TreeSupport.cpp @@ -2023,10 +2023,8 @@ void TreeSupport::filterFloatingLines(std::vector& support_layer_storage) return; } - Shape outer_walls = TreeSupportUtils::toPolylines(support_layer_storage[layer_idx - 1].getOutsidePolygons()) - .createTubeShape( - closing_dist, - 0); //.unionPolygons(volumes_.getCollision(0, layer_idx - 1, true).offset(-(config.support_line_width+config.xy_min_distance))); + const Shape relevant_forbidden = volumes_.getCollision(0, layer_idx, true); + Shape outer_walls = TreeSupportUtils::toPolylines(support_layer_storage[layer_idx - 1].getOutsidePolygons()).createTubeShape(closing_dist, 0); Shape holes_below; @@ -2043,6 +2041,10 @@ 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)).area() > hole.length() * EPSILON) + { + holes_resting_outside[layer_idx].emplace(idx); // technically not resting outside, also not valid, but the alternative is potentially having lines go though the model + } else { for (auto [idx2, hole2] : holeparts[layer_idx - 1] | ranges::views::enumerate) From 35c7ecaad75541dd47075d7f9073ad59f2109683 Mon Sep 17 00:00:00 2001 From: rburema Date: Wed, 10 Jul 2024 11:31:19 +0000 Subject: [PATCH 2/2] Applied clang-format. --- src/TreeSupport.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/TreeSupport.cpp b/src/TreeSupport.cpp index 4c197a7760..3f52a1625d 100644 --- a/src/TreeSupport.cpp +++ b/src/TreeSupport.cpp @@ -2043,7 +2043,8 @@ void TreeSupport::filterFloatingLines(std::vector& support_layer_storage) } else if (hole.intersection(PolygonUtils::clipPolygonWithAABB(relevant_forbidden, hole_aabb)).area() > hole.length() * EPSILON) { - holes_resting_outside[layer_idx].emplace(idx); // technically not resting outside, also not valid, but the alternative is potentially having lines go though the model + holes_resting_outside[layer_idx].emplace( + idx); // technically not resting outside, also not valid, but the alternative is potentially having lines go though the model } else {