From 144a704e3b4d67d9f37cc73f0f0d027ad8fa0c99 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sun, 22 Jul 2012 20:59:42 +0200 Subject: [PATCH] Remove all id() and ordered_id() methods --- lib/Slic3r/ExtrusionLoop.pm | 4 +++- lib/Slic3r/Line.pm | 10 ---------- lib/Slic3r/Polyline.pm | 5 ----- lib/Slic3r/Surface.pm | 12 ------------ 4 files changed, 3 insertions(+), 28 deletions(-) diff --git a/lib/Slic3r/ExtrusionLoop.pm b/lib/Slic3r/ExtrusionLoop.pm index 1cdc27b94..ed89a6735 100644 --- a/lib/Slic3r/ExtrusionLoop.pm +++ b/lib/Slic3r/ExtrusionLoop.pm @@ -1,6 +1,8 @@ package Slic3r::ExtrusionLoop; use Moo; +use Slic3r::Geometry qw(same_point); + # the underlying Slic3r::Polygon objects holds the geometry has 'polygon' => ( is => 'rw', @@ -57,7 +59,7 @@ sub split_at { # find index of point my $i = -1; for (my $n = 0; $n <= $#{$self->polygon}; $n++) { - if ($point->id eq $self->polygon->[$n]->id) { + if (same_point($point, $self->polygon->[$n])) { $i = $n; last; } diff --git a/lib/Slic3r/Line.pm b/lib/Slic3r/Line.pm index 806b096ca..85dea8abe 100644 --- a/lib/Slic3r/Line.pm +++ b/lib/Slic3r/Line.pm @@ -17,16 +17,6 @@ sub new { sub a { $_[0][0] } sub b { $_[0][1] } -sub id { - my $self = shift; - return $self->a->id . "-" . $self->b->id; -} - -sub ordered_id { - my $self = shift; - return join('-', sort map $_->id, @$self); -} - sub coordinates { my $self = shift; return ($self->a->coordinates, $self->b->coordinates); diff --git a/lib/Slic3r/Polyline.pm b/lib/Slic3r/Polyline.pm index 65d9582de..9a493b3e1 100644 --- a/lib/Slic3r/Polyline.pm +++ b/lib/Slic3r/Polyline.pm @@ -45,11 +45,6 @@ sub is_serialized { return (reftype $self) eq 'SCALAR' ? 1 : 0; } -sub id { - my $self = shift; - return join ' - ', sort map $_->id, @$self; -} - sub lines { my $self = shift; return polyline_lines($self); diff --git a/lib/Slic3r/Surface.pm b/lib/Slic3r/Surface.pm index ffb014234..6912a15af 100644 --- a/lib/Slic3r/Surface.pm +++ b/lib/Slic3r/Surface.pm @@ -73,18 +73,6 @@ sub offset { } $self->expolygon->offset_ex(@_); } -sub add_hole { - my $self = shift; - my ($hole) = @_; - - push @$self, $hole; -} - -sub id { - my $self = shift; - return $self->contour->id; -} - sub clipper_polygon { my $self = shift;