Bugfix: ignore only_retract_when_crossing_perimeters when fill_density = 0

This commit is contained in:
Alessandro Ranellucci 2014-07-23 00:57:31 +02:00
parent 16a3d29a1d
commit 71209711b3
2 changed files with 27 additions and 1 deletions

View file

@ -335,6 +335,7 @@ sub travel_to {
# *and* in an island in the upper layer (so that the ooze will not be visible)
if ($travel->length < scale $self->extruder->retract_before_travel
|| ($self->config->only_retract_when_crossing_perimeters
&& $self->config->fill_density > 0
&& (first { $_->contains_line($travel) } @{$self->_upper_layer_islands})
&& (first { $_->contains_line($travel) } @{$self->_layer_islands}))
|| (defined $role && $role == EXTR_ROLE_SUPPORTMATERIAL && (first { $_->contains_line($travel) } @{$self->layer->support_islands}))

View file

@ -1,4 +1,4 @@
use Test::More tests => 17;
use Test::More tests => 18;
use strict;
use warnings;
@ -155,4 +155,29 @@ use Slic3r::Test qw(_eq);
is $layer_changes_with_retraction, 0, 'no retraction on layer change';
}
{
my $config = Slic3r::Config->new_from_defaults;
$config->set('only_retract_when_crossing_perimeters', 1);
$config->set('fill_density', 0);
my $print = Slic3r::Test::init_print('cube_with_hole', config => $config);
my $retracted = 0;
my $traveling_without_retraction = 0;
Slic3r::GCode::Reader->new->parse(Slic3r::Test::gcode($print), sub {
my ($self, $cmd, $args, $info) = @_;
if ($info->{retracting}) {
$retracted = 1;
} elsif ($info->{extruding} && $retracted) {
$retracted = 0;
} elsif ($info->{travel} && !$retracted) {
if ($info->{dist_XY} > $config->retract_before_travel->[0]) {
$traveling_without_retraction = 1;
}
}
});
ok !$traveling_without_retraction, 'always retract when using only_retract_when_crossing_perimeters and fill_density = 0';
}
__END__