diff --git a/resources/ui_layout/print.ui b/resources/ui_layout/print.ui index ab5e3a453..083f8c13f 100644 --- a/resources/ui_layout/print.ui +++ b/resources/ui_layout/print.ui @@ -16,7 +16,10 @@ group:Horizontal shells top_bottom_shell_thickness_explanation setting:enforce_full_fill_volume group:Quality - setting:only_one_perimeter_top + line:Only one perimeter on Top surfaces + setting:label$ :only_one_perimeter_top + setting:label$Minimum width:min_width_top_surface + end_line line:Extra perimeters setting:extra_perimeters_overhangs setting:extra_perimeters_odd_layers diff --git a/src/libslic3r/PerimeterGenerator.cpp b/src/libslic3r/PerimeterGenerator.cpp index 41c0943f5..067f333bf 100644 --- a/src/libslic3r/PerimeterGenerator.cpp +++ b/src/libslic3r/PerimeterGenerator.cpp @@ -483,6 +483,9 @@ void PerimeterGenerator::process() // it's a bit like re-add thin area in to perimeter area. // it can over-extrude a bit, but it's for a better good. { + + + if(config->thin_perimeters) next_onion = union_ex(next_onion, offset_ex(diff_ex(last, thins, true), -(float)(ext_perimeter_width / 2))); @@ -578,15 +581,18 @@ void PerimeterGenerator::process() if (offset_top_surface > 0.9 * (config->perimeters <= 1 ? 0. : (perimeter_spacing * (config->perimeters - 1)))) offset_top_surface -= 0.9 * (config->perimeters <= 1 ? 0. : (perimeter_spacing * (config->perimeters - 1))); else offset_top_surface = 0; + //don't takes into account too thin areas + ExPolygons grown_upper_slices = this->config->min_width_top_surface.value == 0 ? *this->upper_slices : + offset_ex(*this->upper_slices, this->config->min_width_top_surface.get_abs_value(perimeter_width)); // get the real top surface - ExPolygons top_polygons = (!have_to_grow_for_miller) ? diff_ex(last, *this->upper_slices, true) + ExPolygons top_polygons = (!have_to_grow_for_miller) ? diff_ex(last, grown_upper_slices, true) :(unmillable.empty())? - diff_ex(last, offset_ex(*this->upper_slices, mill_extra_size), true) + diff_ex(last, offset_ex(grown_upper_slices, mill_extra_size), true) : - diff_ex(last, diff_ex(offset_ex(*this->upper_slices, mill_extra_size), unmillable, true)); + diff_ex(last, diff_ex(offset_ex(grown_upper_slices, mill_extra_size), unmillable, true)); - //get the not-top surface, from the "real top" but enlarged by external_infill_margin - ExPolygons inner_polygons = diff_ex(last, offset_ex(top_polygons, offset_top_surface), true); + //get the not-top surface, from the "real top" but enlarged by external_infill_margin (and the min_width_top_surface we removed a bit before) + ExPolygons inner_polygons = diff_ex(last, offset_ex(top_polygons, offset_top_surface + this->config->min_width_top_surface.get_abs_value(perimeter_width)), true); // get the enlarged top surface, by using inner_polygons instead of upper_slices top_polygons = diff_ex(last, inner_polygons, true); // increase by half peri the inner space to fill the frontier between last and stored. diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 0ab953a5f..cf6dba3e2 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2008,6 +2008,18 @@ void PrintConfigDef::init_fff_params() def->mode = comSimple; def->set_default_value(new ConfigOptionFloats { 0.07 }); + def = this->add("min_width_top_surface", coFloatOrPercent); + def->label = L("minimum top width for infill"); + def->category = OptionCategory::speed; + def->tooltip = L("If a top surface has to be printed and it's partially covered by an other layer, it won't be considered at a top layer where his width is below this value." + " This can be useful to not let the 'one perimeter on top' trigger on surface that should be covered only by periemters." + " This value can be a mm or a % of the perimeter extrusion width."); + def->sidetext = L("mm or %"); + def->ratio_over = "perimeter_extrusion_width"; + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloatOrPercent(100, true)); + def = this->add("min_print_speed", coFloats); def->label = L("Min print speed"); def->category = OptionCategory::speed; @@ -2015,7 +2027,7 @@ void PrintConfigDef::init_fff_params() def->sidetext = L("mm/s"); def->min = 0; def->mode = comExpert; - def->set_default_value(new ConfigOptionFloats { 10. }); + def->set_default_value(new ConfigOptionFloats{ 10. }); def = this->add("min_skirt_length", coFloat); def->label = L("Minimal filament extrusion length"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 324ef3b97..0117c2ac7 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -654,6 +654,7 @@ public: ConfigOptionFloatOrPercent milling_extra_size; ConfigOptionBool milling_post_process; ConfigOptionFloat milling_speed; + ConfigOptionFloatOrPercent min_width_top_surface; // Detect bridging perimeters ConfigOptionBool overhangs; ConfigOptionFloatOrPercent overhangs_width; @@ -741,6 +742,7 @@ protected: OPT_PTR(milling_extra_size); OPT_PTR(milling_post_process); OPT_PTR(milling_speed); + OPT_PTR(min_width_top_surface); OPT_PTR(overhangs); OPT_PTR(overhangs_width); OPT_PTR(overhangs_reverse); diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 9da11add4..7b43f1dd4 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -303,6 +303,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config) toggle_field("overhangs_width", config->opt_bool("overhangs")); toggle_field("overhangs_reverse_threshold", config->opt_bool("overhangs_reverse")); + toggle_field("min_width_top_surface", config->opt_bool("only_one_perimeter_top")); for (auto el : { "external_perimeters_vase", "external_perimeters_nothole", "external_perimeters_hole"}) toggle_field(el, config->opt_bool("external_perimeters_first")); diff --git a/src/slic3r/GUI/Preset.cpp b/src/slic3r/GUI/Preset.cpp index ae85ca581..aea6ff964 100644 --- a/src/slic3r/GUI/Preset.cpp +++ b/src/slic3r/GUI/Preset.cpp @@ -462,6 +462,7 @@ const std::vector& Preset::print_options() #ifdef HAS_PRESSURE_EQUALIZER "max_volumetric_extrusion_rate_slope_positive", "max_volumetric_extrusion_rate_slope_negative", #endif /* HAS_PRESSURE_EQUALIZER */ + "min_width_top_surface", "perimeter_speed", "small_perimeter_speed", "external_perimeter_speed", "infill_speed", "solid_infill_speed", "top_solid_infill_speed", "support_material_speed", "support_material_xy_spacing", "support_material_interface_speed", "bridge_speed",