From 91e9f651b51e6288e3f2678c00149d69ca3706a3 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Sat, 22 Sep 2012 15:51:18 +0200 Subject: [PATCH] Bugfix: --avoid-crossing-perimeters was crashing when processing empty layers --- lib/Slic3r/GCode/MotionPlanner.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/Slic3r/GCode/MotionPlanner.pm b/lib/Slic3r/GCode/MotionPlanner.pm index 4957f4345..7bd84b4fc 100644 --- a/lib/Slic3r/GCode/MotionPlanner.pm +++ b/lib/Slic3r/GCode/MotionPlanner.pm @@ -224,6 +224,8 @@ sub shortest_path { my $self = shift; my ($from, $to) = @_; + return Slic3r::Polyline->new($from, $to) if !@{$self->islands}; + # find nearest nodes my $new_from = $self->find_node($from, $to); my $new_to = $self->find_node($to, $from);