diff --git a/src/libslic3r/Fill/Fill.cpp b/src/libslic3r/Fill/Fill.cpp index fe1b6e7695..0206951dcf 100644 --- a/src/libslic3r/Fill/Fill.cpp +++ b/src/libslic3r/Fill/Fill.cpp @@ -154,12 +154,16 @@ std::vector group_fills(const Layer &layer) //BBS params.with_loop = surface.surface_type == stInternalWithLoop; - if (surface.is_solid()) { + if (surface.is_solid()) { params.density = 100.f; //FIXME for non-thick bridges, shall we allow a bottom surface pattern? - params.pattern = (surface.is_external() && ! is_bridge) ? - (surface.is_top() ? region_config.top_surface_pattern.value : region_config.bottom_surface_pattern.value) : - region_config.top_surface_pattern == ipMonotonic ? ipMonotonic : ipRectilinear; + if (surface.is_solid_infill()) + params.pattern = region_config.internal_solid_infill_pattern.value; + else if (surface.is_external() && !is_bridge) + params.pattern = surface.is_top() ? region_config.top_surface_pattern.value : region_config.bottom_surface_pattern.value; + else + params.pattern = region_config.top_surface_pattern == ipMonotonic ? ipMonotonic : ipRectilinear; + } else if (params.density <= 0) continue; @@ -479,7 +483,6 @@ void Layer::make_fills(FillAdaptive::Octree* adaptive_fill_octree, FillAdaptive: if (surface_fill.params.pattern == ipGrid) params.can_reverse = false; LayerRegion* layerm = this->m_regions[surface_fill.region_id]; - params.filter_out_gap_fill = layerm->region().config().filter_out_gap_fill.value; for (ExPolygon& expoly : surface_fill.expolygons) { f->no_overlap_expolygons = intersection_ex(surface_fill.no_overlap_expolygons, ExPolygons() = {expoly}, ApplySafetyOffset::Yes); // Spacing is modified by the filler to indicate adjustments. Reset it for each expolygon. diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index eec56d3c40..2cc8ae4e50 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -739,7 +739,7 @@ static std::vector s_Preset_print_options { "top_shell_layers", "top_shell_thickness", "bottom_shell_layers", "bottom_shell_thickness", "ensure_vertical_shell_thickness", "reduce_crossing_wall", "detect_thin_wall", "detect_overhang_wall", "seam_position", "wall_infill_order", "sparse_infill_density", "sparse_infill_pattern", "sparse_infill_anchor", "sparse_infill_anchor_max", - "top_surface_pattern", "bottom_surface_pattern", "infill_direction", "bridge_angle", + "top_surface_pattern", "bottom_surface_pattern", "internal_solid_infill_pattern", "infill_direction", "bridge_angle", "minimum_sparse_infill_area", "reduce_infill_retraction", "ironing_pattern", "ironing_type", "ironing_flow", "ironing_speed", "ironing_spacing", "max_travel_detour_distance", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 2a2b7808bc..e65e617ece 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1030,6 +1030,15 @@ void PrintConfigDef::init_fff_params() def->enum_labels = def_top_fill_pattern->enum_labels; def->set_default_value(new ConfigOptionEnum(ipRectilinear)); + def = this->add("internal_solid_infill_pattern", coEnum); + def->label = L("Internal solid infill Pattern"); + def->category = L("Strength"); + def->tooltip = L("Line pattern of internal solid infill. if the detect nattow internal solid infill be enabled, the concentric pattern will be used for the small area."); + def->enum_keys_map = &ConfigOptionEnum::get_enum_values(); + def->enum_values = def_top_fill_pattern->enum_values; + def->enum_labels = def_top_fill_pattern->enum_labels; + def->set_default_value(new ConfigOptionEnum(ipRectilinear)); + def = this->add("outer_wall_line_width", coFloat); def->label = L("Outer wall"); def->category = L("Quality"); @@ -4648,10 +4657,15 @@ std::map validate(const FullPrintConfig &cfg, bool und } // --bottom-fill-pattern - if (! print_config_def.get("bottom_surface_pattern")->has_enum_value(cfg.bottom_surface_pattern.serialize())) { + if (!print_config_def.get("bottom_surface_pattern")->has_enum_value(cfg.bottom_surface_pattern.serialize())) { error_message.emplace("bottom_surface_pattern", L("invalid value ") + cfg.bottom_surface_pattern.serialize()); } + // --soild-fill-pattern + if (!print_config_def.get("internal_solid_infill_pattern")->has_enum_value(cfg.internal_solid_infill_pattern.serialize())) { + error_message.emplace("internal_solid_infill_pattern", L("invalid value ") + cfg.internal_solid_infill_pattern.serialize()); + } + // --fill-density if (fabs(cfg.sparse_infill_density.value - 100.) < EPSILON && ! print_config_def.get("top_surface_pattern")->has_enum_value(cfg.sparse_infill_pattern.serialize())) { diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 1539b38bf0..04b4ef3ab7 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -717,6 +717,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionBool, ensure_vertical_shell_thickness)) ((ConfigOptionEnum, top_surface_pattern)) ((ConfigOptionEnum, bottom_surface_pattern)) + ((ConfigOptionEnum, internal_solid_infill_pattern)) ((ConfigOptionFloat, outer_wall_line_width)) ((ConfigOptionFloat, outer_wall_speed)) ((ConfigOptionFloat, infill_direction)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index 0d4294d076..df104bc535 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -830,6 +830,7 @@ bool PrintObject::invalidate_state_by_config_options( } else if ( opt_key == "top_surface_pattern" || opt_key == "bottom_surface_pattern" + || opt_key == "internal_solid_infill_pattern" || opt_key == "external_fill_link_max_length" || opt_key == "infill_direction" || opt_key == "sparse_infill_anchor" diff --git a/src/libslic3r/Surface.hpp b/src/libslic3r/Surface.hpp index 9494a9dcf1..84bbbfb352 100644 --- a/src/libslic3r/Surface.hpp +++ b/src/libslic3r/Surface.hpp @@ -107,6 +107,7 @@ public: bool is_external() const { return this->is_top() || this->is_bottom(); } bool is_internal() const { return ! this->is_external(); } bool is_solid() const { return this->is_external() || this->surface_type == stInternalSolid || this->surface_type == stInternalBridge; } + bool is_solid_infill() const { return this->surface_type == stInternalSolid; } }; typedef std::vector Surfaces; diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 68a2d8e58c..892c72a6e7 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -551,7 +551,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co bool has_bottom_solid_infill = config->opt_int("bottom_shell_layers") > 0; bool has_solid_infill = has_top_solid_infill || has_bottom_solid_infill; // solid_infill_filament uses the same logic as in Print::extruders() - for (auto el : { "top_surface_pattern", "bottom_surface_pattern", "solid_infill_filament"}) + for (auto el : { "top_surface_pattern", "bottom_surface_pattern", "internal_solid_infill_pattern", "solid_infill_filament"}) toggle_field(el, has_solid_infill); for (auto el : { "infill_direction", "sparse_infill_line_width", "bridge_angle", diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index 97172f71e7..5bf5bba574 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -1296,7 +1296,7 @@ void Choice::set_value(const boost::any& value, bool change_event) if (m_opt_id.compare("host_type") == 0 && val != 0 && m_opt.enum_values.size() > field->GetCount()) // for case, when PrusaLink isn't used as a HostType val--; - if (m_opt_id == "top_surface_pattern" || m_opt_id == "bottom_surface_pattern" || m_opt_id == "sparse_infill_pattern" || m_opt_id == "support_style") + if (m_opt_id == "top_surface_pattern" || m_opt_id == "bottom_surface_pattern" || m_opt_id == "internal_solid_infill_pattern" || m_opt_id == "sparse_infill_pattern" || m_opt_id == "support_style") { std::string key; const t_config_enum_values& map_names = *m_opt.enum_keys_map; @@ -1383,7 +1383,8 @@ boost::any& Choice::get_value() { if (m_opt.nullable && field->GetSelection() == -1) m_value = ConfigOptionEnumsGenericNullable::nil_value(); - else if (m_opt_id == "top_surface_pattern" || m_opt_id == "bottom_surface_pattern" || m_opt_id == "sparse_infill_pattern" || m_opt_id == "support_style") { + else if (m_opt_id == "top_surface_pattern" || m_opt_id == "bottom_surface_pattern" || m_opt_id == "internal_solid_infill_pattern" || m_opt_id == "sparse_infill_pattern" || + m_opt_id == "support_style") { const std::string& key = m_opt.enum_values[field->GetSelection()]; m_value = int(m_opt.enum_keys_map->at(key)); } diff --git a/src/slic3r/GUI/GUI.cpp b/src/slic3r/GUI/GUI.cpp index ff852f9b9c..3470442ea1 100644 --- a/src/slic3r/GUI/GUI.cpp +++ b/src/slic3r/GUI/GUI.cpp @@ -285,6 +285,7 @@ static void add_config_substitutions(const ConfigSubstitutions& conf_substitutio bool is_infill = def->opt_key == "top_surface_pattern" || def->opt_key == "bottom_surface_pattern" || + def->opt_key == "internal_solid_infill_pattern" || def->opt_key == "sparse_infill_pattern"; // Each infill doesn't use all list of infill declared in PrintConfig.hpp. diff --git a/src/slic3r/GUI/GUI_Factories.cpp b/src/slic3r/GUI/GUI_Factories.cpp index f679fa6564..650a8c2d89 100644 --- a/src/slic3r/GUI/GUI_Factories.cpp +++ b/src/slic3r/GUI/GUI_Factories.cpp @@ -96,7 +96,7 @@ std::map> SettingsFactory::PART_CAT }}, { L("Strength"), {{"wall_loops", "",1},{"top_shell_layers", "",1},{"top_shell_thickness", "",1}, {"bottom_shell_layers", "",1}, {"bottom_shell_thickness", "",1}, {"sparse_infill_density", "",1}, - {"sparse_infill_pattern", "",1},{"sparse_infill_anchor", "",1},{"sparse_infill_anchor_max", "",1}, {"top_surface_pattern", "",1},{"bottom_surface_pattern", "",1}, + {"sparse_infill_pattern", "",1},{"sparse_infill_anchor", "",1},{"sparse_infill_anchor_max", "",1}, {"top_surface_pattern", "",1},{"bottom_surface_pattern", "",1}, {"internal_solid_infill_pattern", "",1}, {"infill_combination", "",1}, {"infill_wall_overlap", "",1}, {"infill_direction", "",1}, {"bridge_angle", "",1},{"minimum_sparse_infill_area", "",1} }}, { L("Speed"), {{"outer_wall_speed", "",1},{"inner_wall_speed", "",2},{"sparse_infill_speed", "",3},{"top_surface_speed", "",4}, {"internal_solid_infill_speed", "",5}, diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 199a2fd235..13b6f87a7f 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1899,8 +1899,9 @@ void TabPrint::build() optgroup->append_single_option_line("bottom_surface_pattern", "fill-patterns#Infill of the top surface and bottom surface"); optgroup->append_single_option_line("bottom_shell_layers"); optgroup->append_single_option_line("bottom_shell_thickness"); + optgroup->append_single_option_line("internal_solid_infill_pattern"); - optgroup = page->new_optgroup(L("Infill"), L"param_infill"); + optgroup = page->new_optgroup(L("Sparse infill"), L"param_infill"); optgroup->append_single_option_line("sparse_infill_density"); optgroup->append_single_option_line("sparse_infill_pattern", "fill-patterns#infill types and their properties of sparse"); optgroup->append_single_option_line("sparse_infill_anchor"); diff --git a/src/slic3r/GUI/UnsavedChangesDialog.cpp b/src/slic3r/GUI/UnsavedChangesDialog.cpp index 21da4b61ae..29d39e7c6e 100644 --- a/src/slic3r/GUI/UnsavedChangesDialog.cpp +++ b/src/slic3r/GUI/UnsavedChangesDialog.cpp @@ -1338,12 +1338,14 @@ static wxString get_string_value(std::string opt_key, const DynamicPrintConfig& return get_string_from_enum(opt_key, config, opt_key == "top_surface_pattern" || opt_key == "bottom_surface_pattern" || + opt_key == "internal_solid_infill_pattern" || opt_key == "sparse_infill_pattern"); } case coEnums: { return get_string_from_enum(opt_key, config, opt_key == "top_surface_pattern" || opt_key == "bottom_surface_pattern" || + opt_key == "internal_solid_infill_pattern" || opt_key == "sparse_infill_pattern", opt_idx); }