mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-12-01 09:22:58 -05:00
Lift straight up in place with slope lift
A slope lift rises along a travel. Since the H2D port, a lift with no travel after it, before a toolchange or a timelapse frame, was a spiral with Slope Lift, though Slope never spirals elsewhere. It now goes straight up, as it did for every Z-hop type up to 2.3.1. Auto and Spiral Lift still spiral there, as Auto does at a layer change, and every Bambu Lab profile uses Auto Lift.
This commit is contained in:
1 parent
c4a11e775b
commit
482ea00a1b
2 files changed
+19
-4
No files matched your search
@@ -194,11 +194,10 @@ std::optional<Vec2d> emitted_xy_after_gcode(const std::string &gcode, const Vec2
|
||||
return coordinate_frame_known ? std::optional<Vec2d>(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
|
||||
|
||||
@@ -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<std::string>{}, "Normal Lift", "Spiral Lift");
|
||||
const std::string z_hop_type = GENERATE(as<std::string>{}, "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);
|
||||
}
|
||||
Reference in new issue
Block a user