From 60dd35b4bf44a0187de68ed05c64632395110ae2 Mon Sep 17 00:00:00 2001 From: "salt.wei" Date: Tue, 11 Apr 2023 10:08:17 +0800 Subject: [PATCH] ENH: fuzzy skin handling 1 limit the range of setting 2 avoid too dense points when fuzzy skin enabled Signed-off-by: salt.wei Change-Id: I6691fd03d2aa960b055b68100dfb338b640cb4af --- src/libslic3r/PerimeterGenerator.cpp | 7 +++++-- src/libslic3r/PrintConfig.cpp | 3 +++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/PerimeterGenerator.cpp b/src/libslic3r/PerimeterGenerator.cpp index 9a3a7f759..093e47dc9 100644 --- a/src/libslic3r/PerimeterGenerator.cpp +++ b/src/libslic3r/PerimeterGenerator.cpp @@ -834,7 +834,7 @@ void PerimeterGenerator::process_classic() // extra perimeters for each one // BBS: don't simplify too much which influence arc fitting when export gcode if arc_fitting is enabled - double surface_simplify_resolution = (print_config->enable_arc_fitting) ? 0.1 * m_scaled_resolution : m_scaled_resolution; + double surface_simplify_resolution = (print_config->enable_arc_fitting && this->config->fuzzy_skin == FuzzySkinType::None) ? 0.2 * m_scaled_resolution : m_scaled_resolution; for (const Surface &surface : this->slices->surfaces) { // detect how many perimeters must be generated for this island int loop_number = this->config->wall_loops + surface.extra_perimeters - 1; // 0-indexed loops @@ -1276,12 +1276,15 @@ void PerimeterGenerator::process_arachne() m_lower_slices_polygons = offset(*this->lower_slices, float(scale_(+nozzle_diameter / 2))); } + + // BBS: don't simplify too much which influence arc fitting when export gcode if arc_fitting is enabled + double surface_simplify_resolution = (print_config->enable_arc_fitting && this->config->fuzzy_skin == FuzzySkinType::None) ? 0.2 * m_scaled_resolution : m_scaled_resolution; // we need to process each island separately because we might have different // extra perimeters for each one for (const Surface& surface : this->slices->surfaces) { // detect how many perimeters must be generated for this island int loop_number = this->config->wall_loops + surface.extra_perimeters - 1; // 0-indexed loops - ExPolygons last = offset_ex(surface.expolygon.simplify_p(m_scaled_resolution), -float(ext_perimeter_width / 2. - ext_perimeter_spacing / 2.)); + ExPolygons last = offset_ex(surface.expolygon.simplify_p(surface_simplify_resolution), -float(ext_perimeter_width / 2. - ext_perimeter_spacing / 2.)); Polygons last_p = to_polygons(last); double min_nozzle_diameter = *std::min_element(print_config->nozzle_diameter.values.begin(), print_config->nozzle_diameter.values.end()); diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 688444d01..8eb35eb73 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1443,6 +1443,7 @@ void PrintConfigDef::init_fff_params() def->tooltip = L("The width within which to jitter. It's adversed to be below outer wall line width"); def->sidetext = L("mm"); def->min = 0; + def->max = 1; def->mode = comSimple; def->set_default_value(new ConfigOptionFloat(0.3)); @@ -1451,6 +1452,8 @@ void PrintConfigDef::init_fff_params() def->category = L("Others"); def->tooltip = L("The average diatance between the random points introducded on each line segment"); def->sidetext = L("mm"); + def->min = 0; + def->max = 5; def->mode = comSimple; def->set_default_value(new ConfigOptionFloat(0.8));