From 73635e085591953d2d5eb055718c0215395cca7e Mon Sep 17 00:00:00 2001 From: PavelMikus Date: Thu, 9 Feb 2023 13:36:42 +0100 Subject: [PATCH] Lower the curled height tolerance from 0.3 to 0.1 mm of the curled overhang avoidance algorithm. --- src/libslic3r/SupportSpotsGenerator.cpp | 10 +++++----- src/libslic3r/SupportSpotsGenerator.hpp | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/SupportSpotsGenerator.cpp b/src/libslic3r/SupportSpotsGenerator.cpp index 33dce04a25..e5f58f91e3 100644 --- a/src/libslic3r/SupportSpotsGenerator.cpp +++ b/src/libslic3r/SupportSpotsGenerator.cpp @@ -954,7 +954,7 @@ std::tuple check_stability(const PrintObject *po, float unchecked_dist = params.min_distance_between_support_points + 1.0f; for (const ExtrusionLine &line : current_slice_ext_perims_lines) { - if ((unchecked_dist + line.len < params.min_distance_between_support_points && line.curled_up_height < 0.3f) || + if ((unchecked_dist + line.len < params.min_distance_between_support_points && line.curled_up_height < params.curling_tolerance_limit) || line.len < EPSILON) { unchecked_dist += line.len; } else { @@ -1077,14 +1077,14 @@ void estimate_supports_malformations(SupportLayerPtrs &layers, float flow_width, } for (const ExtrusionLine &line : current_layer_lines) { - if (line.curled_up_height > 0.3f) { + if (line.curled_up_height > params.curling_tolerance_limit) { l->malformed_lines.push_back(Line{Point::new_scale(line.a), Point::new_scale(line.b)}); } } #ifdef DEBUG_FILES for (const ExtrusionLine &line : current_layer_lines) { - if (line.curled_up_height > 0.3f) { + if (line.curled_up_height > params.curling_tolerance_limit) { Vec3f color = value_to_rgbf(-EPSILON, l->height * params.max_curled_height_factor, line.curled_up_height); fprintf(debug_file, "v %f %f %f %f %f %f\n", line.b[0], line.b[1], l->print_z, color[0], color[1], color[2]); } @@ -1150,14 +1150,14 @@ void estimate_malformations(LayerPtrs &layers, const Params ¶ms) } for (const ExtrusionLine &line : current_layer_lines) { - if (line.curled_up_height > 0.3f) { + if (line.curled_up_height > params.curling_tolerance_limit) { l->malformed_lines.push_back(Line{Point::new_scale(line.a), Point::new_scale(line.b)}); } } #ifdef DEBUG_FILES for (const ExtrusionLine &line : current_layer_lines) { - if (line.curled_up_height > 0.3f) { + if (line.curled_up_height > params.curling_tolerance_limit) { Vec3f color = value_to_rgbf(-EPSILON, l->height * params.max_curled_height_factor, line.curled_up_height); fprintf(debug_file, "v %f %f %f %f %f %f\n", line.b[0], line.b[1], l->print_z, color[0], color[1], color[2]); } diff --git a/src/libslic3r/SupportSpotsGenerator.hpp b/src/libslic3r/SupportSpotsGenerator.hpp index dd58c9133f..018b856e0c 100644 --- a/src/libslic3r/SupportSpotsGenerator.hpp +++ b/src/libslic3r/SupportSpotsGenerator.hpp @@ -44,6 +44,7 @@ struct Params const std::pair malformation_distance_factors = std::pair { 0.5, 1.1 }; const float max_curled_height_factor = 10.0f; + const float curling_tolerance_limit = 0.1f; const float min_distance_between_support_points = 3.0f; //mm const float support_points_interface_radius = 1.5f; // mm