From 339c487077d81c752b286f6f43d59acd6c3cfe37 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Fri, 5 Jul 2013 17:25:56 +0200 Subject: [PATCH] Fix starting point after overhang clipping is performed --- lib/Slic3r/GCode.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/Slic3r/GCode.pm b/lib/Slic3r/GCode.pm index 80b7f9863..403303d3d 100644 --- a/lib/Slic3r/GCode.pm +++ b/lib/Slic3r/GCode.pm @@ -181,7 +181,8 @@ sub extrude_loop { } # split the loop at the starting point and make a path - my $extrusion_path = $loop->split_at(Slic3r::Geometry::nearest_point($last_pos, \@candidates)); + my $start_at = Slic3r::Geometry::nearest_point($last_pos, \@candidates); + my $extrusion_path = $loop->split_at($start_at); # clip the path to avoid the extruder to get exactly on the first point of the loop; # if polyline was shorter than the clipping distance we'd get a null polyline, so @@ -204,7 +205,7 @@ sub extrude_loop { # reapply the nearest point search for starting point @paths = Slic3r::ExtrusionPath::Collection ->new(paths => [@paths]) - ->chained_path($last_pos, 1); + ->chained_path($start_at, 1); } else { push @paths, $extrusion_path; }