From 41175b960bf91dea26a7aaf4c433be31036dc032 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C5=A0ach?= Date: Wed, 28 Feb 2024 16:02:54 +0100 Subject: [PATCH] Fix priming layer z --- src/libslic3r/GCode/WipeTowerIntegration.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/GCode/WipeTowerIntegration.cpp b/src/libslic3r/GCode/WipeTowerIntegration.cpp index ea6b7fd3de..159ec58404 100644 --- a/src/libslic3r/GCode/WipeTowerIntegration.cpp +++ b/src/libslic3r/GCode/WipeTowerIntegration.cpp @@ -93,7 +93,12 @@ 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().travel_to_z(z, "restore layer Z"); + 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.unretract(); } }