From 4296ea6da147ff4e8b9f56fe43e9b4ed8dbb8912 Mon Sep 17 00:00:00 2001 From: Nicolas Dandrimont Date: Thu, 14 Jun 2012 13:33:59 +0200 Subject: [PATCH] Slic3r::Polygon's boost_linestring method needs to close the contour. This prevented Slic3r from detecting some bridge supporting edges (basically, if that edge was the last one in the contour). This addresses some of the bridge detection issues (#414, #358). --- lib/Slic3r/Polygon.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/Slic3r/Polygon.pm b/lib/Slic3r/Polygon.pm index 87036a24f..7fe779a6a 100644 --- a/lib/Slic3r/Polygon.pm +++ b/lib/Slic3r/Polygon.pm @@ -16,6 +16,11 @@ sub lines { return @lines; } +sub boost_linestring { + my $self = shift; + return Boost::Geometry::Utils::linestring([@$self, $self->[0]]); +} + sub is_counter_clockwise { my $self = shift; return Math::Clipper::is_counter_clockwise($self);