diff --git a/xs/src/libslic3r/PerimeterGenerator.cpp b/xs/src/libslic3r/PerimeterGenerator.cpp index e5fee9dfc..7218e028f 100644 --- a/xs/src/libslic3r/PerimeterGenerator.cpp +++ b/xs/src/libslic3r/PerimeterGenerator.cpp @@ -293,7 +293,7 @@ void PerimeterGenerator::process() next_onion = offset_ex(last, -(float)(distance)); } // look for gaps - if (this->config->gap_fill_speed.value > 0 && this->config->fill_density.value > 0) + if (this->config->gap_fill_speed.value > 0 && this->config->gap_fill) // not using safety offset here would "detect" very narrow gaps // (but still long enough to escape the area threshold) that gap fill // won't be able to fill but we'd still remove from infill area diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index 37df24e55..ca516a4a4 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/xs/src/libslic3r/PrintConfig.cpp @@ -871,13 +871,21 @@ PrintConfigDef::PrintConfigDef() def->cli = "first-layer-temperature=i@"; def->min = 0; def->max = max_temp; - def->default_value = new ConfigOptionInts { 200 }; - + def->default_value = new ConfigOptionInts{ 200 }; + + def = this->add("gap_fill", coBool); + def->label = L("Gap fill"); + def->category = L("Advanced"); + def->tooltip = L("Enable gap fill algorithm. It will extrude small lines between perimeter " + "when there are not enough space for an other perimeter or an infill."); + def->cli = "gap-fill!"; + def->default_value = new ConfigOptionBool(true); + def = this->add("gap_fill_speed", coFloat); def->label = L("Gap fill"); def->category = L("Speed"); def->tooltip = L("Speed for filling small gaps using short zigzag moves. Keep this reasonably low " - "to avoid too much shaking and resonance issues. Set zero to disable gaps filling."); + "to avoid too much shaking and resonance issues. Set zero to disable gaps filling."); def->sidetext = L("mm/s"); def->cli = "gap-fill-speed=f"; def->min = 0; diff --git a/xs/src/libslic3r/PrintConfig.hpp b/xs/src/libslic3r/PrintConfig.hpp index 31d8c6c6c..007528077 100644 --- a/xs/src/libslic3r/PrintConfig.hpp +++ b/xs/src/libslic3r/PrintConfig.hpp @@ -423,6 +423,7 @@ public: ConfigOptionFloat fill_angle; ConfigOptionPercent fill_density; ConfigOptionEnum fill_pattern; + ConfigOptionBool gap_fill; ConfigOptionFloat gap_fill_speed; ConfigOptionInt infill_extruder; ConfigOptionFloatOrPercent infill_extrusion_width; @@ -473,6 +474,7 @@ protected: OPT_PTR(fill_angle); OPT_PTR(fill_density); OPT_PTR(fill_pattern); + OPT_PTR(gap_fill); OPT_PTR(gap_fill_speed); OPT_PTR(infill_extruder); OPT_PTR(infill_extrusion_width); diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp index 2fb68c301..c6bf07c40 100644 --- a/xs/src/libslic3r/PrintObject.cpp +++ b/xs/src/libslic3r/PrintObject.cpp @@ -149,6 +149,7 @@ bool PrintObject::invalidate_state_by_config_options(const std::vector& Preset::print_options() "max_volumetric_speed", "max_volumetric_extrusion_rate_slope_positive", "max_volumetric_extrusion_rate_slope_negative", "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", "gap_fill_speed", "travel_speed", "first_layer_speed", "perimeter_acceleration", "infill_acceleration", + "bridge_speed", "gap_fill", "gap_fill_speed", "travel_speed", "first_layer_speed", "perimeter_acceleration", "infill_acceleration", "bridge_acceleration", "first_layer_acceleration", "default_acceleration", "skirts", "skirt_distance", "skirt_height", "min_skirt_length", "brim_width", "support_material", "support_material_threshold", "support_material_enforce_layers", "raft_layers", "support_material_pattern", "support_material_with_sheath", "support_material_spacing", diff --git a/xs/src/slic3r/GUI/Tab.cpp b/xs/src/slic3r/GUI/Tab.cpp index ab3efb7bc..fa28ff680 100644 --- a/xs/src/slic3r/GUI/Tab.cpp +++ b/xs/src/slic3r/GUI/Tab.cpp @@ -850,7 +850,8 @@ void TabPrint::build() line.append_option(optgroup->get_option("bridged_infill_margin")); optgroup->append_line(line); optgroup->append_single_option_line("only_retract_when_crossing_perimeters"); - optgroup->append_single_option_line("infill_first"); + optgroup->append_single_option_line("infill_first"); + optgroup->append_single_option_line("gap_fill"); page = add_options_page(_(L("Skirt and brim")), "box.png"); optgroup = page->new_optgroup(_(L("Skirt"))); @@ -1212,7 +1213,7 @@ void TabPrint::update() "infill_speed", "bridge_speed" }) get_field(el)->toggle(have_infill || have_solid_infill); - get_field("gap_fill_speed")->toggle(have_perimeters && have_infill); + get_field("gap_fill_speed")->toggle(have_perimeters && m_config->option("gap_fill")); bool have_top_solid_infill = m_config->opt_int("top_solid_layers") > 0; for (auto el : { "top_infill_extrusion_width", "top_solid_infill_speed" })