diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index c2c392b4f1..49b112c00d 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -194,11 +194,10 @@ std::optional emitted_xy_after_gcode(const std::string &gcode, const Vec2 return coordinate_frame_known ? std::optional(position) : std::nullopt; } -// The lift for a retraction with no travel after it, as before a toolchange: a slope needs a travel, so it spirals. +// The lift for a retraction with no travel after it, as before a toolchange: a slope needs a travel, so it lifts straight up. LiftType lift_type_in_place(ZHopType z_hop_type) { - return z_hop_type == ZHopType::zhtAuto || z_hop_type == ZHopType::zhtSpiral || z_hop_type == ZHopType::zhtSlope ? - LiftType::SpiralLift : LiftType::NormalLift; + return z_hop_type == ZHopType::zhtAuto || z_hop_type == ZHopType::zhtSpiral ? LiftType::SpiralLift : LiftType::NormalLift; } } // namespace diff --git a/tests/fff_print/test_gcode.cpp b/tests/fff_print/test_gcode.cpp index 6a52f0feda..f03ad92dc3 100644 --- a/tests/fff_print/test_gcode.cpp +++ b/tests/fff_print/test_gcode.cpp @@ -1094,7 +1094,7 @@ TEST_CASE("Layer changes leave no fan speed marker in the G-code", "[GCode][Regr TEST_CASE("A filament change lifts the way the Z hop type says", "[GCode][Regression]") { // Without a prime tower GCode::set_extruder() changes the filament, here between two objects printed one by one. - const std::string z_hop_type = GENERATE(as{}, "Normal Lift", "Spiral Lift"); + const std::string z_hop_type = GENERATE(as{}, "Normal Lift", "Slope Lift", "Spiral Lift"); CAPTURE(z_hop_type); DynamicPrintConfig config = Test::multifilament_config(2, { { "z_hop_types", z_hop_type }, @@ -1113,3 +1113,19 @@ TEST_CASE("A filament change lifts the way the Z hop type says", "[GCode][Regres const bool spiral = gcode.find("spiral lift Z") != std::string::npos; CHECK(spiral == (z_hop_type == "Spiral Lift")); } + +TEST_CASE("A timelapse frame on a bed slinger lifts straight up with slope lift", "[GCode][Regression]") +{ + // A bed slinger with Timelapse G-code takes a frame every layer, after a lift with no travel. + const std::string gcode = Test::slice({ Test::cube(20) }, { + { "z_hop_types", "Slope Lift" }, + { "z_hop", 0.4 }, + { "gcode_comments", 1 }, + { "printer_structure", "i3" }, + { "time_lapse_gcode", ";timelapse frame" }, + // Around the object, which is not arranged, so a spiral lift fits. + { "printable_area", "-100x-100,100x-100,100x100,-100x100" }, + }); + REQUIRE(gcode.find(";timelapse frame") != std::string::npos); + CHECK(gcode.find("spiral lift Z") == std::string::npos); +}