Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Ranellucci <aar@cpan.org>2011-09-04 14:04:01 +0400
committerAlessandro Ranellucci <aar@cpan.org>2011-09-04 14:04:01 +0400
commit428006264dadc49243332537087533bcf73ad1e2 (patch)
treefea9e06401e902ace8a19424f85059a94b36adcc /lib/Slic3r/Surface.pm
parent416ad241eafd75f9bb264adad1c4f5c7e2194c56 (diff)
Generate boundaries of areas to fill (includes some refactoring)
Diffstat (limited to 'lib/Slic3r/Surface.pm')
-rw-r--r--lib/Slic3r/Surface.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Slic3r/Surface.pm b/lib/Slic3r/Surface.pm
index d8ab0ddc5..5333a7eb6 100644
--- a/lib/Slic3r/Surface.pm
+++ b/lib/Slic3r/Surface.pm
@@ -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;