From b61b543243fdc67fbfb0726cda3faafbe77d57ea Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 26 Sep 2011 19:53:01 +0200 Subject: [PATCH] Minor cleanups --- lib/Slic3r/Extruder.pm | 2 +- lib/Slic3r/Line.pm | 1 - lib/Slic3r/Perimeter.pm | 9 --------- lib/Slic3r/Print.pm | 4 +--- lib/Slic3r/Surface.pm | 15 --------------- 5 files changed, 2 insertions(+), 29 deletions(-) diff --git a/lib/Slic3r/Extruder.pm b/lib/Slic3r/Extruder.pm index 21f41cf22..23ff0eac6 100644 --- a/lib/Slic3r/Extruder.pm +++ b/lib/Slic3r/Extruder.pm @@ -123,7 +123,7 @@ sub G1 { } # apply the speed reduction for print moves on bottom layer - my $speed_multiplier = $e + my $speed_multiplier = $e && $self->z == $Slic3r::z_offset ? $Slic3r::bottom_layer_speed_ratio : 1; diff --git a/lib/Slic3r/Line.pm b/lib/Slic3r/Line.pm index 7cac39b85..6383b8804 100644 --- a/lib/Slic3r/Line.pm +++ b/lib/Slic3r/Line.pm @@ -1,6 +1,5 @@ package Slic3r::Line; use Moo; -use Scalar::Util qw(weaken); # arrayref of points has 'points' => ( diff --git a/lib/Slic3r/Perimeter.pm b/lib/Slic3r/Perimeter.pm index 9f9532a9e..b8b48865e 100644 --- a/lib/Slic3r/Perimeter.pm +++ b/lib/Slic3r/Perimeter.pm @@ -3,7 +3,6 @@ use Moo; use Math::Clipper ':all'; use Math::Geometry::Planar; -*Math::Geometry::Planar::OffsetPolygon = *Math::Geometry::Planar::Offset::OffsetPolygon; use XXX; use constant X => 0; @@ -130,12 +129,4 @@ sub _mgp_from_points_ref { return $p; } -sub _mgp_from_polygons_ref { - my $self = shift; - my ($polygons) = @_; - my $p = Math::Geometry::Planar->new; - $p->polygons($polygons); - return $p; -} - 1; diff --git a/lib/Slic3r/Print.pm b/lib/Slic3r/Print.pm index e24ae4e1f..615ec914e 100644 --- a/lib/Slic3r/Print.pm +++ b/lib/Slic3r/Print.pm @@ -174,13 +174,11 @@ sub export_gcode { print $fh "M82 ; use absolute distances for extrusion\n"; } - # make up a subroutine to generate G1 commands + # set up our extruder object my $extruder = Slic3r::Extruder->new( - # calculate X,Y shift to center print around specified origin shift_x => $Slic3r::print_center->[X] - ($self->x_length * $Slic3r::resolution / 2), shift_y => $Slic3r::print_center->[Y] - ($self->y_length * $Slic3r::resolution / 2), - ); # write gcode commands layer by layer diff --git a/lib/Slic3r/Surface.pm b/lib/Slic3r/Surface.pm index 7e99f3f24..dcd96a0d5 100644 --- a/lib/Slic3r/Surface.pm +++ b/lib/Slic3r/Surface.pm @@ -28,21 +28,6 @@ sub add_hole { push @{ $self->holes }, $hole; } -sub new_from_mgp { - my $self = shift; - my ($polygon, %params) = @_; - - my ($contour_p, @holes_p) = @{ $polygon->polygons }; - - return __PACKAGE__->new( - contour => Slic3r::Polyline::Closed->cast($contour_p), - holes => [ - map Slic3r::Polyline::Closed->cast($_), @holes_p - ], - %params, - ); -} - sub id { my $self = shift; return $self->contour->id;