From af2d2d48033e47b73d76c8170dcce2cabb59bbd4 Mon Sep 17 00:00:00 2001 From: Rodrigo Faselli <162915171+RF47@users.noreply.github.com> Date: Tue, 12 May 2026 06:46:07 -0300 Subject: [PATCH] Fix collision with the bed using tree supports (#13524) Fix colllision with the bed using tree supports --- src/libslic3r/Support/TreeSupport.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index 215fc12c8c..2209afbd7b 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -3253,6 +3253,7 @@ std::vector TreeSupport::plan_layer_heights() obj_layer_zs.reserve(m_object->layer_count()); for (const Layer *l : m_object->layers()) obj_layer_zs.emplace_back((float) l->print_z); z_heights[m_object->get_layer(0)->print_z] = m_object->get_layer(0)->height; + const coordf_t min_print_z = m_object->get_layer(0)->print_z; // Collect top contact layers for (int layer_nr = 1; layer_nr < contact_nodes.size(); layer_nr++) { if (!contact_nodes[layer_nr].empty()) { @@ -3260,7 +3261,7 @@ std::vector TreeSupport::plan_layer_heights() coordf_t height = contact_nodes[layer_nr].front()->height; // insertion will fail if there is already a key of print_z, so no need to check bounds.insert({print_z, height}); - bounds.insert({print_z - height, 0}); // the bottom_z of the layer + bounds.insert({std::max(min_print_z, print_z - height), 0}); // the bottom_z of the layer } }