Fixed regression causing incomplete gap fill when all configured perimeters were successfully generated. #1589

This commit is contained in:
Alessandro Ranellucci 2013-12-23 21:22:32 +01:00
parent b551852392
commit eb5ca20449

View File

@ -167,7 +167,9 @@ sub make_perimeters {
my @last = @{$surface->expolygon};
my @last_gaps = ();
for my $i (1 .. $loop_number) { # outer loop is 1
if ($loop_number > 0) {
# we loop one time more than needed in order to find gaps after the last perimeter was applied
for my $i (1 .. ($loop_number+1)) { # outer loop is 1
my @offsets = ();
if ($i == 1) {
# the minimum thickness of a single loop is:
@ -196,6 +198,8 @@ sub make_perimeters {
}
last if !@offsets;
last if $i > $loop_number; # we were only looking for gaps this time
# clone polygons because these ExPolygons will go out of scope very soon
@last = @offsets;
foreach my $polygon (@offsets) {
@ -206,6 +210,7 @@ sub make_perimeters {
}
}
}
}
# make sure we don't infill narrow parts that are already gap-filled
# (we only consider this surface's gaps to reduce the diff() complexity)