diff --git a/resources/profiles/BBL/filament/fdm_filament_dual_common.json b/resources/profiles/BBL/filament/fdm_filament_dual_common.json index f6c0733c2..77afe788f 100644 --- a/resources/profiles/BBL/filament/fdm_filament_dual_common.json +++ b/resources/profiles/BBL/filament/fdm_filament_dual_common.json @@ -62,5 +62,8 @@ "nozzle_temperature_initial_layer": [ "", "" + ], + "filament_change_length": [ + "10" ] } \ No newline at end of file diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index 24dea003b..879521b6e 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -676,6 +676,7 @@ WipeTower::WipeTower(const PrintConfig& config, int plate_idx, Vec3d plate_origi m_wipe_volume(prime_volume), m_enable_timelapse_print(config.timelapse_type.value == TimelapseType::tlSmooth), m_nozzle_change_length(config.extruder_change_length.get_at(0)), + m_filaments_change_length(config.filament_change_length.values), m_is_multi_extruder(config.nozzle_diameter.size() > 1), m_is_print_outer_first(config.prime_tower_outer_first.value), m_use_gap_wall(config.prime_tower_skip_points.value) @@ -1680,7 +1681,7 @@ void WipeTower::plan_toolchange(float z_par, float layer_height_par, unsigned in float nozzle_change_depth = 0; if (!m_filament_map.empty() && m_filament_map[old_tool] != m_filament_map[new_tool]) { double e_flow = extrusion_flow(0.2); - double length = m_nozzle_change_length / e_flow; + double length = (m_nozzle_change_length + m_filaments_change_length[old_tool]) / e_flow; int nozzle_change_line_count = length / (m_wipe_tower_width - 2*m_perimeter_width) + 1; if (has_tpu_filament()) nozzle_change_depth = m_tpu_fixed_spacing * nozzle_change_line_count * m_perimeter_width; diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp index 8ba49f0ca..635bf47f7 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -388,7 +388,8 @@ private: float m_first_layer_speed = 0.f; size_t m_first_layer_idx = size_t(-1); - double m_nozzle_change_length = 10; + double m_nozzle_change_length = 0; + std::vector m_filaments_change_length; size_t m_cur_layer_id; NozzleChangeResult m_nozzle_change_result; std::vector m_filament_map; diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index a3d7aa184..59afbd0bc 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -932,7 +932,9 @@ static std::vector s_Preset_filament_options { "filament_extruder_variant", //OrcaSlicer "enable_pressure_advance", "pressure_advance", "chamber_temperatures","filament_notes", - "filament_long_retractions_when_cut","filament_retraction_distances_when_cut","filament_shrink" + "filament_long_retractions_when_cut","filament_retraction_distances_when_cut","filament_shrink", + //BBS filament change length while the extruder color + "filament_change_length" }; static std::vector s_Preset_machine_limits_options { diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index d264414c0..a05c80e8f 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -284,6 +284,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "filament_scarf_height" || opt_key == "filament_scarf_gap" || opt_key == "filament_scarf_length" + || opt_key == "filament_change_length" || opt_key == "independent_support_layer_height") { steps.emplace_back(psWipeTower); // Soluble support interface / non-soluble base interface produces non-soluble interface layers below soluble interface layers. diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 0dce20ae2..712cb9411 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1853,6 +1853,14 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloats{10}); + def = this->add("filament_change_length", coFloats); + def->label = L("Filament change length"); + def->tooltip = L("Filament change length"); + def->sidetext = L("mm"); + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloats{10}); + def = this->add("filament_is_support", coBools); def->label = L("Support material"); def->tooltip = L("Support material is commonly used to print support and support interface"); @@ -3258,7 +3266,7 @@ void PrintConfigDef::init_fff_params() def->sidetext = L("mm"); def->min = 0; def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloats{10}); + def->set_default_value(new ConfigOptionFloats{0}); def = this->add("extruder_ams_count", coStrings); def->label = "Extruder ams count"; diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 9306ef9c1..899fb1fad 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1010,6 +1010,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionFloatsOrPercents, filament_scarf_height)) ((ConfigOptionFloatsOrPercents, filament_scarf_gap)) ((ConfigOptionFloats, filament_scarf_length)) + ((ConfigOptionFloats, filament_change_length)) ((ConfigOptionFloats, filament_cost)) ((ConfigOptionFloats, impact_strength_z)) ((ConfigOptionString, filament_notes)) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 966483924..783221a3b 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -3183,6 +3183,7 @@ void TabFilament::build() // BBS optgroup->append_single_option_line("filament_is_support"); optgroup->append_single_option_line("impact_strength_z"); + optgroup->append_single_option_line("filament_change_length"); //optgroup->append_single_option_line("filament_colour"); optgroup->append_single_option_line("required_nozzle_HRC");