From 643a7124ed418a0435423eb788fc6bc0aeba5c8c Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Thu, 7 Nov 2024 15:31:12 +0100 Subject: [PATCH] Fix useless Z move before switching layer CURA-12268 This was introduced while moving positions to 3D points. The Z offset of the travel move now has to be correct, otherwise we will move the nozzle up for next layer, then move back down for the travel move, then move up again when actually starting to print. --- src/LayerPlan.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/LayerPlan.cpp b/src/LayerPlan.cpp index 6f8fdbdc29..b71356e5f3 100644 --- a/src/LayerPlan.cpp +++ b/src/LayerPlan.cpp @@ -2748,6 +2748,7 @@ void LayerPlan::writeGCode(GCodeExport& gcode) gcode.writeTravel(current_position, extruder.settings_.get("speed_z_hop")); // Prevent the final travel(s) from resetting to the 'previous' layer height. + path.z_offset = final_travel_z_ - z_; gcode.setZ(final_travel_z_); } for (size_t point_idx = 0; point_idx + 1 < path.points.size(); point_idx++)