More work for step-based slicing

This commit is contained in:
Alessandro Ranellucci 2013-12-19 15:23:10 +01:00
parent 5280b05ebb
commit 685e8e4dfa
2 changed files with 74 additions and 64 deletions

View file

@ -273,6 +273,11 @@ sub slice {
$self->layers->[$i]->id($i);
}
}
# simplify slices if required
if ($self->config->resolution) {
$self->_simplify_slices(scale($self->config->resolution));
}
}
sub make_perimeters {
@ -348,6 +353,11 @@ sub make_perimeters {
$_->make_perimeters for @{$self->layers};
},
);
# simplify slices (both layer and region slices),
# we only need the max resolution for perimeters
### This makes this method not-idempotent, so we keep it disabled for now.
###$self->_simplify_slices(&Slic3r::SCALED_RESOLUTION);
}
sub detect_surfaces_type {
@ -850,4 +860,13 @@ sub generate_support_material {
->generate($self);
}
sub _simplify_slices {
my ($self, $distance) = @_;
foreach my $layer (@{$self->layers}) {
$layer->slices->simplify($distance);
$_->slices->simplify($distance) for @{$layer->regions};
}
}
1;