mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 11:23:42 +00: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:
@@ -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 };
|
||||
|
||||
Reference in New Issue
Block a user