From b0a109304704400f6b6c0d7cdbc1ba83074ba71c Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Fri, 26 May 2023 09:20:50 +0200 Subject: [PATCH] Fixed crash in ogranic supports. Fixes #10605 --- src/libslic3r/Support/OrganicSupport.cpp | 2 +- src/libslic3r/Support/TreeSupport.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/Support/OrganicSupport.cpp b/src/libslic3r/Support/OrganicSupport.cpp index f5d66168d..05e515d94 100644 --- a/src/libslic3r/Support/OrganicSupport.cpp +++ b/src/libslic3r/Support/OrganicSupport.cpp @@ -1170,7 +1170,7 @@ void organic_draw_branches( TreeVisitor::visit_recursive(move_bounds, start_element, trees.back()); assert(!trees.back().branches.empty()); //FIXME debugging -#if 1 +#if 0 if (start_element.state.lost) { } else if (start_element.state.verylost) { diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index ffcdc5e3e..af7748e02 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -211,7 +211,7 @@ static std::vector>> group_me //FIXME this is a fudge constant! auto enforcer_overhang_offset = scaled(config.support_tree_tip_diameter.value); - size_t num_overhang_layers = support_auto ? num_object_layers : std::max(size_t(support_enforce_layers), enforcers_layers.size()); + size_t num_overhang_layers = support_auto ? num_object_layers : std::min(num_object_layers, std::max(size_t(support_enforce_layers), enforcers_layers.size())); tbb::parallel_for(tbb::blocked_range(1, num_overhang_layers), [&print_object, &config, &print_config, &enforcers_layers, &blockers_layers, support_auto, support_enforce_layers, support_threshold_auto, tan_threshold, enforcer_overhang_offset, num_raft_layers, &throw_on_cancel, &out]