Remove empty layers from bottom. They could be caused by little contact with the print bed, resulting in the need of thin walls. While thin walls will be supported one day, it's still not optimal to have so little contact on bottom layer(s), so we remove such layers. #96

This commit is contained in:
Alessandro Ranellucci 2011-12-08 10:25:19 +01:00
parent 99c1facec6
commit 1f64a01ed4
2 changed files with 9 additions and 1 deletions

View File

@ -8,7 +8,7 @@ use XXX;
# a sequential number of layer, starting at 0 # a sequential number of layer, starting at 0
has 'id' => ( has 'id' => (
is => 'ro', is => 'rw',
#isa => 'Int', #isa => 'Int',
required => 1, required => 1,
); );

View File

@ -135,6 +135,14 @@ sub new_from_mesh {
@$diff; @$diff;
} }
# remove empty layers from bottom
while (!@{$print->layers->[0]->slices}) {
shift @{$print->layers};
for (my $i = 0; $i <= $#{$print->layers}; $i++) {
$print->layers->[$i]->id($i);
}
}
return $print; return $print;
} }