diff --git a/resources/ui_layout/filament.ui b/resources/ui_layout/filament.ui index dcf4d8291..0cfcda65d 100644 --- a/resources/ui_layout/filament.ui +++ b/resources/ui_layout/filament.ui @@ -21,6 +21,7 @@ group:Filament properties setting:filament_soluble setting:filament_shrink group:Print speed override + setting:filament_max_speed setting:filament_max_volumetric_speed volumetric_speed_description diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 7fc709a93..fcb868f74 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -4165,12 +4165,17 @@ std::string GCode::_before_extrude(const ExtrusionPath &path, const std::string m_config.max_volumetric_speed.value / path.mm3_per_mm ); } - if (EXTRUDER_CONFIG_WITH_DEFAULT(filament_max_volumetric_speed,0) > 0) { + if (EXTRUDER_CONFIG_WITH_DEFAULT(filament_max_volumetric_speed, 0) > 0) { // cap speed with max_volumetric_speed anyway (even if user is not using autospeed) speed = std::min( speed, EXTRUDER_CONFIG_WITH_DEFAULT(filament_max_volumetric_speed, speed) / path.mm3_per_mm - ); + ); + } + if (EXTRUDER_CONFIG_WITH_DEFAULT(filament_max_speed, 0) > 0) { + speed = std::min( + speed, + EXTRUDER_CONFIG_WITH_DEFAULT(filament_max_speed, speed)); } double F = speed * 60; // convert mm/sec to mm/min diff --git a/src/libslic3r/GCode/WipeTower.cpp b/src/libslic3r/GCode/WipeTower.cpp index c64c5d7be..adae09a7b 100644 --- a/src/libslic3r/GCode/WipeTower.cpp +++ b/src/libslic3r/GCode/WipeTower.cpp @@ -1285,6 +1285,9 @@ void WipeTower::toolchange_Wipe( float x_to_wipe = volume_to_length(wipe_volume, m_perimeter_width, m_layer_height); float dy = m_extra_spacing*m_perimeter_width; float wipe_speed = 1600.f; + if (this->m_config->filament_max_speed.get_at(this->m_current_tool) > 0) { + wipe_speed = this->m_config->filament_max_speed.get_at(this->m_current_tool); + } // if there is less than 2.5*m_perimeter_width to the edge, advance straightaway (there is likely a blob anyway) if ((m_left_to_right ? xr-writer.x() : writer.x()-xl) < 2.5f*m_perimeter_width) { @@ -1294,7 +1297,7 @@ void WipeTower::toolchange_Wipe( // now the wiping itself: for (int i = 0; true; ++i) { - if (i!=0) { + if (i!=0 && this->m_config->filament_max_speed.get_at(this->m_current_tool) > 0) { if (wipe_speed < 1610.f) wipe_speed = 1800.f; else if (wipe_speed < 1810.f) wipe_speed = 2200.f; else if (wipe_speed < 2210.f) wipe_speed = 4200.f; diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 188737868..c2692fbd9 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -187,7 +187,7 @@ bool Print::invalidate_state_by_config_options(const std::vectormode = comAdvanced; def->set_default_value(new ConfigOptionStrings { "" }); + def = this->add("filament_max_speed", coFloats); + def->label = L("Max speed"); + def->category = OptionCategory::filament; + def->tooltip = L("Maximum speed allowed for this filament. Limits the maximum " + "speed of a print to the minimum of the print speed and the filament speed. " + "Set to zero for no limit."); + def->sidetext = L("mm³/s"); + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloats{ 0. }); + def = this->add("filament_max_volumetric_speed", coFloats); def->label = L("Max volumetric speed"); def->category = OptionCategory::filament; def->tooltip = L("Maximum volumetric speed allowed for this filament. Limits the maximum volumetric " - "speed of a print to the minimum of print and filament volumetric speed. " - "Set to zero for no limit."); + "speed of a print to the minimum of print and filament volumetric speed. " + "Set to zero for no limit."); def->sidetext = L("mm³/s"); def->min = 0; def->mode = comAdvanced; - def->set_default_value(new ConfigOptionFloats { 0. }); + def->set_default_value(new ConfigOptionFloats{ 0. }); def = this->add("filament_max_wipe_tower_speed", coFloats); def->label = L("Max speed on the wipe tower"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 16308a423..8201963d6 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -895,6 +895,7 @@ public: ConfigOptionFloats filament_density; ConfigOptionFloats filament_diameter; ConfigOptionBools filament_soluble; + ConfigOptionFloats filament_max_speed; ConfigOptionFloats filament_max_volumetric_speed; ConfigOptionFloats filament_max_wipe_tower_speed; ConfigOptionStrings filament_type; @@ -995,6 +996,7 @@ protected: OPT_PTR(filament_type); OPT_PTR(filament_soluble); OPT_PTR(filament_cost); + OPT_PTR(filament_max_speed); OPT_PTR(filament_max_volumetric_speed); OPT_PTR(filament_max_wipe_tower_speed); OPT_PTR(filament_loading_speed); diff --git a/src/slic3r/GUI/Preset.cpp b/src/slic3r/GUI/Preset.cpp index 2c1111c94..c98a679eb 100644 --- a/src/slic3r/GUI/Preset.cpp +++ b/src/slic3r/GUI/Preset.cpp @@ -558,7 +558,9 @@ const std::vector& Preset::print_options() const std::vector& Preset::filament_options() { static std::vector s_opts { - "filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_notes", "filament_max_volumetric_speed", + "filament_colour", "filament_diameter", "filament_type", "filament_soluble", "filament_notes", + "filament_max_speed", + "filament_max_volumetric_speed", "filament_max_wipe_tower_speed", "extrusion_multiplier", "filament_density", "filament_cost", "filament_loading_speed", "filament_loading_speed_start", "filament_load_time", "filament_unloading_speed", "filament_toolchange_delay", "filament_unloading_speed_start", "filament_unload_time", "filament_cooling_moves",