From d168ecbb4e9b7b9b808e3de904583d9cfc014708 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Tue, 29 Nov 2011 10:15:29 +0100 Subject: [PATCH] Bugfix: fill density = 0 was preventing generation of extra solid layers. #75 --- lib/Slic3r/Layer.pm | 3 +++ lib/Slic3r/Print.pm | 9 +-------- lib/Slic3r/Skein.pm | 1 - 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/lib/Slic3r/Layer.pm b/lib/Slic3r/Layer.pm index 187e6ffbe..754543f0f 100644 --- a/lib/Slic3r/Layer.pm +++ b/lib/Slic3r/Layer.pm @@ -349,6 +349,9 @@ sub remove_small_perimeters { sub process_bridges { my $self = shift; + # no bridges are possible if we have no internal surfaces + return if $Slic3r::fill_density == 0; + my @bridges = (); # a bottom surface on a layer > 0 is either a bridge or a overhang diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index 6fac7a85c..ae7b96858 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -171,13 +171,6 @@ sub detect_surfaces_type { Slic3r::debugf " layer %d has %d bottom, %d top and %d internal surfaces\n", $layer->id, scalar(@bottom), scalar(@top), scalar(@internal); } - - # remove internal surfaces if no infill is requested - if ($Slic3r::fill_density == 0) { - foreach my $layer (@{$self->layers}) { - @{$layer->surfaces} = grep $_->surface_type ne 'internal', @{$layer->surfaces}; - } - } } sub discover_horizontal_shells { @@ -283,7 +276,7 @@ sub extrude_skirt { # combine fill surfaces across layers sub infill_every_layers { my $self = shift; - return unless $Slic3r::infill_every_layers > 1; + return unless $Slic3r::infill_every_layers > 1 && $Slic3r::fill_density > 0; printf "==> COMBINING INFILL\n"; diff --git a/lib/Slic3r/Skein.pm b/lib/Slic3r/Skein.pm index 100dac930..617cd61f2 100644 --- a/lib/Slic3r/Skein.pm +++ b/lib/Slic3r/Skein.pm @@ -37,7 +37,6 @@ sub go { # this will clip $layer->surfaces to the infill boundaries # and split them in top/bottom/internal surfaces; - # if fill density is null, it will delete all internal surfaces $self->status_cb->(30, "Detecting solid surfaces..."); $print->detect_surfaces_type;