diff --git a/lib/Slic3r/Polyline.pm b/lib/Slic3r/Polyline.pm index d8b5e3e1d..6a60b0d0f 100644 --- a/lib/Slic3r/Polyline.pm +++ b/lib/Slic3r/Polyline.pm @@ -113,7 +113,7 @@ sub clip_start { my ($distance) = @_; my @my_points = @$self; - my $points = [ $my_points[0] ]; + my $points = [ $my_points[0]->clone ]; for (my $i = 1; $distance > 0 && $i <= $#my_points; $i++) { my $point = $my_points[$i]; @@ -140,7 +140,7 @@ sub regular_points { my ($distance) = @_; my @my_points = @$self; - my @points = ($my_points[0]); + my @points = ($my_points[0]->clone); my $len = 0; for (my $i = 1; $i <= $#my_points; $i++) { diff --git a/lib/Slic3r/Print/SupportMaterial.pm b/lib/Slic3r/Print/SupportMaterial.pm index 02644fbf1..350611232 100644 --- a/lib/Slic3r/Print/SupportMaterial.pm +++ b/lib/Slic3r/Print/SupportMaterial.pm @@ -396,7 +396,7 @@ sub generate_toolpaths { push @$base, @$contact; } elsif (@$contact && $contact_loops > 0) { # generate the outermost loop - my @loops0; + my @loops0 = (); { # find centerline of the external loop of the contours my @external_loops = @{offset($contact, -$flow->scaled_width/2)};