diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index cf3d2022dc..5c4ef39ad6 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2255,7 +2255,7 @@ LayerResult GCodeGenerator::process_layer( print.config().before_layer_gcode.value, m_writer.extruder()->id(), &config) + "\n"; } - gcode += this->change_layer(previous_layer_z, print_z); // this will increase m_layer_index + gcode += this->change_layer(previous_layer_z, print_z, result.spiral_vase_enable); // this will increase m_layer_index m_layer = &layer; if (this->line_distancer_is_required(layer_tools.extruders) && this->m_layer != nullptr && this->m_layer->lower_layer != nullptr) m_travel_obstacle_tracker.init_layer(layer, layers); @@ -2439,7 +2439,7 @@ LayerResult GCodeGenerator::process_layer( }}; bool removed_retraction{false}; - if (this->m_config.travel_ramping_lift.get_at(*m_layer_change_extruder_id)) { + if (this->m_config.travel_ramping_lift.get_at(*m_layer_change_extruder_id) && !result.spiral_vase_enable) { const std::string retraction_start_tag = GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Layer_Change_Retraction_Start); const std::string retraction_end_tag = GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Layer_Change_Retraction_End); @@ -2453,6 +2453,7 @@ LayerResult GCodeGenerator::process_layer( gcode.replace(start, end - start, ""); layer_change_gcode = this->get_layer_change_gcode(*m_previous_layer_last_position_before_wipe, *m_current_layer_first_position, *m_layer_change_extruder_id); + removed_retraction = true; } } @@ -2774,7 +2775,8 @@ std::string GCodeGenerator::preamble() // called by GCodeGenerator::process_layer() std::string GCodeGenerator::change_layer( coordf_t previous_layer_z, - coordf_t print_z + coordf_t print_z, + bool vase_mode ) { std::string gcode; if (m_layer_count > 0) @@ -2783,7 +2785,7 @@ std::string GCodeGenerator::change_layer( if (!EXTRUDER_CONFIG(travel_ramping_lift) && EXTRUDER_CONFIG(retract_layer_change)) { gcode += this->retract_and_wipe(); - } else if (EXTRUDER_CONFIG(travel_ramping_lift)){ + } else if (EXTRUDER_CONFIG(travel_ramping_lift) && !vase_mode){ m_previous_layer_last_position_before_wipe = this->last_position ? std::optional{to_3d(this->point_to_gcode(*this->last_position), previous_layer_z)} : std::nullopt; diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 97b3695859..f10c614190 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -266,7 +266,8 @@ private: std::string preamble(); std::string change_layer( coordf_t previous_layer_z, - coordf_t print_z + coordf_t print_z, + bool vase_mode ); std::string extrude_entity(const ExtrusionEntityReference &entity, const GCode::SmoothPathCache &smooth_path_cache, const std::string_view description, double speed = -1.); std::string extrude_loop(const ExtrusionLoop &loop, const GCode::SmoothPathCache &smooth_path_cache, const std::string_view description, double speed = -1.);