From 9d37a31338cf42a285b39daab84af5504e51d009 Mon Sep 17 00:00:00 2001 From: Arthur Date: Wed, 31 Jan 2024 14:05:09 +0800 Subject: [PATCH] FIX: z_distance_top==0 not working jira: STUDIO-6144 Change-Id: I9ddaa237e2d71c8697a41bbbdb86f70d0b1e1452 (cherry picked from commit 38ba45e9cf7f59d2c1de658a56d8f2b109721bcd) --- src/libslic3r/Support/TreeSupport.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index e6ce383c2..066dfdd76 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -3233,6 +3233,7 @@ void TreeSupport::generate_contact_points(std::vector> } } const int z_distance_top_layers = round_up_divide(scale_(z_distance_top), scale_(layer_height)) + 1; //Support must always be 1 layer below overhang. + int gap_layers = z_distance_top == 0 ? 0 : 1; // virtual layer with 0 height will be deleted if (z_distance_top == 0) z_distance_top = 0.001; @@ -3278,7 +3279,7 @@ void TreeSupport::generate_contact_points(std::vector> // print_z=object_layer->bottom_z: it directly contacts the bottom // height=z_distance_top: it's height is exactly the gap distance // dist_mm_to_top=0: it directly contacts the bottom - contact_node = m_ts_data->create_node(pt, -1, layer_nr - 1, support_roof_layers + 1, to_buildplate, SupportNode::NO_PARENT, bottom_z, z_distance_top, 0, + contact_node = m_ts_data->create_node(pt, -gap_layers, layer_nr - 1, support_roof_layers + 1, to_buildplate, SupportNode::NO_PARENT, bottom_z, z_distance_top, 0, unscale_(radius)); contact_node->overhang = overhang_part; contact_node->is_sharp_tail = is_sharp_tail; @@ -3365,7 +3366,7 @@ void TreeSupport::generate_contact_points(std::vector> } else { for (auto& elem : move_bounds_layer) { - SupportNode* contact_node = m_ts_data->create_node(elem.state.result_on_layer, -z_distance_top_layers, layer_nr, support_roof_layers + z_distance_top_layers, elem.state.to_buildplate, + SupportNode* contact_node = m_ts_data->create_node(elem.state.result_on_layer, -gap_layers, layer_nr-1, support_roof_layers + 1, elem.state.to_buildplate, SupportNode::NO_PARENT, print_z, height, z_distance_top); contact_node->overhang = ExPolygon(elem.influence_area.front()); curr_nodes.emplace_back(contact_node);