diff --git a/src/libslic3r/Layer.cpp b/src/libslic3r/Layer.cpp index 74ca72b30..6ea59ddf2 100644 --- a/src/libslic3r/Layer.cpp +++ b/src/libslic3r/Layer.cpp @@ -137,6 +137,7 @@ void Layer::make_perimeters() && config.opt_serialize("external_perimeter_extrusion_width").compare(other_config.opt_serialize("external_perimeter_extrusion_width")) == 0 && config.thin_walls == other_config.thin_walls && config.thin_walls_min_width == other_config.thin_walls_min_width + && config.thin_perimeters == other_config.thin_perimeters && config.thin_walls_overlap == other_config.thin_walls_overlap && config.external_perimeters_first == other_config.external_perimeters_first && config.infill_overlap == other_config.infill_overlap diff --git a/src/libslic3r/PerimeterGenerator.cpp b/src/libslic3r/PerimeterGenerator.cpp index c6210d265..eb719d18f 100644 --- a/src/libslic3r/PerimeterGenerator.cpp +++ b/src/libslic3r/PerimeterGenerator.cpp @@ -351,22 +351,21 @@ void PerimeterGenerator::process() //this variable stored the next onion ExPolygons next_onion; if (i == 0) { - // compute next onion, without taking care of thin_walls : destroy too thin areas. - if (!this->config->thin_walls) - next_onion = offset2_ex( - last, - -(float)(ext_perimeter_width / 2 + ext_min_spacing / 2 - 1), - +(float)(ext_min_spacing / 2 - 1)); - - - // look for thin walls - if (this->config->thin_walls) { + // compute next onion // the minimum thickness of a single loop is: // ext_width/2 + ext_spacing/2 + spacing/2 + width/2 + if (this->config->thin_perimeters) + next_onion = offset_ex( + last, + -(float)(ext_perimeter_width / 2)); + else next_onion = offset2_ex( last, -(float)(ext_perimeter_width / 2 + ext_min_spacing / 2 - 1), +(float)(ext_min_spacing / 2 - 1)); + + // look for thin walls + if (this->config->thin_walls) { // detect edge case where a curve can be split in multiple small chunks. ExPolygons no_thin_onion = offset_ex(last, double( - ext_perimeter_width / 2)); float div = 2; diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index f12a08b7d..8373bf145 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2811,13 +2811,21 @@ void PrintConfigDef::init_fff_params() def->max = max_temp; def->set_default_value(new ConfigOptionInts { 200 }); + def = this->add("thin_perimeters", coBool); + def->label = L("Overlapping perimeters"); + def->full_label = L("Overlapping perimeters"); + def->category = OptionCategory::perimeter; + def->tooltip = L("Allow external perimeter to overlap each other to avoid the use of thin walls. Note that their flow isn't adjusted and so it will result in over-extruding and undefined behavior."); + def->mode = comExpert; + def->set_default_value(new ConfigOptionBool(false)); + def = this->add("thin_walls", coBool); def->label = L(""); def->full_label = L("Thin walls"); def->category = OptionCategory::perimeter; def->tooltip = L("Detect single-width walls (parts where two extrusions don't fit and we need " - "to collapse them into a single trace). If unchecked, slic3r may try to fit perimeters " - "where it's not possible, creating some overlap leading to over-extrusion."); + "to collapse them into a single trace). If unchecked, slic3r may try to fit perimeters " + "where it's not possible, creating some overlap leading to over-extrusion."); def->mode = comAdvanced; def->set_default_value(new ConfigOptionBool(true)); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 2f4c4bd36..c4c830579 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -629,6 +629,7 @@ public: ConfigOptionInt solid_infill_every_layers; ConfigOptionFloatOrPercent solid_infill_speed; // Detect thin walls. + ConfigOptionBool thin_perimeters; ConfigOptionBool thin_walls; ConfigOptionFloatOrPercent thin_walls_min_width; ConfigOptionFloatOrPercent thin_walls_overlap; @@ -696,6 +697,7 @@ protected: OPT_PTR(solid_infill_extrusion_width); OPT_PTR(solid_infill_every_layers); OPT_PTR(solid_infill_speed); + OPT_PTR(thin_perimeters); OPT_PTR(thin_walls); OPT_PTR(thin_walls_min_width); OPT_PTR(thin_walls_overlap); diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 631411b8c..4e26c8c0e 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -595,6 +595,7 @@ bool PrintObject::invalidate_state_by_config_options(const std::vector& Preset::print_options() "layer_height", "first_layer_height", "perimeters", "spiral_vase", "slice_closing_radius", "top_solid_layers", "bottom_solid_layers", "extra_perimeters", "extra_perimeters_odd_layers", - "only_one_perimeter_top", "ensure_vertical_shell_thickness", "avoid_crossing_perimeters", "thin_walls", "overhangs", + "only_one_perimeter_top", "ensure_vertical_shell_thickness", "avoid_crossing_perimeters", + "thin_perimeters", + "thin_walls", "overhangs", "overhangs_width", "seam_position", "external_perimeters_first", diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 2405f1ed6..3cfee9131 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1058,6 +1058,7 @@ void TabPrint::build() optgroup->append_single_option_line("only_one_perimeter_top"); optgroup->append_single_option_line("ensure_vertical_shell_thickness"); optgroup->append_single_option_line("avoid_crossing_perimeters"); + optgroup->append_single_option_line("thin_perimeters"); line = { _(L("Thin walls")), "" }; line.append_option(optgroup->get_option("thin_walls")); line.append_option(optgroup->get_option("thin_walls_min_width"));