From e2045a60ee8df142e58b8fc2de94ade953944cf6 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Tue, 10 Jan 2023 08:18:18 +0100 Subject: [PATCH] Separate acceleration control for external perimeters and (top) solid infill --- src/libslic3r/GCode.cpp | 6 ++++++ src/libslic3r/Preset.cpp | 1 + src/libslic3r/Print.cpp | 3 +++ src/libslic3r/PrintConfig.cpp | 29 ++++++++++++++++++++++++++- src/libslic3r/PrintConfig.hpp | 3 +++ src/slic3r/GUI/ConfigManipulation.cpp | 3 ++- src/slic3r/GUI/Tab.cpp | 3 +++ 7 files changed, 46 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 6cb9e8e35..a793c2056 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2793,8 +2793,14 @@ std::string GCode::_extrude(const ExtrusionPath &path, const std::string_view de acceleration = m_config.first_layer_acceleration_over_raft.value; } else if (m_config.bridge_acceleration.value > 0 && path.role().is_bridge()) { acceleration = m_config.bridge_acceleration.value; + } else if (m_config.top_solid_infill_acceleration > 0 && path.role() == ExtrusionRole::TopSolidInfill) { + acceleration = m_config.top_solid_infill_acceleration.value; + } else if (m_config.solid_infill_acceleration > 0 && path.role().is_solid_infill()) { + acceleration = m_config.solid_infill_acceleration.value; } else if (m_config.infill_acceleration.value > 0 && path.role().is_infill()) { acceleration = m_config.infill_acceleration.value; + } else if (m_config.external_perimeter_acceleration > 0 && path.role().is_external_perimeter()) { + acceleration = m_config.external_perimeter_acceleration.value; } else if (m_config.perimeter_acceleration.value > 0 && path.role().is_perimeter()) { acceleration = m_config.perimeter_acceleration.value; } else { diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index d6a4692f3..99f6c4cc9 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -443,6 +443,7 @@ static std::vector s_Preset_print_options { "enable_dynamic_overhang_speeds", "dynamic_overhang_speeds", "overhang_overlap_levels", "top_solid_infill_speed", "support_material_speed", "support_material_xy_spacing", "support_material_interface_speed", "bridge_speed", "gap_fill_speed", "gap_fill_enabled", "travel_speed", "travel_speed_z", "first_layer_speed", "first_layer_speed_over_raft", "perimeter_acceleration", "infill_acceleration", + "external_perimeter_acceleration", "top_solid_infill_acceleration", "solid_infill_acceleration", "bridge_acceleration", "first_layer_acceleration", "first_layer_acceleration_over_raft", "default_acceleration", "skirts", "skirt_distance", "skirt_height", "draft_shield", "min_skirt_length", "brim_width", "brim_separation", "brim_type", "support_material", "support_material_auto", "support_material_threshold", "support_material_enforce_layers", "raft_layers", "raft_first_layer_density", "raft_first_layer_expansion", "raft_contact_distance", "raft_expansion", diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 186005810..3c810b178 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -74,6 +74,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n "duplicate_distance", "end_gcode", "end_filament_gcode", + "external_perimeter_acceleration", "extrusion_axis", "extruder_clearance_height", "extruder_clearance_radius", @@ -125,10 +126,12 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n "retract_speed", "single_extruder_multi_material_priming", "slowdown_below_layer_time", + "solid_infill_acceleration", "standby_temperature_delta", "start_gcode", "start_filament_gcode", "toolchange_gcode", + "top_solid_infill_acceleration", "thumbnails", "thumbnails_format", "use_firmware_retraction", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 9ba8d7cc7..c843ec6ed 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1398,12 +1398,31 @@ void PrintConfigDef::init_fff_params() def = this->add("infill_acceleration", coFloat); def->label = L("Infill"); def->tooltip = L("This is the acceleration your printer will use for infill. Set zero to disable " - "acceleration control for infill."); + "acceleration control for infill."); def->sidetext = L("mm/s²"); def->min = 0; def->mode = comExpert; def->set_default_value(new ConfigOptionFloat(0)); + def = this->add("solid_infill_acceleration", coFloat); + def->label = L("Solid infill"); + def->tooltip = L("This is the acceleration your printer will use for solid infill. Set zero to use " + "the value for infill."); + def->sidetext = L("mm/s²"); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloat(0)); + + def = this->add("top_solid_infill_acceleration", coFloat); + def->label = L("Top solid infill"); + def->tooltip = L("This is the acceleration your printer will use for top solid infill. Set zero to use " + "the value for solid infill."); + def->sidetext = L("mm/s²"); + def->min = 0; + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloat(0)); + + def = this->add("infill_every_layers", coInt); def->label = L("Combine infill every"); def->category = L("Infill"); @@ -1950,6 +1969,14 @@ void PrintConfigDef::init_fff_params() def->mode = comExpert; def->set_default_value(new ConfigOptionFloat(0)); + def = this->add("external_perimeter_acceleration", coFloat); + def->label = L("External perimeters"); + def->tooltip = L("This is the acceleration your printer will use for external perimeters. " + "Set zero to use the value for perimeters."); + def->sidetext = L("mm/s²"); + def->mode = comExpert; + def->set_default_value(new ConfigOptionFloat(0)); + def = this->add("perimeter_extruder", coInt); def->label = L("Perimeter extruder"); def->category = L("Extruders"); diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 6bfc7723d..6e732ce90 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -755,6 +755,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionInts, disable_fan_first_layers)) ((ConfigOptionEnum, draft_shield)) ((ConfigOptionFloat, duplicate_distance)) + ((ConfigOptionFloat, external_perimeter_acceleration)) ((ConfigOptionFloat, extruder_clearance_height)) ((ConfigOptionFloat, extruder_clearance_radius)) ((ConfigOptionStrings, extruder_colour)) @@ -797,12 +798,14 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionInt, skirt_height)) ((ConfigOptionInt, skirts)) ((ConfigOptionInts, slowdown_below_layer_time)) + ((ConfigOptionFloat, solid_infill_acceleration)) ((ConfigOptionBool, spiral_vase)) ((ConfigOptionInt, standby_temperature_delta)) ((ConfigOptionInts, temperature)) ((ConfigOptionInt, threads)) ((ConfigOptionPoints, thumbnails)) ((ConfigOptionEnum, thumbnails_format)) + ((ConfigOptionFloat, top_solid_infill_acceleration)) ((ConfigOptionBools, wipe)) ((ConfigOptionBool, wipe_tower)) ((ConfigOptionFloat, wipe_tower_x)) diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index 0cf85e2f3..0d191be4f 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -261,7 +261,8 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig* config) toggle_field(el, has_top_solid_infill || (has_spiral_vase && has_bottom_solid_infill)); bool have_default_acceleration = config->opt_float("default_acceleration") > 0; - for (auto el : { "perimeter_acceleration", "infill_acceleration", + for (auto el : { "perimeter_acceleration", "infill_acceleration", "top_solid_infill_acceleration", + "solid_infill_acceleration", "external_perimeter_acceleration" "bridge_acceleration", "first_layer_acceleration" }) toggle_field(el, have_default_acceleration); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 9cc7d9b13..9932c6f45 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1571,7 +1571,10 @@ void TabPrint::build() optgroup->append_single_option_line("first_layer_speed_over_raft"); optgroup = page->new_optgroup(L("Acceleration control (advanced)")); + optgroup->append_single_option_line("external_perimeter_acceleration"); optgroup->append_single_option_line("perimeter_acceleration"); + optgroup->append_single_option_line("top_solid_infill_acceleration"); + optgroup->append_single_option_line("solid_infill_acceleration"); optgroup->append_single_option_line("infill_acceleration"); optgroup->append_single_option_line("bridge_acceleration"); optgroup->append_single_option_line("first_layer_acceleration");