Don't combine retract and travel anymore when using G0. #1289

This commit is contained in:
Alessandro Ranellucci 2013-10-13 16:20:01 +02:00
parent e6b59aef4e
commit bc0b9e1b72

View File

@ -404,7 +404,7 @@ sub travel_to {
$gcode .= $self->G0($point, undef, 0, $comment || "");
} elsif (!$self->config->avoid_crossing_perimeters || $self->straight_once) {
$self->straight_once(0);
$gcode .= $self->retract(travel_to => $point);
$gcode .= $self->retract;
$self->speed('travel');
$gcode .= $self->G0($point, undef, 0, $comment || "");
} else {
@ -448,7 +448,7 @@ sub _plan {
}
# do the retract (the travel_to argument is broken)
$gcode .= $self->retract(travel_to => $point) if $need_retract;
$gcode .= $self->retract if $need_retract;
# append the actual path and return
$self->speed('travel');
@ -484,23 +484,6 @@ sub retract {
? undef
: [undef, $self->z + $self->extruder->retract_lift, 0, 'lift plate during travel'];
if (($self->config->g0 || $self->config->gcode_flavor eq 'mach3') && $params{travel_to}) {
$self->speed('travel');
if ($lift) {
# combine lift and retract
$lift->[2] = $retract->[2];
$gcode .= $self->G0(@$lift);
} else {
# combine travel and retract
my $travel = [$params{travel_to}, undef, $retract->[2], "travel and $comment"];
$gcode .= $self->G0(@$travel);
}
} elsif (($self->config->g0 || $self->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 {
# check that we have a positive wipe length
if ($wipe_path && (my $total_wipe_length = $wipe_path->length)) {
$self->speed('travel');
@ -531,7 +514,6 @@ sub retract {
$gcode .= $self->G1(@$lift);
}
}
}
$self->extruder->retracted($self->extruder->retracted + $length);
$self->extruder->restart_extra($restart_extra);
$self->lifted($self->extruder->retract_lift) if $lift;