diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index b982b92d39..57f160f1a8 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -692,7 +692,7 @@ bool Preset::is_custom_defined() static std::vector s_Preset_print_options { "layer_height", "initial_layer_print_height", "wall_loops", "slice_closing_radius", "spiral_mode", "top_shell_layers", "top_shell_thickness", "bottom_shell_layers", "bottom_shell_thickness", - "reduce_crossing_wall", "detect_thin_wall", "detect_overhang_wall", + "ensure_vertical_shell_thickness", "reduce_crossing_wall", "detect_thin_wall", "detect_overhang_wall", "seam_position", "wall_infill_order", "sparse_infill_density", "sparse_infill_pattern", "top_surface_pattern", "bottom_surface_pattern", "infill_direction", "bridge_angle", "minimum_sparse_infill_area", "reduce_infill_retraction", diff --git a/src/libslic3r/Print.hpp b/src/libslic3r/Print.hpp index 761422e7bf..52f035308c 100644 --- a/src/libslic3r/Print.hpp +++ b/src/libslic3r/Print.hpp @@ -515,7 +515,6 @@ private: // This was a per-object setting and now we default enable it. static bool clip_multipart_objects; static bool infill_only_where_needed; - static bool ensure_vertical_shell_thickness; }; struct WipeTowerData diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index b6b3c2fece..9a692f3894 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -904,6 +904,14 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionStrings { " " }); + def = this->add("ensure_vertical_shell_thickness", coBool); + def->label = L("Ensure vertical shell thickness"); + def->category = L("Strength"); + def->tooltip = L("Add solid infill near sloping surfaces to guarantee the vertical shell thickness " + "(top+bottom solid layers)"); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionBool(true)); + auto def_top_fill_pattern = def = this->add("top_surface_pattern", coEnum); def->label = L("Top surface pattern"); def->category = L("Strength"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index af5d0137b2..db2c4e5524 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -661,6 +661,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloat, bridge_angle)) ((ConfigOptionFloat, bridge_flow)) ((ConfigOptionFloat, bridge_speed)) + ((ConfigOptionBool, ensure_vertical_shell_thickness)) ((ConfigOptionEnum, top_surface_pattern)) ((ConfigOptionEnum, bottom_surface_pattern)) ((ConfigOptionFloat, outer_wall_line_width)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index a65d4a01a7..cc5dc6a450 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -770,6 +770,7 @@ bool PrintObject::invalidate_state_by_config_options( || opt_key == "sparse_infill_filament" || opt_key == "solid_infill_filament" || opt_key == "sparse_infill_line_width" + || opt_key == "ensure_vertical_shell_thickness" || opt_key == "bridge_angle") { steps.emplace_back(posPrepareInfill); } else if ( @@ -1224,9 +1225,7 @@ void PrintObject::discover_vertical_shells() bool has_extra_layers = false; for (size_t region_id = 0; region_id < this->num_printing_regions(); ++region_id) { const PrintRegionConfig &config = this->printing_region(region_id).config(); - //BBS - //if (config.ensure_vertical_shell_thickness.value && has_extra_layers_fn(config)) { - if (PrintObject::ensure_vertical_shell_thickness && has_extra_layers_fn(config)) { + if (config.ensure_vertical_shell_thickness.value && has_extra_layers_fn(config)) { has_extra_layers = true; break; } @@ -1306,9 +1305,7 @@ void PrintObject::discover_vertical_shells() PROFILE_BLOCK(discover_vertical_shells_region); const PrintRegion ®ion = this->printing_region(region_id); - //BBS - //if (! region.config().ensure_vertical_shell_thickness.value) - if (! PrintObject::ensure_vertical_shell_thickness) + if (! region.config().ensure_vertical_shell_thickness.value) // This region will be handled by discover_horizontal_shells(). continue; if (! has_extra_layers_fn(region.config())) @@ -2049,9 +2046,7 @@ void PrintObject::discover_horizontal_shells() #endif // If ensure_vertical_shell_thickness, then the rest has already been performed by discover_vertical_shells(). - //BBS - //if (region_config.ensure_vertical_shell_thickness.value) - if (PrintObject::ensure_vertical_shell_thickness) + if (region_config.ensure_vertical_shell_thickness.value) continue; coordf_t print_z = layer->print_z; diff --git a/src/libslic3r/PrintObjectSlice.cpp b/src/libslic3r/PrintObjectSlice.cpp index 5c5ea48d55..529ffa8015 100644 --- a/src/libslic3r/PrintObjectSlice.cpp +++ b/src/libslic3r/PrintObjectSlice.cpp @@ -18,7 +18,6 @@ namespace Slic3r { bool PrintObject::clip_multipart_objects = true; bool PrintObject::infill_only_where_needed = false; -bool PrintObject::ensure_vertical_shell_thickness = true; LayerPtrs new_layers( PrintObject *print_object, diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index e18f51e6eb..40bc5a4103 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -275,6 +275,7 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con sparse_infill_density == 0 && ! config->opt_bool("enable_support") && config->opt_int("enforce_support_layers") == 0 && + config->opt_bool("ensure_vertical_shell_thickness") && ! config->opt_bool("detect_thin_wall"))) { wxString msg_text = _(L("Spiral mode only works when wall loops is 1, \n" @@ -295,6 +296,7 @@ void ConfigManipulation::update_print_fff_config(DynamicPrintConfig* config, con new_conf.set_key_value("sparse_infill_density", new ConfigOptionPercent(0)); new_conf.set_key_value("enable_support", new ConfigOptionBool(false)); new_conf.set_key_value("enforce_support_layers", new ConfigOptionInt(0)); + new_conf.set_key_value("ensure_vertical_shell_thickness", new ConfigOptionBool(true)); new_conf.set_key_value("detect_thin_wall", new ConfigOptionBool(false)); sparse_infill_density = 0; support = false; @@ -469,7 +471,7 @@ void ConfigManipulation::apply_null_fff_config(DynamicPrintConfig *config, std:: void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, const bool is_global_config) { bool have_perimeters = config->opt_int("wall_loops") > 0; - for (auto el : { "detect_thin_wall", "detect_overhang_wall", + for (auto el : { "ensure_vertical_shell_thickness", "detect_thin_wall", "detect_overhang_wall", "seam_position", "wall_infill_order", "outer_wall_line_width", "inner_wall_speed", "outer_wall_speed" }) toggle_field(el, have_perimeters); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 640997298b..d304c5c3ab 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1809,6 +1809,7 @@ void TabPrint::build() optgroup->append_single_option_line("minimum_sparse_infill_area"); optgroup->append_single_option_line("infill_combination"); optgroup->append_single_option_line("detect_narrow_internal_solid_infill"); + optgroup->append_single_option_line("ensure_vertical_shell_thickness"); page = add_options_page(L("Speed"), "empty"); optgroup = page->new_optgroup(L("Initial layer speed"), L"param_speed_first", 15);