From fa23ab82853f6b033b1ceea01d4932a5aae1b013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C5=A0ach?= Date: Fri, 1 Mar 2024 10:47:14 +0100 Subject: [PATCH] Make sure that after wipe tower toolchange the G1 Z is always emitted. Even if the G1 Z would be redundant, it is still emitted. Fixes: #12361 --- src/libslic3r/GCode/WipeTowerIntegration.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/libslic3r/GCode/WipeTowerIntegration.cpp b/src/libslic3r/GCode/WipeTowerIntegration.cpp index 5340dd5208..e267f2fa63 100644 --- a/src/libslic3r/GCode/WipeTowerIntegration.cpp +++ b/src/libslic3r/GCode/WipeTowerIntegration.cpp @@ -94,12 +94,10 @@ std::string WipeTowerIntegration::append_tcr(GCodeGenerator &gcodegen, const Wip gcodegen.m_wipe.reset_path(); // We don't want wiping on the ramming lines. toolchange_gcode_str = gcodegen.set_extruder(new_extruder_id, tcr.print_z); // TODO: toolchange_z vs print_z if (gcodegen.config().wipe_tower) { - if (tcr.priming) { - const double return_to_z{tcr.print_z + gcodegen.config().z_offset.value}; - deretraction_str += gcodegen.writer().get_travel_to_z_gcode(return_to_z, "set priming layer Z"); - } else { - deretraction_str += gcodegen.writer().travel_to_z(z, "restore layer Z"); - } + deretraction_str += gcodegen.writer().get_travel_to_z_gcode(z, "restore layer Z"); + Vec3d position{gcodegen.writer().get_position()}; + position.z() = z; + gcodegen.writer().update_position(position); deretraction_str += gcodegen.unretract(); } }