diff --git a/lib/Slic3r/GCode.pm b/lib/Slic3r/GCode.pm index d9a41129a..5534e7653 100644 --- a/lib/Slic3r/GCode.pm +++ b/lib/Slic3r/GCode.pm @@ -178,7 +178,7 @@ sub extrude_path { foreach my $line ($path->lines) { my $line_length = $line->length; $path_length += $line_length; - $gcode .= $self->G1($line->b, undef, $e * unscale $line_length, $description); + $gcode .= $self->G1($line->[B], undef, $e * unscale $line_length, $description); } } diff --git a/lib/Slic3r/Line.pm b/lib/Slic3r/Line.pm index 85dea8abe..4979189c9 100644 --- a/lib/Slic3r/Line.pm +++ b/lib/Slic3r/Line.pm @@ -14,14 +14,6 @@ sub new { return $self; } -sub a { $_[0][0] } -sub b { $_[0][1] } - -sub coordinates { - my $self = shift; - return ($self->a->coordinates, $self->b->coordinates); -} - sub boost_linestring { my $self = shift; return Boost::Geometry::Utils::linestring($self); @@ -35,27 +27,6 @@ sub coincides_with { || ($self->a->coincides_with($line->b) && $self->b->coincides_with($line->a)); } -sub has_endpoint { - my $self = shift; - my ($point) = @_; - return $point->coincides_with($self->a) || $point->coincides_with($self->b); -} - -sub has_segment { - my $self = shift; - my ($line) = @_; - - # a segment belongs to another segment if its points belong to it - return Slic3r::Geometry::point_in_segment($line->[0], $self) - && Slic3r::Geometry::point_in_segment($line->[1], $self); -} - -sub parallel_to { - my $self = shift; - my ($line) = @_; - return Slic3r::Geometry::lines_parallel($self, $line); -} - sub length { my $self = shift; return Slic3r::Geometry::line_length($self); diff --git a/lib/Slic3r/Point.pm b/lib/Slic3r/Point.pm index cba2f1af9..9c704c853 100644 --- a/lib/Slic3r/Point.pm +++ b/lib/Slic3r/Point.pm @@ -23,20 +23,6 @@ sub clone { return (ref $self)->new(@$self); } -sub cast { - my $class = shift; - if (ref $_[0] eq 'Slic3r::Point') { - return $_[0]; - } else { - return $class->new(@_); - } -} - -sub coordinates { - my $self = shift; - return @$self; -} - sub coincides_with { my $self = shift; my ($point) = @_; diff --git a/lib/Slic3r/Polyline.pm b/lib/Slic3r/Polyline.pm index 0813822aa..8d7f6a434 100644 --- a/lib/Slic3r/Polyline.pm +++ b/lib/Slic3r/Polyline.pm @@ -40,11 +40,6 @@ sub deserialize { return $class->new(map [ $v[2*$_], $v[2*$_+1] ], 0 .. int($#v/2)); } -sub is_serialized { - my $self = shift; - return (reftype $self) eq 'SCALAR' ? 1 : 0; -} - sub lines { my $self = shift; return polyline_lines($self); @@ -105,16 +100,6 @@ sub nearest_point_index_to { return Slic3r::Geometry::nearest_point_index($point, $self); } -sub has_segment { - my $self = shift; - my ($line) = @_; - - for ($self->lines) { - return 1 if $_->has_segment($line); - } - return 0; -} - sub clip_with_polygon { my $self = shift; my ($polygon) = @_;