mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-07-12 09:17:52 -06:00
Refactored Perimeter code with new Slic3r::Polygon and Slic3r::ExPolygon objects
Large refactoring. Speed gains. Removed convex hull for bridges.
This commit is contained in:
parent
2d784fac9b
commit
5090ae561c
11 changed files with 174 additions and 100 deletions
|
@ -33,6 +33,10 @@ sub cast_from_expolygon {
|
|||
my $class = shift;
|
||||
my ($expolygon, %args) = @_;
|
||||
|
||||
if (ref $expolygon ne 'HASH') {
|
||||
$expolygon = $expolygon->clipper_expolygon;
|
||||
}
|
||||
|
||||
return $class->new(
|
||||
contour => Slic3r::Polyline::Closed->cast($expolygon->{outer}),
|
||||
holes => [
|
||||
|
@ -79,6 +83,11 @@ sub p {
|
|||
return ($self->contour->p, map $_->p, @{$self->holes});
|
||||
}
|
||||
|
||||
sub expolygon {
|
||||
my $self = shift;
|
||||
return Slic3r::ExPolygon->new($self->contour->p, map $_->p, @{$self->holes});
|
||||
}
|
||||
|
||||
sub lines {
|
||||
my $self = shift;
|
||||
return @{ $self->contour->lines }, map @{ $_->lines }, @{ $self->holes };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue