diff --git a/lib/Slic3r/Polygon.pm b/lib/Slic3r/Polygon.pm index a0416e8d4..ece4aec4e 100644 --- a/lib/Slic3r/Polygon.pm +++ b/lib/Slic3r/Polygon.pm @@ -9,26 +9,6 @@ use Slic3r::Geometry qw(polygon_lines polygon_remove_parallel_continuous_edges scale polygon_remove_acute_vertices polygon_segment_having_point point_in_polygon); use Slic3r::Geometry::Clipper qw(JT_MITER); -# the constructor accepts an array(ref) of points -sub new { - my $class = shift; - my $self; - if (@_ == 1) { - $self = [ @{$_[0]} ]; - } else { - $self = [ @_ ]; - } - - bless $self, $class; - bless $_, 'Slic3r::Point' for @$self; - $self; -} - -sub clone { - my $self = shift; - return (ref $self)->new(map $_->clone, @$self); -} - sub lines { my $self = shift; my @lines = polygon_lines($self); @@ -51,12 +31,6 @@ sub make_clockwise { $self->reverse if $self->is_counter_clockwise; } -sub cleanup { - my $self = shift; - $self->merge_continuous_lines; - return @$self >= 3; -} - sub merge_continuous_lines { my $self = shift; diff --git a/lib/Slic3r/Polyline.pm b/lib/Slic3r/Polyline.pm index 32cdb4982..5962a2140 100644 --- a/lib/Slic3r/Polyline.pm +++ b/lib/Slic3r/Polyline.pm @@ -22,6 +22,11 @@ sub new { $self; } +sub clone { + my $self = shift; + return (ref $self)->new(map $_->clone, @$self); +} + sub serialize { my $self = shift; my $s = \ pack 'l*', map @$_, @$self;