From 698aba35708c994cb82fcf36563da8be289b93cb Mon Sep 17 00:00:00 2001 From: Ioannis Giannakas <59056762+igiannakas@users.noreply.github.com> Date: Mon, 15 Jan 2024 15:22:00 +0200 Subject: [PATCH] [Bug fix] Fixes retraction on layer change being performed when retract travel threshold is set to 0 (#3614) Fixes retraction on layer change being performed when retract travel threshold is set to 0 --- src/libslic3r/GCode/SpiralVase.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/GCode/SpiralVase.cpp b/src/libslic3r/GCode/SpiralVase.cpp index 0650f7f781..e1440bc7db 100644 --- a/src/libslic3r/GCode/SpiralVase.cpp +++ b/src/libslic3r/GCode/SpiralVase.cpp @@ -126,7 +126,9 @@ std::string SpiralVase::process_layer(const std::string &gcode, bool last_layer) m_reader.parse_buffer(gcode, [&new_gcode, &z, total_layer_length, layer_height, transition_in, &len, ¤t_layer, &previous_layer, &transition_gcode, transition_out, smooth_spiral, &max_xy_dist_for_smoothing, &last_point] (GCodeReader &reader, GCodeReader::GCodeLine line) { if (line.cmd_is("G1")) { - if (line.has_z()) { + // Orca: Filter out retractions at layer change + if (line.retracting(reader) || (line.extruding(reader) && line.dist_XY(reader) < EPSILON)) return; + if (line.has_z() && !line.retracting(reader)) { // If this is the initial Z move of the layer, replace it with a // (redundant) move to the last Z of previous layer. line.set(reader, Z, z);