Revert "Refactoring: initialize all layers at once and avoid duplication of slicing height math". #637

This reverts commit 08270022dd.
This commit is contained in:
Alessandro Ranellucci 2012-08-26 17:47:00 +02:00
parent 08270022dd
commit 9bd1b0f6ba
3 changed files with 24 additions and 25 deletions

View file

@ -401,12 +401,14 @@ sub slice_facet {
}
# calculate the layer extents
my ($min_layer, $max_layer) = $print_object->get_layer_range($min_z, $max_z);
my $min_layer = int((unscale($min_z) - ($Slic3r::Config->get_value('first_layer_height') + $Slic3r::Config->layer_height / 2)) / $Slic3r::Config->layer_height) - 2;
$min_layer = 0 if $min_layer < 0;
my $max_layer = int((unscale($max_z) - ($Slic3r::Config->get_value('first_layer_height') + $Slic3r::Config->layer_height / 2)) / $Slic3r::Config->layer_height) + 2;
Slic3r::debugf "layers: min = %s, max = %s\n", $min_layer, $max_layer;
my $lines = {}; # layer_id => [ lines ]
for (my $layer_id = $min_layer; $layer_id <= $max_layer; $layer_id++) {
my $layer = $print_object->layers->[$layer_id];
my $layer = $print_object->layer($layer_id);
$lines->{$layer_id} ||= [];
push @{ $lines->{$layer_id} }, $self->intersect_facet($facet_id, $layer->slice_z);
}