ENH: improve first layer tree support

First layer support can't be top interface, and
min brim width of auto mode should be larger
than 0.

Jira: STUDIO-5010
Change-Id: I02f8b017b535f8a47965387e8679f692b1966e04
(cherry picked from commit 3e7d54abe352e8ab5f9d6492b5a86a96f9067f94)
(cherry picked from commit 7efebe6bc6)
This commit is contained in:
Arthur 2023-10-31 10:33:42 +08:00 committed by Noisyfox
parent 5fb0e01943
commit 8a7cc79129
2 changed files with 6 additions and 5 deletions

View file

@ -2011,7 +2011,7 @@ void TreeSupport::draw_circles(const std::vector<std::vector<SupportNode*>>& con
}
}
if (layer_nr == 0 && m_raft_layers == 0) {
double brim_width = !config.tree_support_auto_brim ? tree_brim_width : std::max(0.0, std::min(node.radius + node.dist_mm_to_top / (scale * branch_radius) * 0.5, MAX_BRANCH_RADIUS_FIRST_LAYER) - node.radius);
double brim_width = !config.tree_support_auto_brim ? tree_brim_width : std::max(MIN_BRANCH_RADIUS_FIRST_LAYER, std::min(node.radius + node.dist_mm_to_top / (scale * branch_radius) * 0.5, MAX_BRANCH_RADIUS_FIRST_LAYER) - node.radius);
auto tmp=offset(circle, scale_(brim_width));
if(!tmp.empty())
circle = tmp[0];
@ -2032,14 +2032,14 @@ void TreeSupport::draw_circles(const std::vector<std::vector<SupportNode*>>& con
has_circle_node = true;
}
if (node.distance_to_top < 0)
if (layer_nr>0 && node.distance_to_top < 0)
append(roof_gap_areas, area);
else if (node.support_roof_layers_below == 1)
else if (layer_nr > 0 && node.support_roof_layers_below == 1)
{
append(roof_1st_layer, area);
max_layers_above_roof1 = std::max(max_layers_above_roof1, node.dist_mm_to_top);
}
else if (node.support_roof_layers_below > 0)
else if (layer_nr > 0 && node.support_roof_layers_below > 0)
{
append(roof_areas, area);
max_layers_above_roof = std::max(max_layers_above_roof, node.dist_mm_to_top);