diff --git a/lib/Slic3r/Layer.pm b/lib/Slic3r/Layer.pm index 9803ce2b..77dd4ad9 100644 --- a/lib/Slic3r/Layer.pm +++ b/lib/Slic3r/Layer.pm @@ -15,7 +15,7 @@ has 'print_z' => (is => 'ro', required => 1); # Z used for printing in has 'height' => (is => 'ro', required => 1); # layer height in unscaled coordinates # collection of expolygons generated by slicing the original geometry; -# also known as 'islands' (all regions are merged here) +# also known as 'islands' (all regions and surface types are merged here) has 'slices' => (is => 'rw'); # ordered collection of extrusion paths to fill surfaces for support material @@ -78,14 +78,6 @@ sub region { # merge all regions' slices to get islands sub make_slices { my $self = shift; - - # optimization for single-region layers - my @regions_with_slices = grep { @{$_->slices} } @{$self->regions}; - if (@regions_with_slices == 1) { - $self->slices([ map $_->expolygon, @{$regions_with_slices[0]->slices} ]); - return; - } - $self->slices(union_ex([ map $_->p, map @{$_->slices}, @{$self->regions} ])); } diff --git a/lib/Slic3r/Layer/Region.pm b/lib/Slic3r/Layer/Region.pm index 825e928f..33cf6795 100644 --- a/lib/Slic3r/Layer/Region.pm +++ b/lib/Slic3r/Layer/Region.pm @@ -28,6 +28,7 @@ has 'overhang_width' => (is => 'lazy'); has 'lines' => (is => 'rw', default => sub { [] }); # collection of surfaces generated by slicing the original geometry +# divided by type top/bottom/internal has 'slices' => (is => 'rw', default => sub { [] }); # collection of polygons or polylines representing thin walls contained @@ -266,8 +267,7 @@ sub make_perimeters { $role = EXTR_ROLE_CONTOUR_INTERNAL_PERIMETER; } - ### Disable overhang detection for now - if (0 && $self->id > 0) { + if ($self->id > 0) { # A perimeter is considered overhang if its centerline exceeds the lower layer slices my $is_overhang = $is_contour ? @{diff([$polygon], \@lower_slices)}