From c16ecb4316c070c4205ca6132bfeeaaa64003bbf Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Mon, 26 Sep 2011 16:19:32 +0200 Subject: [PATCH] Fixed regression which prevented horizontal shells to be processed for external top surfaces --- lib/Slic3r/STL.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Slic3r/STL.pm b/lib/Slic3r/STL.pm index a72714114..97b02a2e0 100644 --- a/lib/Slic3r/STL.pm +++ b/lib/Slic3r/STL.pm @@ -121,16 +121,16 @@ sub _facet { my $clockwise = !is_counter_clockwise([@vertices]); # defensive programming and/or input check - if (($normal->[Z] > 0 && $clockwise > 0) || ($normal->[Z] < 0 && $clockwise < 0)) { + if (($normal->[Z] > 0 && $clockwise) || ($normal->[Z] < 0 && !$clockwise)) { YYY $normal; die sprintf "STL normal (%.0f) and right-hand rule computation (%s) differ!\n", - $normal->[Z], $clockwise > 0 ? 'clockwise' : 'counter-clockwise'; + $normal->[Z], $clockwise ? 'clockwise' : 'counter-clockwise'; } - if ($layer->id == 0 && $clockwise < 0) { + if ($layer->id == 0 && !$clockwise) { die "Right-hand rule gives bad result for facets on base layer!\n"; } - $surface->surface_type($clockwise < 0 ? 'top' : 'bottom'); + $surface->surface_type($clockwise ? 'bottom' : 'top'); return; }