Organic supports: When propagating "verylost" branches down,

stop when the support area is smaller then half of the branch area.
This commit is contained in:
Vojtech Bubnik 2023-05-12 16:17:22 +02:00
parent f1f568f3fd
commit 1de963d7d7

View File

@ -4415,10 +4415,10 @@ static void draw_branches(
// If the tree bottom is hanging in the air, bring it down to some surface. // If the tree bottom is hanging in the air, bring it down to some surface.
0 : 0 :
std::max(0, layer_begin - layers_propagate_max); std::max(0, layer_begin - layers_propagate_max);
double support_area_min_radius = M_PI * sqr(double(config.branch_radius));
double support_area_stop = std::max(0.2 * M_PI * sqr(double(bottom_radius)), 0.5 * support_area_min_radius);
// Only propagate until the rest area is smaller than this threshold. // Only propagate until the rest area is smaller than this threshold.
double support_area_stop = 0.2 * M_PI * sqr(double(bottom_radius)); double support_area_min = 0.1 * support_area_min_radius;
// Only propagate until the rest area is smaller than this threshold.
double support_area_min = 0.1 * M_PI * sqr(double(config.min_radius));
for (LayerIndex layer_idx = layer_begin - 1; layer_idx >= layer_bottommost; -- layer_idx) { for (LayerIndex layer_idx = layer_begin - 1; layer_idx >= layer_bottommost; -- layer_idx) {
rest_support = diff_clipped(rest_support.empty() ? slices.front() : rest_support, volumes.getCollision(0, layer_idx, false)); rest_support = diff_clipped(rest_support.empty() ? slices.front() : rest_support, volumes.getCollision(0, layer_idx, false));
double rest_support_area = area(rest_support); double rest_support_area = area(rest_support);