From 7f423083b48b7bc7eae0d98fa4f359c629645e43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C5=A0ach?= Date: Mon, 22 Jan 2024 10:49:57 +0100 Subject: [PATCH] Fix: Use toolchange z instead of writer z to restore z on wipe tower. Writer z can be set in custom toolchange gcode and than the restoration is invalid. --- src/libslic3r/GCode/WipeTowerIntegration.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libslic3r/GCode/WipeTowerIntegration.cpp b/src/libslic3r/GCode/WipeTowerIntegration.cpp index 9e86dfd967..8493a4e8ef 100644 --- a/src/libslic3r/GCode/WipeTowerIntegration.cpp +++ b/src/libslic3r/GCode/WipeTowerIntegration.cpp @@ -93,7 +93,7 @@ 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) { - deretraction_str += gcodegen.writer().get_travel_to_z_gcode(z, "restore layer Z"); + deretraction_str += gcodegen.writer().get_travel_to_z_gcode(tcr.print_z, "restore layer Z"); deretraction_str += gcodegen.unretract(); } }