diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index d5c6b4ec3..0c709d6b3 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3067,6 +3067,27 @@ GCode::LayerResult GCode::process_layer( Skirt::make_skirt_loops_per_extruder_1st_layer(print, layer_tools, m_skirt_done) : Skirt::make_skirt_loops_per_extruder_other_layers(print, layer_tools, m_skirt_done); + // BBS: get next extruder according to flush and soluble + auto get_next_extruder = [&](int current_extruder,const std::vector&extruders) { + std::vector flush_matrix(cast(m_config.flush_volumes_matrix.values)); + const unsigned int number_of_extruders = (unsigned int)(sqrt(flush_matrix.size()) + EPSILON); + // Extract purging volumes for each extruder pair: + std::vector> wipe_volumes; + for (unsigned int i = 0; i < number_of_extruders; ++i) + wipe_volumes.push_back(std::vector(flush_matrix.begin() + i * number_of_extruders, flush_matrix.begin() + (i + 1) * number_of_extruders)); + unsigned int next_extruder = current_extruder; + float min_flush = std::numeric_limits::max(); + for (auto extruder_id : extruders) { + if (print.config().filament_soluble.get_at(extruder_id) || extruder_id == current_extruder) + continue; + if (wipe_volumes[current_extruder][extruder_id] < min_flush) { + next_extruder = extruder_id; + min_flush = wipe_volumes[current_extruder][extruder_id]; + } + } + return next_extruder; + }; + // Group extrusions by an extruder, then by an object, an island and a region. std::map> by_extruder; bool is_anything_overridden = const_cast(layer_tools).wiping_extrusions().is_anything_overridden(); @@ -3119,6 +3140,13 @@ GCode::LayerResult GCode::process_layer( break; } + //BBS: not found a suitable extruder in current layer ,dontcare_extruider==first_extruder_id==interface_extruder + if (dontcare_extruder == interface_extruder && object.config().support_interface_not_for_body) { + // BBS : get a suitable extruder from other layer + auto all_extruders = print.extruders(); + dontcare_extruder = get_next_extruder(dontcare_extruder, all_extruders); + } + if (support_dontcare) support_extruder = dontcare_extruder; } diff --git a/src/libslic3r/GCode/ToolOrdering.cpp b/src/libslic3r/GCode/ToolOrdering.cpp index 37d53e8d2..d6fc56799 100644 --- a/src/libslic3r/GCode/ToolOrdering.cpp +++ b/src/libslic3r/GCode/ToolOrdering.cpp @@ -1080,7 +1080,7 @@ float WipingExtrusions::mark_wiping_extrusions(const Print& print, unsigned int break; auto &entities = this_support_layer->support_fills.entities; - if (support_overriddable && !is_support_overridden(object)) { + if (support_overriddable && !is_support_overridden(object) && !(object_config.support_interface_not_for_body.value && !support_intf_overriddable &&(new_extruder==object_config.support_interface_filament-1||old_extruder==object_config.support_interface_filament-1))) { set_support_extruder_override(object, copy, new_extruder, num_of_copies); for (const ExtrusionEntity* ee : entities) { if (ee->role() == erSupportMaterial || ee->role() == erSupportTransition) diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index dbcd220a1..1997c93ee 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -813,7 +813,7 @@ static std::vector s_Preset_print_options { "support_top_z_distance", "support_on_build_plate_only","support_critical_regions_only", "support_remove_small_overhang", "bridge_no_support", "thick_bridges", "max_bridge_length", "print_sequence", "filename_format", "wall_filament", "support_bottom_z_distance", - "sparse_infill_filament", "solid_infill_filament", "support_filament", "support_interface_filament", + "sparse_infill_filament", "solid_infill_filament", "support_filament", "support_interface_filament","support_interface_not_for_body", "ooze_prevention", "standby_temperature_delta", "interface_shells", "line_width", "initial_layer_line_width", "inner_wall_line_width", "outer_wall_line_width", "sparse_infill_line_width", "internal_solid_infill_line_width", "top_surface_line_width", "support_line_width", "infill_wall_overlap", "bridge_flow", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 84e366b72..a9d487af8 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -3013,6 +3013,13 @@ void PrintConfigDef::init_fff_params() def->mode = comSimple; def->set_default_value(new ConfigOptionInt(1)); + def = this->add("support_interface_not_for_body",coBool); + def->label = L("No interface filament for body"); + def->category = L("Support"); + def->tooltip = L("Don't use support interface filament to print support body"); + def->mode = comSimple; + def->set_default_value(new ConfigOptionBool(false)); + def = this->add("support_line_width", coFloat); def->label = L("Support"); def->category = L("Quality"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index f048bd85b..1ac5fea27 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -700,6 +700,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionInt, enforce_support_layers)) ((ConfigOptionInt, support_filament)) ((ConfigOptionFloat, support_line_width)) + ((ConfigOptionBool, support_interface_not_for_body)) ((ConfigOptionBool, support_interface_loop_pattern)) ((ConfigOptionInt, support_interface_filament)) ((ConfigOptionInt, support_interface_top_layers)) diff --git a/src/libslic3r/PrintObject.cpp b/src/libslic3r/PrintObject.cpp index d4da43b54..6f596cc7a 100644 --- a/src/libslic3r/PrintObject.cpp +++ b/src/libslic3r/PrintObject.cpp @@ -773,6 +773,7 @@ bool PrintObject::invalidate_state_by_config_options( || opt_key == "support_interface_pattern" || opt_key == "support_interface_loop_pattern" || opt_key == "support_interface_filament" + || opt_key == "support_interface_not_for_body" || opt_key == "support_interface_spacing" || opt_key == "support_bottom_interface_spacing" //BBS || opt_key == "support_base_pattern" diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index ac9952890..9d623a0a4 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -610,7 +610,7 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co "bridge_no_support", "max_bridge_length", "support_top_z_distance", "support_bottom_z_distance", //BBS: add more support params to dependent of enable_support "support_type", "support_on_build_plate_only", - "support_remove_small_overhang", + "support_remove_small_overhang","support_interface_not_for_body", "support_object_xy_distance"/*, "independent_support_layer_height"*/}) toggle_field(el, have_support_material); toggle_field("support_threshold_angle", have_support_material && is_auto(support_type)); @@ -676,6 +676,8 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co toggle_line("flush_into_objects", !is_global_config); + toggle_line("support_interface_not_for_body",config->opt_int("support_interface_filament")); + bool has_fuzzy_skin = (config->opt_enum("fuzzy_skin") != FuzzySkinType::None); for (auto el : { "fuzzy_skin_thickness", "fuzzy_skin_point_distance"}) toggle_line(el, has_fuzzy_skin); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index ba9e1151a..de6871f42 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -2017,6 +2017,7 @@ void TabPrint::build() optgroup = page->new_optgroup(L("Support filament"), L"param_support_filament"); optgroup->append_single_option_line("support_filament", "support#support-filament"); optgroup->append_single_option_line("support_interface_filament", "support#support-filament"); + optgroup->append_single_option_line("support_interface_not_for_body", "support#support-filament"); //optgroup = page->new_optgroup(L("Options for support material and raft"));