Always move Z at travel speed. #1093

This commit is contained in:
Alessandro Ranellucci 2013-04-08 22:23:51 +02:00
parent 6b989203b4
commit 94ed6cd239
3 changed files with 11 additions and 1 deletions

View file

@ -364,13 +364,13 @@ sub retract {
}
# prepare moves
$self->speed('retract');
my $retract = [undef, undef, -$length, $comment];
my $lift = ($self->extruder->retract_lift == 0 || defined $params{move_z}) && !$self->lifted
? undef
: [undef, $self->z + $self->extruder->retract_lift, 0, 'lift plate during travel'];
if (($Slic3r::Config->g0 || $Slic3r::Config->gcode_flavor eq 'mach3') && $params{travel_to}) {
$self->speed('travel');
if ($lift) {
# combine lift and retract
$lift->[2] = $retract->[2];
@ -382,6 +382,7 @@ sub retract {
}
} elsif (($Slic3r::Config->g0 || $Slic3r::Config->gcode_flavor eq 'mach3') && defined $params{move_z}) {
# combine Z change and retraction
$self->speed('travel');
my $travel = [undef, $params{move_z}, $retract->[2], "change layer and $comment"];
$gcode .= $self->G0(@$travel);
} else {
@ -395,9 +396,11 @@ sub retract {
$gcode .= $self->G1($wipe_path->[$_], undef, $retract->[2] * ($segment_length / $total_wipe_length), $retract->[3] . ";_WIPE");
}
} else {
$self->speed('retract');
$gcode .= $self->G1(@$retract);
}
if (!$self->lifted) {
$self->speed('travel');
if (defined $params{move_z} && $self->extruder->retract_lift > 0) {
my $travel = [undef, $params{move_z} + $self->extruder->retract_lift, 0, 'move to next layer (' . $self->layer->id . ') and lift'];
$gcode .= $self->G0(@$travel);

View file

@ -39,6 +39,11 @@ sub scale_points (@) { map [scale $_->[X], scale $_->[Y]], @_ }
$surface->expolygon->rotate(Slic3r::Geometry::deg2rad($angle), [0,0]);
my ($params, @paths) = $filler->fill_surface($surface, flow_spacing => 0.69, density => 0.4);
is scalar @paths, 1, 'one continuous path';
use Slic3r::SVG;
Slic3r::SVG::output("fill.svg",
expolygons => [$surface->expolygon],
polylines => [@paths],
);exit;
}
}

View file

@ -52,6 +52,7 @@ my $test = sub {
if !_eq($info->{dist_Z}, -$print->extruders->[$tool]->retract_lift);
$lifted = 0;
}
fail 'move Z at travel speed' if ($args->{F} // $self->F) != $conf->travel_speed * 60;
}
if ($info->{retracting}) {
$retracted[$tool] = 1;
@ -89,6 +90,7 @@ my $test = sub {
};
$config->set('first_layer_height', $config->layer_height);
$config->set('first_layer_speed', '100%');
$config->set('start_gcode', ''); # to avoid dealing with the nozzle lift in start G-code
$config->set('retract_length', [1.5]);
$config->set('retract_before_travel', [3]);