mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-05 13:04:03 -06:00
Ported ExPolygon->contour and ExPolygon->holes
This commit is contained in:
parent
85011dfef3
commit
da0b85c0d9
7 changed files with 14 additions and 18 deletions
|
@ -10,21 +10,11 @@ use Math::Geometry::Voronoi;
|
|||
use Slic3r::Geometry qw(X Y A B point_in_polygon same_line epsilon);
|
||||
use Slic3r::Geometry::Clipper qw(union_ex JT_MITER);
|
||||
|
||||
sub contour {
|
||||
my $self = shift;
|
||||
return $self->[0];
|
||||
}
|
||||
|
||||
sub holes {
|
||||
my $self = shift;
|
||||
return @$self[1..$#$self];
|
||||
}
|
||||
|
||||
sub is_valid {
|
||||
my $self = shift;
|
||||
return (!first { !$_->is_valid } @$self)
|
||||
&& $self->contour->is_counter_clockwise
|
||||
&& (!first { $_->is_counter_clockwise } $self->holes);
|
||||
&& (!first { $_->is_counter_clockwise } @{$self->holes});
|
||||
}
|
||||
|
||||
# returns false if the expolygon is too tight to be printed
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue