From 7062d028d285e9c2aa44f8feb4d7d014df529452 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 12 Aug 2013 18:12:53 +0200 Subject: [PATCH] Bugfix: top layers were not detected correctly, causing overlap of support material and object in some situations where there were contact regions having the same Z as some top regions --- lib/Slic3r/Print/Object.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/Slic3r/Print/Object.pm b/lib/Slic3r/Print/Object.pm index e14c8fb5..d9b23b7a 100644 --- a/lib/Slic3r/Print/Object.pm +++ b/lib/Slic3r/Print/Object.pm @@ -938,7 +938,9 @@ sub generate_support_material { # ('new' means all the areas that are lower than the last top layer # we considered) my $min_top = min(keys %top) // max(keys %contact); - push @$projection, map @{$contact{$_}}, grep { $_ > $layer->print_z && $_ < $min_top } keys %contact; + # use <= instead of just < because otherwise we'd ignore any contact regions + # having the same Z of top layers + push @$projection, map @{$contact{$_}}, grep { $_ > $layer->print_z && $_ <= $min_top } keys %contact; # now find whether any projection falls onto this top surface my $touching = intersection($projection, [ map $_->p, @top ]);