From 00c6b1bdf8b11e405f8597a985f39ffb3e6af53d Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Thu, 7 Jun 2012 12:21:33 +0200 Subject: [PATCH] Bugfix: some thin walls still gave a fatal error. #416 --- lib/Slic3r/ExtrusionLoop.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/lib/Slic3r/ExtrusionLoop.pm b/lib/Slic3r/ExtrusionLoop.pm index da5be8985..a90725b0c 100644 --- a/lib/Slic3r/ExtrusionLoop.pm +++ b/lib/Slic3r/ExtrusionLoop.pm @@ -53,4 +53,18 @@ sub split_at_first_point { return $self->split_at($self->polygon->[0]); } +# although a loop doesn't have endpoints, this method is provided to allow +# ExtrusionLoop objects to be added to an ExtrusionPath::Collection and +# sorted by the ->shortest_path() method +sub endpoints { + my $self = shift; + return ($self->polygon->[0], $self->polygon->[-1]); +} + +# provided for ExtrusionPath::Collection->shortest_path() +sub points { + my $self = shift; + return $self->polygon; +} + 1;