Don't extend solid layers when fill density is 0

This commit is contained in:
Alessandro Ranellucci 2013-04-29 15:53:15 +02:00
parent f7153d67d0
commit c2301c5796
2 changed files with 14 additions and 3 deletions

View File

@ -473,17 +473,23 @@ sub process_external_surfaces {
my @top = grep $_->surface_type == S_TYPE_TOP, @{$self->fill_surfaces};
my @bottom = grep $_->surface_type == S_TYPE_BOTTOM, @{$self->fill_surfaces};
# if we're slicing with no infill, we can't extend external surfaces
# over non-existent infill
my @fill_boundaries = $Slic3r::Config->fill_density > 0
? @{$self->fill_surfaces}
: grep $_->surface_type != S_TYPE_INTERNAL, @{$self->fill_surfaces};
# offset them and intersect the results with the actual fill boundaries
my $margin = scale 3; # TODO: ensure this is greater than the total thickness of the perimeters
@top = @{intersection_ex(
[ Slic3r::Geometry::Clipper::offset([ map $_->p, @top ], +$margin) ],
[ map $_->p, @{$self->fill_surfaces} ],
[ map $_->p, @fill_boundaries ],
undef,
1, # to ensure adjacent expolygons are unified
)};
@bottom = @{intersection_ex(
[ Slic3r::Geometry::Clipper::offset([ map $_->p, @bottom ], +$margin) ],
[ map $_->p, @{$self->fill_surfaces} ],
[ map $_->p, @fill_boundaries ],
undef,
1, # to ensure adjacent expolygons are unified
)};

View File

@ -637,10 +637,15 @@ sub discover_horizontal_shells {
# if some parts are going to collapse, let's grow them and add the extra area to the neighbor layer
# as well as to our original surfaces so that we support this additional area in the next shell too
if (@$too_narrow) {
# consider the actual fill area
my @fill_boundaries = $Slic3r::Config->fill_density > 0
? @neighbor_fill_surfaces
: grep $_->surface_type != S_TYPE_INTERNAL, @neighbor_fill_surfaces;
# make sure our grown surfaces don't exceed the fill area
my @grown = map @$_, @{intersection_ex(
[ offset([ map @$_, @$too_narrow ], +$margin) ],
[ map $_->p, @neighbor_fill_surfaces ],
[ map $_->p, @fill_boundaries ],
)};
$new_internal_solid = union_ex([ @grown, (map @$_, @$new_internal_solid) ]);
$solid = union_ex([ @grown, (map @$_, @$solid) ]);