Generate boundaries of areas to fill (includes some refactoring)

This commit is contained in:
Alessandro Ranellucci 2011-09-04 12:04:01 +02:00
parent 416ad241ea
commit 428006264d
6 changed files with 82 additions and 24 deletions

View file

@ -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;