diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 52f07764cf..22c5f8aabd 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -3712,9 +3712,9 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description, #if 0 } else if (this->object_layer_over_raft() && m_config.first_layer_acceleration_over_raft.value > 0) { acceleration = m_config.first_layer_acceleration_over_raft.value; - } else if (m_config.bridge_acceleration.value > 0 && is_bridge(path.role())) { - acceleration = m_config.bridge_acceleration.value; #endif + } else if (m_config.get_abs_value("bridge_acceleration") > 0 && is_bridge(path.role())) { + acceleration = m_config.get_abs_value("bridge_acceleration"); } else if (m_config.outer_wall_acceleration.value > 0 && is_external_perimeter(path.role())) { acceleration = m_config.outer_wall_acceleration.value; } else if (m_config.inner_wall_acceleration.value > 0 && is_internal_perimeter(path.role())) { diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index f5c0711187..856690a012 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -752,8 +752,7 @@ static std::vector s_Preset_print_options { "small_perimeter_speed", "small_perimeter_threshold","bridge_angle", "filter_out_gap_fill", "post_process", "travel_acceleration","inner_wall_acceleration", "default_jerk", "outer_wall_jerk", "inner_wall_jerk", "infill_jerk", "top_surface_jerk", "initial_layer_jerk","travel_jerk", "top_solid_infill_flow_ratio","bottom_solid_infill_flow_ratio","only_one_wall_first_layer", - "print_flow_ratio","seam_gap","role_based_wipe_speed","wipe_speed","accel_to_decel_enable", "accel_to_decel_factor", "wipe_on_loops", "bridge_density", "precise_outer_wall", - "overhang_speed_classic" + "print_flow_ratio","seam_gap","role_based_wipe_speed","wipe_speed","accel_to_decel_enable", "accel_to_decel_factor", "wipe_on_loops", "bridge_density", "precise_outer_wall", "overhang_speed_classic", "bridge_acceleration" }; diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 2fa093c0e1..e3cd5fab42 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -104,6 +104,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n "inner_wall_acceleration", "initial_layer_acceleration", "top_surface_acceleration", + "bridge_acceleration", "travel_acceleration", // BBS "cool_plate_temp_initial_layer", diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 5452c97cfa..d054372b48 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -1467,6 +1467,15 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(500)); + def = this->add("bridge_acceleration", coFloatOrPercent); + def->label = L("Bridge"); + def->tooltip = L("Acceleration of bridges. If the value is expressed as a percentage (e.g. 50%), it will be calculated based on the outer wall acceleration."); + def->sidetext = L("mm/s² or %"); + def->min = 0; + def->mode = comAdvanced; + def->ratio_over = "outer_wall_acceleration"; + def->set_default_value(new ConfigOptionFloatOrPercent(50,true)); + def = this->add("initial_layer_acceleration", coFloat); def->label = L("Initial layer"); def->tooltip = L("Acceleration of initial layer. Using a lower value can improve build plate adhensive"); @@ -4630,17 +4639,6 @@ std::string validate(const FullPrintConfig &cfg) if (em <= 0) return "Invalid value for --filament-flow-ratio"; - // The following test was commented out after 482841b, see also https://github.com/prusa3d/PrusaSlicer/pull/6743. - // The backend should now handle this case correctly. I.e., zero default_acceleration behaves as if all others - // were zero too. This is now consistent with what the UI said would happen. - // The UI already grays the fields out, there is no more reason to reject it here. This function validates the - // config before exporting, leaving this check in would mean that config would be rejected before export - // (although both the UI and the backend handle it). - // --default-acceleration - //if ((cfg.outer_wall_acceleration != 0. || cfg.infill_acceleration != 0. || cfg.bridge_acceleration != 0. || cfg.initial_layer_acceleration != 0.) && - // cfg.default_acceleration == 0.) - // return "Invalid zero value for --default-acceleration when using other acceleration settings"; - // --spiral-vase if (cfg.spiral_mode) { // Note that we might want to have more than one perimeter on the bottom diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 39c8e993a7..91ba012bc6 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -909,6 +909,7 @@ PRINT_CONFIG_CLASS_DERIVED_DEFINE( ((ConfigOptionFloat, inner_wall_acceleration)) ((ConfigOptionFloat, top_surface_acceleration)) ((ConfigOptionFloat, initial_layer_acceleration)) + ((ConfigOptionFloatOrPercent, bridge_acceleration)) ((ConfigOptionFloat, travel_acceleration)) ((ConfigOptionFloat, initial_layer_line_width)) ((ConfigOptionFloat, initial_layer_print_height)) diff --git a/src/slic3r/GUI/ConfigManipulation.cpp b/src/slic3r/GUI/ConfigManipulation.cpp index de4503b632..cd9c6cd087 100644 --- a/src/slic3r/GUI/ConfigManipulation.cpp +++ b/src/slic3r/GUI/ConfigManipulation.cpp @@ -547,7 +547,8 @@ void ConfigManipulation::toggle_print_fff_options(DynamicPrintConfig *config, co bool have_default_acceleration = config->opt_float("default_acceleration") > 0; //BBS - for (auto el : { "outer_wall_acceleration", "inner_wall_acceleration", "initial_layer_acceleration", "top_surface_acceleration","travel_acceleration" }) + for (auto el : {"outer_wall_acceleration", "inner_wall_acceleration", "initial_layer_acceleration", + "top_surface_acceleration", "travel_acceleration", "bridge_acceleration"}) toggle_field(el, have_default_acceleration); bool have_default_jerk = config->opt_float("default_jerk") > 0; diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index e5cfc34633..d90c71fdae 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1941,6 +1941,7 @@ void TabPrint::build() optgroup->append_single_option_line("default_acceleration"); optgroup->append_single_option_line("outer_wall_acceleration"); optgroup->append_single_option_line("inner_wall_acceleration"); + optgroup->append_single_option_line("bridge_acceleration"); optgroup->append_single_option_line("initial_layer_acceleration"); optgroup->append_single_option_line("top_surface_acceleration"); optgroup->append_single_option_line("travel_acceleration");