[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
This commit is contained in:
Ioannis Giannakas 2024-01-15 15:22:00 +02:00 committed by GitHub
parent fff85195b8
commit 698aba3570
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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, &current_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);