Bugfix: crash introduced by wipe
This commit is contained in:
parent
44f91cb805
commit
d089d2b2d4
1 changed files with 3 additions and 3 deletions
|
@ -385,11 +385,11 @@ sub retract {
|
||||||
my $travel = [undef, $params{move_z}, $retract->[2], "change layer and $comment"];
|
my $travel = [undef, $params{move_z}, $retract->[2], "change layer and $comment"];
|
||||||
$gcode .= $self->G0(@$travel);
|
$gcode .= $self->G0(@$travel);
|
||||||
} else {
|
} else {
|
||||||
if ($wipe_path) {
|
# check that we have a positive wipe length
|
||||||
|
if ($wipe_path && (my $total_wipe_length = $wipe_path->length)) {
|
||||||
$self->speed('travel');
|
$self->speed('travel');
|
||||||
# subdivide the retraction
|
|
||||||
my $total_wipe_length = $wipe_path->length;
|
|
||||||
|
|
||||||
|
# subdivide the retraction
|
||||||
for (1 .. $#$wipe_path) {
|
for (1 .. $#$wipe_path) {
|
||||||
my $segment_length = $wipe_path->[$_-1]->distance_to($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");
|
$gcode .= $self->G1($wipe_path->[$_], undef, $retract->[2] * ($segment_length / $total_wipe_length), $retract->[3] . ";_WIPE");
|
||||||
|
|
Loading…
Add table
Reference in a new issue