From 36f2df3339fa1ce37b65a39e7dfcb3f401c38ac7 Mon Sep 17 00:00:00 2001 From: Arthur Date: Fri, 12 Apr 2024 19:46:04 +0800 Subject: [PATCH] FIX: blockers not working for sharp tails of tree support also change default style to tree organic jira: STUDIO-6801 Change-Id: Iab1d8c6117139c9a7a4c1fa71de0a13bcb356dd5 (cherry picked from commit d2c4efad58f16b23bef49bd47d3b70bf322d6f55) (cherry picked from commit cd9305e3e061b67903ed8f5cd05d0136d608ee01) --- src/libslic3r/Support/TreeSupport.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/libslic3r/Support/TreeSupport.cpp b/src/libslic3r/Support/TreeSupport.cpp index c4c01c3399..914a0ed667 100644 --- a/src/libslic3r/Support/TreeSupport.cpp +++ b/src/libslic3r/Support/TreeSupport.cpp @@ -1033,18 +1033,20 @@ void TreeSupport::detect_overhangs(bool check_support_necessity/* = false*/) } } + if (layer_nr < blockers.size()) { + // Arthur: union_ is a must because after mirroring, the blocker polygons are in left-hand coordinates, ie clockwise, + // which are not valid polygons, and will be removed by offset_ex. union_ can make these polygons right. + ExPolygons blocker = offset_ex(union_(blockers[layer_nr]), scale_(radius_sample_resolution)); + layer->loverhangs = diff_ex(layer->loverhangs, blocker); + layer->cantilevers = diff_ex(layer->cantilevers, blocker); + sharp_tail_overhangs = diff_ex(sharp_tail_overhangs, blocker); + } + if (support_critical_regions_only && is_auto(stype)) { layer->loverhangs.clear(); // remove oridinary overhangs, only keep cantilevers and sharp tails (added later) append(layer->loverhangs, layer->cantilevers); } - if (layer_nr < blockers.size()) { - Polygons& blocker = blockers[layer_nr]; - // Arthur: union_ is a must because after mirroring, the blocker polygons are in left-hand coordinates, ie clockwise, - // which are not valid polygons, and will be removed by offset_ex. union_ can make these polygons right. - layer->loverhangs = diff_ex(layer->loverhangs, offset_ex(union_(blocker), scale_(radius_sample_resolution))); - } - if (max_bridge_length > 0 && layer->loverhangs.size() > 0 && lower_layer) { // do not break bridge for normal part in TreeHybrid, nor Tree Strong bool break_bridge = !(m_support_params.support_style == smsTreeHybrid && area(layer->loverhangs) > m_support_params.thresh_big_overhang)