From 5fb0e01943e2c049a1a22859e31aaa2d7ea03481 Mon Sep 17 00:00:00 2001 From: Noisyfox Date: Mon, 27 Jan 2025 15:32:38 +0800 Subject: [PATCH] ENH: improve auto-arranging objects with tree support We decide to set brim width of all objects to MAX_BRANCH_RADIUS_FIRST_LAYER if there is an object with tree support after discussion. Jira: MAK-2009 Change-Id: I4c4940800632c433235966b01c44ac910e33a51c (cherry picked from commit bambulab/BambuStudio@2bd6b1150565b2345d9517ea10b8f2ea621c635b) Co-authored-by: Arthur --- src/libslic3r/Support/TreeSupport.cpp | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index c88225c91b..a1e983cb67 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -1920,7 +1920,7 @@ void TreeSupport::draw_circles(const std::vector>& con const bool with_lightning_infill = m_support_params.base_fill_pattern == ipLightning; coordf_t support_extrusion_width = m_support_params.support_extrusion_width; - const size_t wall_count = config.tree_support_wall_count.value; + const float tree_brim_width = config.tree_support_brim_width.value; const PrintObjectConfig& object_config = m_object->config(); BOOST_LOG_TRIVIAL(info) << "draw_circles for object: " << m_object->model_object()->name; @@ -2011,11 +2011,7 @@ void TreeSupport::draw_circles(const std::vector>& con } } if (layer_nr == 0 && m_raft_layers == 0) { - double brim_width = - config.tree_support_auto_brim - ? node.dist_mm_to_top / - (scale * branch_radius) * 0.5 - : config.tree_support_brim_width; + double brim_width = !config.tree_support_auto_brim ? tree_brim_width : std::max(0.0, std::min(node.radius + node.dist_mm_to_top / (scale * branch_radius) * 0.5, MAX_BRANCH_RADIUS_FIRST_LAYER) - node.radius); auto tmp=offset(circle, scale_(brim_width)); if(!tmp.empty()) circle = tmp[0];