From 1752db52531887c67b7bbc4218cf85e1619537f8 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 9 Oct 2024 18:16:18 +0200 Subject: [PATCH] Fix 'encompassing hole' issue (tree support). When a hole is large enough to wholly contain (sometimes many) other brances, those also get cut. This prevents that. The solution isn't ideal, as there is an offset happening somewhere, but it's better than just missing the top of trees. CURA-12153 --- src/TreeSupport.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/TreeSupport.cpp b/src/TreeSupport.cpp index 67a68e1cf6..783807e002 100644 --- a/src/TreeSupport.cpp +++ b/src/TreeSupport.cpp @@ -2093,6 +2093,17 @@ void TreeSupport::filterFloatingLines(std::vector& support_layer_storage) if (! found) { next_removed_holes_by_idx.emplace(idx); + + // Individual pieces of the hole could still be valid (if the 'hole' is made by branches surrounding others' for instance). + for (const auto& poly : hole) + { + if (poly.area() < 0) + { + auto poly_copy = poly; + poly_copy.reverse(); + valid_holes[layer_idx].push_back(poly_copy); + } + } } else {