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)
This commit is contained in:
Arthur 2024-04-12 19:46:04 +08:00 committed by Lane.Wei
parent 1389862ad8
commit cd9305e3e0
1 changed files with 10 additions and 8 deletions

View File

@ -605,7 +605,7 @@ TreeSupport::TreeSupport(PrintObject& object, const SlicingParameters &slicing_p
support_type = m_object_config->support_type;
support_style = m_object_config->support_style;
if (support_style == smsDefault)
support_style = smsTreeHybrid;
support_style = smsTreeOrganic;
SupportMaterialPattern support_pattern = m_object_config->support_base_pattern;
if (support_style == smsTreeHybrid && support_pattern == smpDefault)
support_pattern = smpRectilinear;
@ -1056,18 +1056,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 = !(support_style == smsTreeHybrid && area(layer->loverhangs) > m_support_params.thresh_big_overhang)