From 7745c29c515872705bbe372308c36563fb607b7f Mon Sep 17 00:00:00 2001 From: "jiaxi.chen" Date: Fri, 24 Jan 2025 12:01:45 +0800 Subject: [PATCH] FIX: useless expansion of top_interface && hybrid tree may collide with model 1. only expand 2mm for BigFlat/ThinPlate overhangs, unnecessary for tree node overhangs without big areas. 2. avoid the situation that some overhangs are extended to fall on models when smoothing. jira: STUDIO-10177 Change-Id: Icec0bb59627bb85332ad1435cbe29a07f57f922e --- src/libslic3r/Support/TreeSupport.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index 3883eedde..6cb492e7b 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -3025,7 +3025,7 @@ void TreeSupport::drop_nodes() smooth_filter(overhang.contour, 2, movements, max_move_distance / 2.); for (auto &pt : overhang.contour.points) { auto tmp = pt + movements.at(pt); - if (!is_inside_ex(to_expolygons({contour}), tmp)) + if (!is_inside_ex(to_expolygons({contour}), tmp) && !is_inside_ex(m_ts_data->m_layer_outlines_below[obj_layer_nr], tmp)) pt = tmp; } } @@ -3741,14 +3741,14 @@ void TreeSupport::generate_contact_points() const auto &overhang_type = overhang_with_type.second; is_sharp_tail = overhang_type & OverhangType::SharpTail; bool add_interface = (force_tip_to_roof || area(overhang_part) > minimum_roof_area); + const auto &relevant_forbidden = get_collision(0, layer_nr - 1); ExPolygons overhangs{overhang_part}; - if (add_interface && xy_expansion > EPSILON && !is_sharp_tail) { - const auto &relevant_forbidden = get_collision(0, layer_nr - 1); - overhangs = safe_offset_inc(overhangs, xy_expansion, relevant_forbidden, scale_(MIN_BRANCH_RADIUS * 1.75), 0, 1); - } ExPolygons overhangs_regular; if (m_support_params.support_style == smsTreeHybrid && (overhang_type & (BigFlat | ThinPlate))) { + if (add_interface && xy_expansion > EPSILON && !is_sharp_tail) { + overhangs = safe_offset_inc(overhangs, xy_expansion, relevant_forbidden, scale_(MIN_BRANCH_RADIUS * 1.75), 0, 1); + } overhangs_regular = offset_ex(intersection_ex(overhangs, m_ts_data->m_layer_outlines_below[layer_nr - 1]), radius_scaled); ExPolygons overhangs_normal = diff_ex(overhangs, overhangs_regular); // if the outside area is still big, we can need normal nodes @@ -3766,6 +3766,7 @@ void TreeSupport::generate_contact_points() } } else{ + if (add_interface) overhangs = safe_offset_inc(overhangs, scale_(config.support_expansion.value), relevant_forbidden, scale_(MIN_BRANCH_RADIUS * 1.75), 0, 1); overhangs_regular = overhangs; }