diff --git a/xs/src/libslic3r/GCode.cpp b/xs/src/libslic3r/GCode.cpp index 83f466ae5..3b346bf2d 100644 --- a/xs/src/libslic3r/GCode.cpp +++ b/xs/src/libslic3r/GCode.cpp @@ -2403,7 +2403,10 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, } } if (this->on_first_layer()) - speed = std::min(m_config.get_abs_value("first_layer_speed", speed), speed); + if (path.role() == erInternalInfill || path.role() == erSolidInfill) + speed = std::min(m_config.get_abs_value("first_layer_infill_speed", speed), speed); + else + speed = std::min(m_config.get_abs_value("first_layer_speed", speed), speed); if (m_volumetric_speed != 0. && speed == 0) speed = m_volumetric_speed / path.mm3_per_mm; if (m_config.max_volumetric_speed.value > 0) { diff --git a/xs/src/libslic3r/Print.cpp b/xs/src/libslic3r/Print.cpp index b4d670c12..ca567ca85 100644 --- a/xs/src/libslic3r/Print.cpp +++ b/xs/src/libslic3r/Print.cpp @@ -126,6 +126,7 @@ bool Print::invalidate_state_by_config_options(const std::vectorcli = "first-layer-height=s"; def->ratio_over = "layer_height"; def->default_value = new ConfigOptionFloatOrPercent(0.35, false); - + def = this->add("first_layer_speed", coFloatOrPercent); - def->label = L("First layer speed"); + def->label = L("default"); def->tooltip = L("If expressed as absolute value in mm/s, this speed will be applied to all the print moves " - "of the first layer, regardless of their type. If expressed as a percentage " - "(for example: 40%) it will scale the default speeds."); + "but infill of the first layer, it can be overwrite by the 'default' (default depends of the type of the path) " + "speed if it's lower than that. If expressed as a percentage " + "(for example: 40%) it will scale the 'default' speeds . " + "If expressed as absolute value, it can be overwrite by the 'default' speed if it's lower than that."); def->sidetext = L("mm/s or %"); def->cli = "first-layer-speed=s"; def->min = 0; def->default_value = new ConfigOptionFloatOrPercent(30, false); - + + def = this->add("first_layer_infill_speed", coFloatOrPercent); + def->label = L("infill"); + def->tooltip = L("If expressed as absolute value in mm/s, this speed will be applied to infill moves " + "of the first layer, it can be overwrite by the 'default' (solid infill or infill if not bottom) " + "speed if it's lower than that. If expressed as a percentage " + "(for example: 40%) it will scale the 'default' speed. " + "If expressed as absolute value, it can be overwrite by the 'default' speed if it's lower than that."); + def->sidetext = L("mm/s or %"); + def->cli = "first-layer-infill-speed=s"; + def->min = 0; + def->default_value = new ConfigOptionFloatOrPercent(30, false); + def = this->add("first_layer_temperature", coInts); def->label = L("First layer"); def->tooltip = L("Extruder temperature for first layer. If you want to control temperature manually " diff --git a/xs/src/libslic3r/PrintConfig.hpp b/xs/src/libslic3r/PrintConfig.hpp index cf41e152e..ad973eaa8 100644 --- a/xs/src/libslic3r/PrintConfig.hpp +++ b/xs/src/libslic3r/PrintConfig.hpp @@ -760,6 +760,7 @@ public: ConfigOptionInts first_layer_bed_temperature; ConfigOptionFloatOrPercent first_layer_extrusion_width; ConfigOptionFloatOrPercent first_layer_speed; + ConfigOptionFloatOrPercent first_layer_infill_speed; ConfigOptionInts first_layer_temperature; ConfigOptionFloat infill_acceleration; ConfigOptionInts max_fan_speed; @@ -831,6 +832,7 @@ protected: OPT_PTR(first_layer_bed_temperature); OPT_PTR(first_layer_extrusion_width); OPT_PTR(first_layer_speed); + OPT_PTR(first_layer_infill_speed); OPT_PTR(first_layer_temperature); OPT_PTR(infill_acceleration); OPT_PTR(max_fan_speed); diff --git a/xs/src/slic3r/GUI/Preset.cpp b/xs/src/slic3r/GUI/Preset.cpp index 98ad383b9..dce18e52a 100644 --- a/xs/src/slic3r/GUI/Preset.cpp +++ b/xs/src/slic3r/GUI/Preset.cpp @@ -310,6 +310,7 @@ const std::vector& Preset::print_options() "support_material_solid_first_layer", "perimeter_loop", "perimeter_loop_seam", "seam_travel" , "remove_small_gaps" , "infill_not_connected" + ,"first_layer_infill_speed" }; return s_opts; } diff --git a/xs/src/slic3r/GUI/PresetHints.cpp b/xs/src/slic3r/GUI/PresetHints.cpp index aad28766a..69fbc6fb9 100644 --- a/xs/src/slic3r/GUI/PresetHints.cpp +++ b/xs/src/slic3r/GUI/PresetHints.cpp @@ -106,6 +106,7 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle const auto &support_material_extrusion_width = *print_config.option("support_material_extrusion_width"); const auto &top_infill_extrusion_width = *print_config.option("top_infill_extrusion_width"); const auto &first_layer_speed = *print_config.option("first_layer_speed"); + const auto &first_layer_infill_speed = *print_config.option("first_layer_infill_speed"); // Index of an extruder assigned to a feature. If set to 0, an active extruder will be used for a multi-material print. // If different from idx_extruder, it will not be taken into account for this hint. @@ -142,6 +143,12 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle speed_normal = first_layer_speed.get_abs_value(speed_normal); return (speed_normal > 0.) ? speed_normal : speed_max; }; + auto limit_infill_by_first_layer_speed = [&first_layer_infill_speed, first_layer](double speed_normal, double speed_max) { + if (first_layer && first_layer_infill_speed.value > 0) + // Apply the first layer limit. + speed_normal = first_layer_infill_speed.get_abs_value(speed_normal); + return (speed_normal > 0.) ? speed_normal : speed_max; + }; if (perimeter_extruder_active) { double external_perimeter_rate = Flow::new_from_config_width(frExternalPerimeter, first_positive(first_layer_extrusion_width_ptr, external_perimeter_extrusion_width, extrusion_width), @@ -165,7 +172,7 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle if (! bridging && infill_extruder_active) { double infill_rate = Flow::new_from_config_width(frInfill, first_positive(first_layer_extrusion_width_ptr, infill_extrusion_width, extrusion_width), - nozzle_diameter, lh, bfr).mm3_per_mm() * limit_by_first_layer_speed(infill_speed, max_print_speed); + nozzle_diameter, lh, bfr).mm3_per_mm() * limit_infill_by_first_layer_speed(infill_speed, max_print_speed); if (max_flow < infill_rate) { max_flow = infill_rate; max_flow_extrusion_type = _CHB(L("infill")); @@ -175,7 +182,7 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle double solid_infill_rate = Flow::new_from_config_width(frInfill, first_positive(first_layer_extrusion_width_ptr, solid_infill_extrusion_width, extrusion_width), nozzle_diameter, lh, 0).mm3_per_mm() * - (bridging ? bridge_speed : limit_by_first_layer_speed(solid_infill_speed, max_print_speed)); + (bridging ? bridge_speed : limit_infill_by_first_layer_speed(solid_infill_speed, max_print_speed)); if (max_flow < solid_infill_rate) { max_flow = solid_infill_rate; max_flow_extrusion_type = _CHB(L("solid infill")); @@ -183,7 +190,7 @@ std::string PresetHints::maximum_volumetric_flow_description(const PresetBundle if (! bridging) { double top_solid_infill_rate = Flow::new_from_config_width(frInfill, first_positive(first_layer_extrusion_width_ptr, top_infill_extrusion_width, extrusion_width), - nozzle_diameter, lh, bfr).mm3_per_mm() * limit_by_first_layer_speed(top_solid_infill_speed, max_print_speed); + nozzle_diameter, lh, bfr).mm3_per_mm() * limit_infill_by_first_layer_speed(top_solid_infill_speed, max_print_speed); if (max_flow < top_solid_infill_rate) { max_flow = top_solid_infill_rate; max_flow_extrusion_type = _CHB(L("top solid infill")); diff --git a/xs/src/slic3r/GUI/Tab.cpp b/xs/src/slic3r/GUI/Tab.cpp index 7c760c8f6..d334aa7aa 100644 --- a/xs/src/slic3r/GUI/Tab.cpp +++ b/xs/src/slic3r/GUI/Tab.cpp @@ -913,8 +913,11 @@ void TabPrint::build() optgroup = page->new_optgroup(_(L("Speed for non-print moves"))); optgroup->append_single_option_line("travel_speed"); - optgroup = page->new_optgroup(_(L("Modifiers"))); - optgroup->append_single_option_line("first_layer_speed"); + optgroup = page->new_optgroup(_(L("Modifiers"))); + line = { _(L("First layer speed")), "" }; + line.append_option(optgroup->get_option("first_layer_speed")); + line.append_option(optgroup->get_option("first_layer_infill_speed")); + optgroup->append_line(line); optgroup = page->new_optgroup(_(L("Acceleration control (advanced)"))); optgroup->append_single_option_line("perimeter_acceleration");