diff --git a/xs/src/libslic3r/LayerRegion.cpp b/xs/src/libslic3r/LayerRegion.cpp index 9ffc0dda2..e29f5618a 100644 --- a/xs/src/libslic3r/LayerRegion.cpp +++ b/xs/src/libslic3r/LayerRegion.cpp @@ -94,12 +94,13 @@ void LayerRegion::process_external_surfaces(const Layer* lower_layer) { const Surfaces &surfaces = this->fill_surfaces.surfaces; const double margin = scale_(this->region()->config.external_infill_margin.getFloat()); + const double margin_bridged = scale_(this->region()->config.bridged_infill_margin.getFloat()); #ifdef SLIC3R_DEBUG_SLICE_PROCESSING export_region_fill_surfaces_to_svg_debug("3_process_external_surfaces-initial"); #endif /* SLIC3R_DEBUG_SLICE_PROCESSING */ - // 1) Collect bottom and bridge surfaces, each of them grown by a fixed 3mm offset + // 1) Collect bottom and bridge surfaces, each of them grown by a parametrised ~3mm offset // for better anchoring. // Bottom surfaces, grown. Surfaces bottom; @@ -186,8 +187,8 @@ void LayerRegion::process_external_surfaces(const Layer* lower_layer) idx_island = j; break; } - // Grown by 3mm. - Polygons polys = offset(to_polygons(bridges[i].expolygon), float(margin), EXTERNAL_SURFACES_OFFSET_PARAMETERS); + // Grown by bridged_infill_margin. + Polygons polys = offset(to_polygons(bridges[i].expolygon), float(margin_bridged), EXTERNAL_SURFACES_OFFSET_PARAMETERS); if (idx_island == -1) { printf("Bridge did not fall into the source region!\r\n"); } else { diff --git a/xs/src/libslic3r/PrintConfig.cpp b/xs/src/libslic3r/PrintConfig.cpp index 2c12c163e..50ec9fa39 100644 --- a/xs/src/libslic3r/PrintConfig.cpp +++ b/xs/src/libslic3r/PrintConfig.cpp @@ -343,9 +343,18 @@ PrintConfigDef::PrintConfigDef() def->default_value = new ConfigOptionBool(true); def = this->add("external_infill_margin", coFloat); - def->label = L("Anchor the top by X mm"); + def->label = L("Default"); def->category = L("Infill"); - def->tooltip = L("This parameter grow the top/bottom layers by some mm to anchor them into the part. Put 0 to deactivate it."); + def->tooltip = L("This parameter grow the top/bottom/solid layers by some mm to anchor them into the part. Put 0 to deactivate it."); + def->sidetext = L("mm"); + def->cli = "top-layer-anchor=f"; + def->min = 0; + def->default_value = new ConfigOptionFloat(3); + + def = this->add("bridged_infill_margin", coFloat); + def->label = L("Bridged"); + def->category = L("Infill"); + def->tooltip = L("This parameter grow the bridged solid infill layers by some mm to anchor them into the part. Put 0 to deactivate it."); def->sidetext = L("mm"); def->cli = "top-layer-anchor=f"; def->min = 0; diff --git a/xs/src/libslic3r/PrintConfig.hpp b/xs/src/libslic3r/PrintConfig.hpp index b7b356f9a..01fe0c093 100644 --- a/xs/src/libslic3r/PrintConfig.hpp +++ b/xs/src/libslic3r/PrintConfig.hpp @@ -393,6 +393,7 @@ public: ConfigOptionEnum bottom_fill_pattern; ConfigOptionBool enforce_full_fill_volume; ConfigOptionFloat external_infill_margin; + ConfigOptionFloat bridged_infill_margin; ConfigOptionFloatOrPercent external_perimeter_extrusion_width; ConfigOptionFloatOrPercent external_perimeter_speed; ConfigOptionBool external_perimeters_first; @@ -438,6 +439,7 @@ protected: OPT_PTR(bottom_fill_pattern); OPT_PTR(enforce_full_fill_volume); OPT_PTR(external_infill_margin); + OPT_PTR(bridged_infill_margin); OPT_PTR(external_perimeter_extrusion_width); OPT_PTR(external_perimeter_speed); OPT_PTR(external_perimeters_first); diff --git a/xs/src/libslic3r/PrintObject.cpp b/xs/src/libslic3r/PrintObject.cpp index aba4736b2..2380ca42b 100644 --- a/xs/src/libslic3r/PrintObject.cpp +++ b/xs/src/libslic3r/PrintObject.cpp @@ -195,6 +195,7 @@ bool PrintObject::invalidate_state_by_config_options(const std::vector& Preset::print_options() "ooze_prevention", "standby_temperature_delta", "interface_shells", "extrusion_width", "first_layer_extrusion_width", "perimeter_extrusion_width", "external_perimeter_extrusion_width", "infill_extrusion_width", "solid_infill_extrusion_width", "top_infill_extrusion_width", "support_material_extrusion_width", "infill_overlap", "bridge_flow_ratio", - "over_bridge_flow_ratio", "clip_multipart_objects", "enforce_full_fill_volume", "external_infill_margin", + "over_bridge_flow_ratio", "clip_multipart_objects", "enforce_full_fill_volume", "external_infill_margin", "bridged_infill_margin", "elefant_foot_compensation", "xy_size_compensation", "threads", "resolution", "wipe_tower", "wipe_tower_x", "wipe_tower_y", "wipe_tower_width", "wipe_tower_rotation_angle", "wipe_tower_bridging", "only_one_perimeter_top", "compatible_printers", "compatible_printers_condition", "inherits", "infill_dense_layers", "infill_dense_density" diff --git a/xs/src/slic3r/GUI/Tab.cpp b/xs/src/slic3r/GUI/Tab.cpp index 10d752145..76d35f42d 100644 --- a/xs/src/slic3r/GUI/Tab.cpp +++ b/xs/src/slic3r/GUI/Tab.cpp @@ -861,14 +861,17 @@ void TabPrint::build() line.append_option(optgroup->get_option("infill_dense_density")); optgroup->append_line(line); - optgroup = page->new_optgroup(_(L("Advanced"))); - optgroup->append_single_option_line("solid_infill_every_layers"); - optgroup->append_single_option_line("fill_angle"); - optgroup->append_single_option_line("solid_infill_below_area"); - optgroup->append_single_option_line("external_infill_margin"); - optgroup->append_single_option_line("bridge_angle"); - optgroup->append_single_option_line("only_retract_when_crossing_perimeters"); - optgroup->append_single_option_line("infill_first"); + optgroup = page->new_optgroup(_(L("Advanced"))); + optgroup->append_single_option_line("solid_infill_every_layers"); + optgroup->append_single_option_line("solid_infill_below_area"); + optgroup->append_single_option_line("fill_angle"); + optgroup->append_single_option_line("bridge_angle"); + line = { _(L("Anchor solid infill by X mm")), "" }; + line.append_option(optgroup->get_option("external_infill_margin")); + 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"); page = add_options_page(_(L("Skirt and brim")), "box.png"); optgroup = page->new_optgroup(_(L("Skirt")));