Revert a recent change made to shells generation, causing too much solid infill. Includes regression test. #1431

This commit is contained in:
Alessandro Ranellucci 2013-09-17 19:24:16 +02:00
parent 2c1274e2d9
commit 39449f9245
3 changed files with 39 additions and 6 deletions

View file

@ -539,8 +539,6 @@ sub discover_horizontal_shells {
Slic3r::debugf "==> DISCOVERING HORIZONTAL SHELLS\n";
my $margin = scale &Slic3r::EXTERNAL_INFILL_MARGIN;
for my $region_id (0 .. ($self->print->regions_count-1)) {
for (my $i = 0; $i < $self->layer_count; $i++) {
my $layerm = $self->layers->[$i]->regions->[$region_id];
@ -557,8 +555,13 @@ sub discover_horizontal_shells {
# fill_surfaces though. Using both ungrown slices and grown fill_surfaces will
# not work in some situations, as there won't be any grown region in the perimeter
# area (this was seen in a model where the top layer had one extra perimeter, thus
# its fill_surfaces was thinner than the lower layer's infill)
my $solid = offset([ map $_->p, @{$layerm->slices->filter_by_type($type)} ], $margin);
# its fill_surfaces were thinner than the lower layer's infill), however it's the best
# solution so far. Growing the external slices by EXTERNAL_INFILL_MARGIN will put
# too much solid infill inside nearly-vertical slopes.
my $solid = [
(map $_->p, @{$layerm->slices->filter_by_type($type)}),
(map $_->p, @{$layerm->fill_surfaces->filter_by_type($type)}),
];
next if !@$solid;
Slic3r::debugf "Layer %d has %s surfaces\n", $i, ($type == S_TYPE_TOP) ? 'top' : 'bottom';