From f2e1fe5241b66de5b6d80d43e5450f89001ba958 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Tue, 21 Feb 2012 14:29:58 +0100 Subject: [PATCH] Do hole perimeters in ccw direction too --- lib/Slic3r/Perimeter.pm | 1 + lib/Slic3r/Polygon.pm | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib/Slic3r/Perimeter.pm b/lib/Slic3r/Perimeter.pm index b5e1d4379..17a82f034 100644 --- a/lib/Slic3r/Perimeter.pm +++ b/lib/Slic3r/Perimeter.pm @@ -115,6 +115,7 @@ sub make_perimeter { } foreach my $hole (@holes) { + $hole->reverse; push @{ $layer->perimeters }, Slic3r::ExtrusionLoop->new(polygon => $hole, role => 'perimeter'); } diff --git a/lib/Slic3r/Polygon.pm b/lib/Slic3r/Polygon.pm index 040580e5a..caed2ff4b 100644 --- a/lib/Slic3r/Polygon.pm +++ b/lib/Slic3r/Polygon.pm @@ -30,6 +30,11 @@ sub clone { return (ref $self)->new(map $_->clone, @$self); } +sub reverse { + my $self = shift; + @$self = reverse @$self; +} + sub lines { my $self = shift; return map Slic3r::Line->new($_), polygon_lines($self);