From dde71418d48349da60250308177cd61fd4574bd3 Mon Sep 17 00:00:00 2001
From: Alessandro Ranellucci <aar@cpan.org>
Date: Wed, 2 May 2012 16:28:47 +0200
Subject: [PATCH] Bugfix: skip arc compensation when holes are not round

---
 lib/Slic3r/Layer.pm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/Slic3r/Layer.pm b/lib/Slic3r/Layer.pm
index 8b718b91e..1d88b21c7 100644
--- a/lib/Slic3r/Layer.pm
+++ b/lib/Slic3r/Layer.pm
@@ -200,7 +200,9 @@ sub make_perimeters {
             my $new_radius = (scale($Slic3r::flow_width) + sqrt((scale($Slic3r::flow_width)**2) + (4*($radius**2)))) / 2;
             # holes are always turned to contours, so reverse point order before and after
             $hole->reverse;
-            @$hole = map Slic3r::Point->new($_), @{ +($hole->offset(+ ($new_radius - $radius)))[0] };
+            my @offsetted = $hole->offset(+ ($new_radius - $radius));
+            # skip arc compensation when hole is not round (thus leads to multiple offsets)
+            @$hole = map Slic3r::Point->new($_), @{ $offsetted[0] } if @offsetted == 1;
             $hole->reverse;
         }