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-06 13:50:43 +0400
committerAlessandro Ranellucci <aar@cpan.org>2011-09-06 13:50:43 +0400
commit26b05ab155046c4c04fc326aa6d9d00ffc799270 (patch)
tree918c35f4f83dbd9dd01219166e6e6d8c6ed6252f /lib/Slic3r/Surface.pm
parentbf5824781da6d5cf766b4e6da6ba66f4748e4243 (diff)
Replaced Moose with Moo => big performance boost and easier packaging
Diffstat (limited to 'lib/Slic3r/Surface.pm')
-rw-r--r--lib/Slic3r/Surface.pm19
1 files changed, 9 insertions, 10 deletions
diff --git a/lib/Slic3r/Surface.pm b/lib/Slic3r/Surface.pm
index 60b81eb1d..ff438c820 100644
--- a/lib/Slic3r/Surface.pm
+++ b/lib/Slic3r/Surface.pm
@@ -1,39 +1,38 @@
package Slic3r::Surface;
-use Moose;
+use Moo;
use Math::Geometry::Planar;
-use Moose::Util::TypeConstraints;
has 'contour' => (
is => 'ro',
- isa => 'Slic3r::Polyline::Closed',
+ #isa => 'Slic3r::Polyline::Closed',
required => 1,
);
has 'holes' => (
traits => ['Array'],
is => 'rw',
- isa => 'ArrayRef[Slic3r::Polyline::Closed]',
+ #isa => 'ArrayRef[Slic3r::Polyline::Closed]',
default => sub { [] },
- handles => {
- 'add_hole' => 'push',
- },
);
# TODO: to allow for multiple solid skins to be filled near external
# surfaces, a new type should be defined: internal-solid
has 'surface_type' => (
is => 'rw',
- isa => enum([qw(internal bottom top)]),
+ #isa => enum([qw(internal bottom top)]),
);
-after 'add_hole' => sub {
+sub add_hole {
my $self = shift;
+ my ($hole) = @_;
+
+ push @{ $self->holes }, $hole;
# add a weak reference to this surface in polyline objects
# (avoid circular refs)
$self->holes->[-1]->hole_of($self);
-};
+}
sub BUILD {
my $self = shift;