diff --git a/resources/profiles/BBL/filament/fdm_filament_dual_common.json b/resources/profiles/BBL/filament/fdm_filament_dual_common.json index f6c0733c29..77afe788f8 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 04cde7d1e4..470c037ab4 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -683,6 +683,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 f213ed336a..61cc650a8e 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -392,7 +392,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 d3e9b27440..ce86a47e71 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -876,7 +876,9 @@ static std::vector s_Preset_filament_options { "filament_unloading_speed", "filament_unloading_speed_start", "filament_toolchange_delay", "filament_cooling_moves", "filament_stamping_loading_speed", "filament_stamping_distance", "filament_cooling_initial_speed", "filament_cooling_final_speed", "filament_ramming_parameters", "filament_multitool_ramming", "filament_multitool_ramming_volume", "filament_multitool_ramming_flow", "activate_chamber_temp_control", - "filament_long_retractions_when_cut","filament_retraction_distances_when_cut", "idle_temperature" + "filament_long_retractions_when_cut","filament_retraction_distances_when_cut", "idle_temperature", + //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 a3cd250c6d..a767c6d63b 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -339,6 +339,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n steps.emplace_back(psSkirtBrim); } else if (opt_key == "filament_soluble" || opt_key == "filament_is_support" + || 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 377dbf1111..2e343a11e7 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2474,6 +2474,14 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionBools { false }); + 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 supports and support interfaces."); @@ -4532,7 +4540,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 a5340b184b..d598190ee1 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -1222,6 +1222,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionStrings, filament_type)) ((ConfigOptionBools, filament_soluble)) ((ConfigOptionBools, filament_is_support)) + ((ConfigOptionFloats, filament_change_length)) ((ConfigOptionFloats, filament_cost)) ((ConfigOptionStrings, default_filament_colour)) ((ConfigOptionInts, temperature_vitrification)) //BBS diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 3dfe161633..e160b7f343 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -3530,6 +3530,8 @@ void TabFilament::build() optgroup->append_single_option_line("filament_soluble"); // BBS optgroup->append_single_option_line("filament_is_support"); + optgroup->append_single_option_line("filament_change_length"); + //optgroup->append_single_option_line("filament_colour"); optgroup->append_single_option_line("required_nozzle_HRC"); optgroup->append_single_option_line("default_filament_colour");