From 1d94618c5e46a2f640a25d7d4982053bf2a74351 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 13 May 2013 12:52:57 +0200 Subject: [PATCH] Correctly detect external hole perimeters --- lib/Slic3r/Layer/Region.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/Layer/Region.pm b/lib/Slic3r/Layer/Region.pm index 7776d0848..19a30d87f 100644 --- a/lib/Slic3r/Layer/Region.pm +++ b/lib/Slic3r/Layer/Region.pm @@ -353,7 +353,9 @@ sub make_perimeters { push @loops, $traverse->($polynode->{children}, $depth+1, $is_contour); my $role = EXTR_ROLE_PERIMETER; - if ($depth == 0) { + if ($is_contour ? $depth == 0 : !@{ $polynode->{children} }) { + # external perimeters are root level in case of contours + # and items with no children in case of holes $role = EXTR_ROLE_EXTERNAL_PERIMETER; } elsif ($depth == 1 && $is_contour) { $role = EXTR_ROLE_CONTOUR_INTERNAL_PERIMETER;