mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-17 10:32:20 +00:00
Bugfix: a move below z_offset was performed when retract_lift was enabled and lift amount was less than z_offset. Includes regression test. #2349
This commit is contained in:
@@ -165,6 +165,7 @@ sub thread_cleanup {
|
||||
no warnings 'redefine';
|
||||
*Slic3r::Config::DESTROY = sub {};
|
||||
*Slic3r::Config::Full::DESTROY = sub {};
|
||||
*Slic3r::Config::GCode::DESTROY = sub {};
|
||||
*Slic3r::Config::Print::DESTROY = sub {};
|
||||
*Slic3r::Config::PrintObject::DESTROY = sub {};
|
||||
*Slic3r::Config::PrintRegion::DESTROY = sub {};
|
||||
|
||||
@@ -71,6 +71,20 @@ sub init_external_mp {
|
||||
$self->_external_mp(Slic3r::MotionPlanner->new($islands));
|
||||
}
|
||||
|
||||
sub preamble {
|
||||
my ($self) = @_;
|
||||
|
||||
my $gcode = $self->writer->preamble;
|
||||
|
||||
# Perform a *silent* move to z_offset: we need this to initialize the Z
|
||||
# position of our writer object so that any initial lift taking place
|
||||
# before the first layer change will raise the extruder from the correct
|
||||
# initial Z instead of 0.
|
||||
$self->writer->travel_to_z($self->config->z_offset, '');
|
||||
|
||||
return $gcode;
|
||||
}
|
||||
|
||||
sub change_layer {
|
||||
my ($self, $layer) = @_;
|
||||
|
||||
|
||||
@@ -546,7 +546,7 @@ sub write_gcode {
|
||||
$print_first_layer_temperature->(1);
|
||||
|
||||
# set other general things
|
||||
print $fh $gcodegen->writer->preamble;
|
||||
print $fh $gcodegen->preamble;
|
||||
|
||||
# initialize a motion planner for object-to-object travel moves
|
||||
if ($self->config->avoid_crossing_perimeters) {
|
||||
|
||||
Reference in New Issue
Block a user