diff --git a/src/libslic3r/Fill/FillEnsuring.cpp b/src/libslic3r/Fill/FillEnsuring.cpp index 5e37875430..a501f97326 100644 --- a/src/libslic3r/Fill/FillEnsuring.cpp +++ b/src/libslic3r/Fill/FillEnsuring.cpp @@ -13,8 +13,9 @@ ThickPolylines FillEnsuring::fill_surface_arachne(const Surface *surface, const assert(params.use_arachne); assert(this->print_config != nullptr && this->print_object_config != nullptr && this->print_region_config != nullptr); - const coord_t scaled_spacing = scaled(this->spacing); - const bool is_bounded_rectilinear = true; + const coord_t scaled_spacing = scaled(this->spacing); + const EnsuringInfillPattern infill_patter = this->print_object_config->ensure_vertical_shell_infill; + const bool is_bounded_rectilinear = infill_patter == EnsuringInfillPattern::eipBoundedRectilinear; // Perform offset. Slic3r::ExPolygons expp = this->overlap != 0. ? offset_ex(surface->expolygon, scaled(this->overlap)) : ExPolygons{surface->expolygon}; @@ -96,7 +97,8 @@ ThickPolylines FillEnsuring::fill_surface_arachne(const Surface *surface, const BOOST_LOG_TRIVIAL(error) << "FillBoundedRectilinear::fill_surface() failed to fill a region."; append(thick_polylines_out, to_thick_polylines(std::move(polylines), scaled(this->spacing))); } - } + } else + assert(infill_patter == EnsuringInfillPattern::eipConcentric); } return thick_polylines_out; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 2e5871b566..51bd25fb39 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -449,7 +449,7 @@ static std::vector s_Preset_print_options { "wipe_tower_width", "wipe_tower_rotation_angle", "wipe_tower_brim_width", "wipe_tower_bridging", "single_extruder_multi_material_priming", "mmu_segmented_region_max_width", "wipe_tower_no_sparse_layers", "compatible_printers", "compatible_printers_condition", "inherits", "perimeter_generator", "wall_transition_length", "wall_transition_filter_deviation", "wall_transition_angle", - "wall_distribution_count", "min_feature_size", "min_bead_width" + "wall_distribution_count", "min_feature_size", "min_bead_width", "ensure_vertical_shell_infill" }; static std::vector s_Preset_filament_options { diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index fd752873d3..9b5bc3e670 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -220,6 +220,12 @@ static t_config_enum_values s_keys_map_PerimeterGeneratorType { }; CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(PerimeterGeneratorType) +static t_config_enum_values s_keys_map_EnsuringInfillPattern { + { "bounded_rectilinear", int(EnsuringInfillPattern::eipBoundedRectilinear) }, + { "concentric", int(EnsuringInfillPattern::eipConcentric) } +}; +CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(EnsuringInfillPattern) + static void assign_printer_technology_to_unknown(t_optiondef_map &options, PrinterTechnology printer_technology) { for (std::pair &kvp : options) @@ -3214,6 +3220,18 @@ void PrintConfigDef::init_fff_params() def->min = 0; def->set_default_value(new ConfigOptionFloatOrPercent(85, true)); + def = this->add("ensure_vertical_shell_infill", coEnum); + def->label = L("Ensure vertical shell infill"); + def->category = L("Layers and Perimeters"); + def->tooltip = L("Ensure vertical shell infill."); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values.push_back("bounded_rectilinear"); + def->enum_values.push_back("concentric"); + def->enum_labels.push_back(L("Bounded Rectilinear")); + def->enum_labels.push_back(L("Concentric")); + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionEnum(EnsuringInfillPattern::eipBoundedRectilinear)); + // Declare retract values for filament profile, overriding the printer's extruder profile. for (const char *opt_key : { // floats diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index a253b95a5f..c8cab5adaa 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -133,6 +133,11 @@ enum class PerimeterGeneratorType Arachne }; +enum class EnsuringInfillPattern { + eipBoundedRectilinear, + eipConcentric +}; + enum class GCodeThumbnailsFormat { PNG, JPG, QOI }; @@ -162,6 +167,8 @@ CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(DraftShield) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(GCodeThumbnailsFormat) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(ForwardCompatibilitySubstitutionRule) CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(PerimeterGeneratorType) +CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS(EnsuringInfillPattern) + #undef CONFIG_OPTION_ENUM_DECLARE_STATIC_MAPS @@ -490,6 +497,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionBool, clip_multipart_objects)) ((ConfigOptionBool, dont_support_bridges)) ((ConfigOptionFloat, elefant_foot_compensation)) + ((ConfigOptionEnum, ensure_vertical_shell_infill)) ((ConfigOptionFloatOrPercent, extrusion_width)) ((ConfigOptionFloat, first_layer_acceleration_over_raft)) ((ConfigOptionFloatOrPercent, first_layer_speed_over_raft)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 85e70779ce..b2ce77c7d4 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -751,7 +751,8 @@ bool PrintObject::invalidate_state_by_config_options( || opt_key == "wall_transition_angle" || opt_key == "wall_distribution_count" || opt_key == "min_feature_size" - || opt_key == "min_bead_width") { + || opt_key == "min_bead_width" + || opt_key == "ensure_vertical_shell_infill") { steps.emplace_back(posSlice); } else if ( opt_key == "seam_position" diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index cf3b96d803..0e6e4c354a 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1425,6 +1425,7 @@ void TabPrint::build() optgroup->append_single_option_line("extra_perimeters", category_path + "extra-perimeters-if-needed"); optgroup->append_single_option_line("extra_perimeters_on_overhangs", category_path + "extra-perimeters-on-overhangs"); optgroup->append_single_option_line("ensure_vertical_shell_thickness", category_path + "ensure-vertical-shell-thickness"); + optgroup->append_single_option_line("ensure_vertical_shell_infill"); optgroup->append_single_option_line("avoid_curled_filament_during_travels", category_path + "avoid-curled-filament-during-travels"); optgroup->append_single_option_line("avoid_crossing_perimeters", category_path + "avoid-crossing-perimeters"); optgroup->append_single_option_line("avoid_crossing_perimeters_max_detour", category_path + "avoid_crossing_perimeters_max_detour");