mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-08-12 10:29:08 +08:00
This commit is contained in:
parent
9bfa4118a1
commit
b7d8444ac8
@ -85,6 +85,12 @@ sub length {
|
|||||||
return $length;
|
return $length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# this only applies to polylines
|
||||||
|
sub grow {
|
||||||
|
my $self = shift;
|
||||||
|
return Slic3r::Polygon->new(@$self, CORE::reverse @$self[1..-2])->offset(@_);
|
||||||
|
}
|
||||||
|
|
||||||
sub nearest_point_to {
|
sub nearest_point_to {
|
||||||
my $self = shift;
|
my $self = shift;
|
||||||
my ($point) = @_;
|
my ($point) = @_;
|
||||||
|
@ -511,7 +511,12 @@ sub make_brim {
|
|||||||
|
|
||||||
my @islands = (); # array of polygons
|
my @islands = (); # array of polygons
|
||||||
foreach my $obj_idx (0 .. $#{$self->objects}) {
|
foreach my $obj_idx (0 .. $#{$self->objects}) {
|
||||||
my @object_islands = map $_->contour, @{ $self->objects->[$obj_idx]->layers->[0]->slices };
|
my $layer0 = $self->objects->[$obj_idx]->layers->[0];
|
||||||
|
my @object_islands = (
|
||||||
|
(map $_->contour, @{$layer0->slices}),
|
||||||
|
(map { $_->isa('Slic3r::Polygon') ? $_ : $_->grow } @{$layer0->thin_walls}),
|
||||||
|
(map $_->unpack->polyline->grow, map @{$_->support_fills->paths}, grep $_->support_fills, $layer0),
|
||||||
|
);
|
||||||
foreach my $copy (@{$self->copies->[$obj_idx]}) {
|
foreach my $copy (@{$self->copies->[$obj_idx]}) {
|
||||||
push @islands, map $_->clone->translate(@$copy), @object_islands;
|
push @islands, map $_->clone->translate(@$copy), @object_islands;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user