mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-20 03:43:52 +00:00
More work (breaks centering and internal surfaces detection)
This commit is contained in:
@@ -14,7 +14,7 @@ has 'flow' => (is => 'lazy');
|
||||
has 'perimeter_flow' => (is => 'lazy');
|
||||
has 'infill_flow' => (is => 'lazy');
|
||||
|
||||
# collection of surfaces generated by slicing the original geometry;
|
||||
# collection of expolygons generated by slicing the original geometry;
|
||||
# also known as 'islands' (all materials are merged here)
|
||||
has 'slices' => (is => 'rw');
|
||||
|
||||
@@ -68,8 +68,8 @@ sub material {
|
||||
my $self = shift;
|
||||
my ($material_idx) = @_;
|
||||
|
||||
for my $i (grep !defined $self->materials->[$_], 0..$material_idx) {
|
||||
$self->materials->[$i] = Slic3r::Layer::Material->new(
|
||||
if (!defined $self->materials->[$material_idx]) {
|
||||
$self->materials->[$material_idx] = Slic3r::Layer::Material->new(
|
||||
layer => $self,
|
||||
);
|
||||
}
|
||||
@@ -83,11 +83,11 @@ sub make_slices {
|
||||
# optimization for single-material layers
|
||||
my @materials_with_slices = grep { @{$_->slices} } @{$self->materials};
|
||||
if (@materials_with_slices == 1) {
|
||||
$self->slices($materials_with_slices[0]->slices);
|
||||
$self->slices([ map $_->expolygon, @{$materials_with_slices[0]->slices} ]);
|
||||
return;
|
||||
}
|
||||
|
||||
$self->slices(union_ex([ map @{$_->slices}, @{$self->materials} ]));
|
||||
$self->slices(union_ex([ map $_->p, map @{$_->slices}, @{$self->materials} ]));
|
||||
}
|
||||
|
||||
sub make_perimeters {
|
||||
|
||||
Reference in New Issue
Block a user