ENH: slightly offset the transition layer of Hybrid Tree && add more brim for supports

jira: STUDIO-12168
Change-Id: I793621412a427a7750791e841e5ccff17b0a7ff5
This commit is contained in:
jiaxi.chen 2025-05-13 16:39:49 +08:00 committed by lane.wei
parent 208954115f
commit 48262a5a89
2 changed files with 9 additions and 1 deletions

View File

@ -1023,6 +1023,10 @@ static ExPolygons outer_inner_brim_area(const Print& print,
if (brimAreaMap.find(object->id()) != brimAreaMap.end()) if (brimAreaMap.find(object->id()) != brimAreaMap.end())
expolygons_append(brim_area, brimAreaMap[object->id()]); expolygons_append(brim_area, brimAreaMap[object->id()]);
} }
if (!object->support_layers().empty() && !object->support_layers().front()->support_islands.empty())
brim_area_support = offset_ex(object->support_layers().front()->support_islands, brim_width);
support_material_extruder = object->config().support_filament; support_material_extruder = object->config().support_filament;
if (support_material_extruder == 0 && object->has_support_material()) { if (support_material_extruder == 0 && object->has_support_material()) {
if (print.config().print_sequence == PrintSequence::ByObject) if (print.config().print_sequence == PrintSequence::ByObject)

View File

@ -3087,6 +3087,9 @@ void TreeSupport::drop_nodes()
p_node->origin_area = node.overhang.area(); p_node->origin_area = node.overhang.area();
densify_polygon(p_node->overhang.contour, 2.); densify_polygon(p_node->overhang.contour, 2.);
} }
if (m_support_params.num_top_interface_layers > 0 && obj_layer_nr_next > 0 && node.support_roof_layers_below == 1 &&
node.distance_to_top >= m_support_params.num_top_interface_layers)
overhangs_next = safe_offset_inc(overhangs_next, scale_(max_move_distance), get_collision(0, obj_layer_nr_next), scale_(MIN_BRANCH_RADIUS * 1.75), 0, 1);
for(auto& overhang:overhangs_next) { for(auto& overhang:overhangs_next) {
if (overhang.empty()) continue; if (overhang.empty()) continue;
if (overhang.area() > node.origin_area / 2. && overhang.area() > SQ(scale_(10.))) { if (overhang.area() > node.origin_area / 2. && overhang.area() > SQ(scale_(10.))) {
@ -3100,7 +3103,8 @@ void TreeSupport::drop_nodes()
} }
} }
// if the part would fall straight to th buildplate, shrink it a little // if the part would fall straight to th buildplate, shrink it a little
if (overhang.area() > node.origin_area / 2. && overhang.area() > double(SQ(scale_(10.)))) { if (node.support_roof_layers_below<0 && overhang.area() > node.origin_area / 2. &&
overhang.area() > double(SQ(scale_(10.)))) {
ExPolygons shrink_overhangs = union_ex(shrink_ex(safe_union({overhang}), double(scale_(max_move_distance / 2.)))); ExPolygons shrink_overhangs = union_ex(shrink_ex(safe_union({overhang}), double(scale_(max_move_distance / 2.))));
if (shrink_overhangs.size() == 1 && shrink_overhangs[0].area() > double(SQ(scale_(10.))) && if (shrink_overhangs.size() == 1 && shrink_overhangs[0].area() > double(SQ(scale_(10.))) &&
!overlaps({overhang}, m_ts_data->m_layer_outlines_below[obj_layer_nr_next])) { !overlaps({overhang}, m_ts_data->m_layer_outlines_below[obj_layer_nr_next])) {