Regression test for numerical issues causing thin gaps between perimeters and infill. #1803

This commit is contained in:
Alessandro Ranellucci 2014-04-18 17:30:35 +02:00
parent 93f4fe05e1
commit 15628a90ed
2 changed files with 60 additions and 5 deletions

View File

@ -83,7 +83,6 @@ sub make_perimeters {
my @contours = (); # array of Polygons with ccw orientation my @contours = (); # array of Polygons with ccw orientation
my @holes = (); # array of Polygons with cw orientation my @holes = (); # array of Polygons with cw orientation
my @thin_walls = (); # array of ExPolygons my @thin_walls = (); # array of ExPolygons
my @gaps = (); # array of ExPolygons
# we need to process each island separately because we might have different # we need to process each island separately because we might have different
# extra perimeters for each one # extra perimeters for each one
@ -92,7 +91,7 @@ sub make_perimeters {
my $loop_number = $self->config->perimeters + ($surface->extra_perimeters || 0); my $loop_number = $self->config->perimeters + ($surface->extra_perimeters || 0);
my @last = @{$surface->expolygon}; my @last = @{$surface->expolygon};
my @last_gaps = (); my @gaps = (); # array of ExPolygons
if ($loop_number > 0) { if ($loop_number > 0) {
# we loop one time more than needed in order to find gaps after the last perimeter was applied # 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 for my $i (1 .. ($loop_number+1)) { # outer loop is 1
@ -131,7 +130,7 @@ sub make_perimeters {
offset(\@last, -0.5*$pspacing), offset(\@last, -0.5*$pspacing),
offset(\@offsets, +0.5*$pspacing + 10), # safety offset offset(\@offsets, +0.5*$pspacing + 10), # safety offset
); );
push @gaps, @last_gaps = grep abs($_->area) >= $gap_area_threshold, @$diff; push @gaps, grep abs($_->area) >= $gap_area_threshold, @$diff;
} }
} }
@ -149,7 +148,7 @@ sub make_perimeters {
} }
} }
} }
# fill gaps # fill gaps
if (@gaps) { if (@gaps) {
if (0) { if (0) {
@ -201,6 +200,7 @@ sub make_perimeters {
); );
} }
# process thin walls by collapsing slices to single passes # process thin walls by collapsing slices to single passes
my @thin_wall_polylines = (); my @thin_wall_polylines = ();
if (@thin_walls) { if (@thin_walls) {

File diff suppressed because one or more lines are too long