diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index c84c7b09e..bbb45c96d 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -316,6 +316,11 @@ std::string GCodeWriter::travel_to_xy(const Vec2d &point, const std::string &com std::string GCodeWriter::travel_to_xyz(const Vec3d &point, const std::string &comment) { + // FIXME: This function was not being used when travel_speed_z was separated (bd6badf). + // Calculation of feedrate was not updated accordingly. If you want to use + // this function, fix it first. + std::terminate(); + /* If target Z is lower than current Z but higher than nominal Z we don't perform the Z move but we only move in the XY plane and adjust the nominal Z by reducing the lift amount that will be @@ -367,10 +372,14 @@ std::string GCodeWriter::travel_to_z(double z, const std::string &comment) std::string GCodeWriter::_travel_to_z(double z, const std::string &comment) { m_pos(2) = z; + + double speed = this->config.travel_speed_z.value; + if (speed == 0.) + speed = this->config.travel_speed.value; std::ostringstream gcode; gcode << "G1 Z" << XYZF_NUM(z) - << " F" << XYZF_NUM(this->config.travel_speed.value * 60.0); + << " F" << XYZF_NUM(speed * 60.0); COMMENT(comment); gcode << "\n"; return gcode.str(); diff --git a/src/libslic3r/Preset.cpp b/src/libslic3r/Preset.cpp index 7a258182e..5cc5df6ba 100644 --- a/src/libslic3r/Preset.cpp +++ b/src/libslic3r/Preset.cpp @@ -430,7 +430,7 @@ const std::vector& Preset::print_options() #endif /* HAS_PRESSURE_EQUALIZER */ "perimeter_speed", "small_perimeter_speed", "external_perimeter_speed", "infill_speed", "solid_infill_speed", "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", "first_layer_speed", "perimeter_acceleration", "infill_acceleration", + "bridge_speed", "gap_fill_speed", "gap_fill_enabled", "travel_speed", "travel_speed_z", "first_layer_speed", "perimeter_acceleration", "infill_acceleration", "bridge_acceleration", "first_layer_acceleration", "default_acceleration", "skirts", "skirt_distance", "skirt_height", "draft_shield", "min_skirt_length", "brim_width", "brim_offset", "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 baaa0497c..4561de247 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -197,6 +197,7 @@ bool Print::invalidate_state_by_config_options(const ConfigOptionResolver & /* n || opt_key == "cooling_tube_length" || opt_key == "extra_loading_move" || opt_key == "travel_speed" + || opt_key == "travel_speed_z" || opt_key == "first_layer_speed" || opt_key == "z_offset") { steps.emplace_back(psWipeTower); diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 72722e6fc..617c30aa5 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2738,6 +2738,15 @@ void PrintConfigDef::init_fff_params() def->mode = comAdvanced; def->set_default_value(new ConfigOptionFloat(130)); + def = this->add("travel_speed_z", coFloat); + def->label = L("Z travel"); + def->tooltip = L("Speed for movements along the Z axis.\nWhen set to zero, the value " + "is ignored and regular travel speed is used instead."); + def->sidetext = L("mm/s"); + def->min = 0; + def->mode = comAdvanced; + def->set_default_value(new ConfigOptionFloat(0.)); + def = this->add("use_firmware_retraction", coBool); def->label = L("Use firmware retraction"); def->tooltip = L("This experimental setting uses G10 and G11 commands to have the firmware " diff --git a/src/libslic3r/PrintConfig.hpp b/src/libslic3r/PrintConfig.hpp index 2ba6d4cbd..39b33f681 100644 --- a/src/libslic3r/PrintConfig.hpp +++ b/src/libslic3r/PrintConfig.hpp @@ -627,6 +627,7 @@ PRINT_CONFIG_CLASS_DEFINE( ((ConfigOptionBool, wipe_tower_no_sparse_layers)) ((ConfigOptionString, toolchange_gcode)) ((ConfigOptionFloat, travel_speed)) + ((ConfigOptionFloat, travel_speed_z)) ((ConfigOptionBool, use_firmware_retraction)) ((ConfigOptionBool, use_relative_e_distances)) ((ConfigOptionBool, use_volumetric_e)) diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 5920ab5e3..f3be77643 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -1545,6 +1545,7 @@ void TabPrint::build() optgroup = page->new_optgroup(L("Speed for non-print moves")); optgroup->append_single_option_line("travel_speed"); + optgroup->append_single_option_line("travel_speed_z"); optgroup = page->new_optgroup(L("Modifiers")); optgroup->append_single_option_line("first_layer_speed");