mirror of
https://github.com/SoftFever/OrcaSlicer.git
synced 2025-12-05 16:51:07 -07:00
Generate boundaries of areas to fill (includes some refactoring)
This commit is contained in:
parent
416ad241ea
commit
428006264d
6 changed files with 82 additions and 24 deletions
|
|
@ -42,6 +42,20 @@ sub BUILD {
|
|||
$_->hole_of($self) for @{ $self->holes };
|
||||
}
|
||||
|
||||
sub new_from_mgp {
|
||||
my $self = shift;
|
||||
my ($polygon) = @_;
|
||||
|
||||
my ($contour_p, @holes_p) = @{ $polygon->polygons };
|
||||
|
||||
return __PACKAGE__->new(
|
||||
contour => Slic3r::Polyline::Closed->new_from_points(@$contour_p),
|
||||
holes => [
|
||||
map Slic3r::Polyline::Closed->new_from_points(@$_), @holes_p
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
sub id {
|
||||
my $self = shift;
|
||||
return $self->contour->id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue