mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-18 02:52:10 +00:00
Use Slic3r::ExPolygon::Collection for Layer->slices
This commit is contained in:
@@ -16,7 +16,7 @@ has 'height' => (is => 'ro', required => 1); # layer height in unscal
|
||||
|
||||
# collection of expolygons generated by slicing the original geometry;
|
||||
# also known as 'islands' (all regions and surface types are merged here)
|
||||
has 'slices' => (is => 'rw');
|
||||
has 'slices' => (is => 'rw', default => sub { Slic3r::ExPolygon::Collection->new });
|
||||
|
||||
# ordered collection of extrusion paths to fill surfaces for support material
|
||||
has 'support_islands' => (is => 'rw');
|
||||
@@ -80,7 +80,8 @@ sub make_slices {
|
||||
my $self = shift;
|
||||
|
||||
my $slices = union_ex([ map $_->p, map @{$_->slices}, @{$self->regions} ]);
|
||||
$self->slices([ map Slic3r::ExPolygon::XS->new(@$_), @$slices ]);
|
||||
$self->slices->clear;
|
||||
$self->slices->append(map Slic3r::ExPolygon::XS->new(@$_), @$slices);
|
||||
}
|
||||
|
||||
sub make_perimeters {
|
||||
|
||||
@@ -305,7 +305,9 @@ sub _simplify_slices {
|
||||
my ($distance) = @_;
|
||||
|
||||
foreach my $layer (map @{$_->layers}, @{$self->objects}) {
|
||||
$layer->slices([ map $_->simplify($distance), @{$layer->slices} ]);
|
||||
my @new = map $_->simplify($distance), @{$layer->slices};
|
||||
$layer->slices->clear;
|
||||
$layer->slices->append(@new);
|
||||
foreach my $layerm (@{$layer->regions}) {
|
||||
my @new = map $_->simplify($distance), @{$layerm->slices};
|
||||
$layerm->slices->clear;
|
||||
|
||||
Reference in New Issue
Block a user