Complete retraction if the wipe path was too short for the full retract. #1264
This commit is contained in:
parent
c03f9f0197
commit
1e3ce9b8c4
@ -441,9 +441,16 @@ sub retract {
|
||||
$self->speed('travel');
|
||||
|
||||
# subdivide the retraction
|
||||
my $retracted = 0;
|
||||
for (1 .. $#$wipe_path) {
|
||||
my $segment_length = $wipe_path->[$_-1]->distance_to($wipe_path->[$_]);
|
||||
$gcode .= $self->G1($wipe_path->[$_], undef, $retract->[2] * ($segment_length / $total_wipe_length), $retract->[3] . ";_WIPE");
|
||||
$retracted += my $e = $retract->[2] * ($segment_length / $total_wipe_length);
|
||||
$gcode .= $self->G1($wipe_path->[$_], undef, $e, $retract->[3] . ";_WIPE");
|
||||
}
|
||||
if ($retracted > $retract->[2]) {
|
||||
# if we retracted less than we had to, retract the remainder
|
||||
# TODO: add regression test
|
||||
$gcode .= $self->G1(undef, undef, $retract->[2] - $retracted, $comment);
|
||||
}
|
||||
} else {
|
||||
$self->speed('retract');
|
||||
|
Loading…
Reference in New Issue
Block a user