From 603a8f9c8fd26273bdb4e9ee7a0deab168571105 Mon Sep 17 00:00:00 2001 From: SoftFever Date: Fri, 31 Jul 2026 18:16:06 +0800 Subject: [PATCH] Fix stringing between the model and the wipe tower The tower travel took retract()'s default vertical Z hop instead of the configured one, so the nozzle rose in place over the part and oozed rather than departing with the travel. Pass the filament's z_hop_types through, mapping Auto to a spiral lift as append_tcr does. --- src/libslic3r/GCode.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 9c8959a05c..f5db2e8349 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -1510,7 +1510,19 @@ static std::vector get_path_of_change_filament(const Print& print) if (travel_to_tower_now) { // FIXME: It would be better if the wipe tower set the force_travel flag for all toolchanges, // then we could simplify the condition and make it more readable. - gcode += gcodegen.retract(); + + // Orca: pass the configured lift type, as append_tcr does above. lazy_lift() keeps + // the first type it is given, so the NormalLift default would pin this hop to a + // standing move. Slope and spiral both need a known head position. + LiftType lift_type = LiftType::NormalLift; + if (gcodegen.writer().filament() != nullptr && gcodegen.writer().is_current_position_clear()) { + ZHopType z_hop_type = ZHopType(gcodegen.config().z_hop_types.get_at( + gcodegen.get_filament_config_index((int) gcodegen.writer().filament()->id()))); + if (z_hop_type == ZHopType::zhtAuto) + z_hop_type = ZHopType::zhtSpiral; + lift_type = gcodegen.to_lift_type(z_hop_type); + } + gcode += gcodegen.retract(false, false, lift_type); gcodegen.m_avoid_crossing_perimeters.use_external_mp_once(); if (!tcr.priming && gcodegen.last_pos_defined()) gcode += travel_to_tower_gap(gcodegen, gcodegen.last_pos(), start_wipe_pos);