From 13e10abbbe28f12feaf2d5d7e1fbde512e8057e7 Mon Sep 17 00:00:00 2001 From: Alessandro Ranellucci Date: Wed, 6 Jun 2012 18:57:46 +0200 Subject: [PATCH] Fixed regression causing some models not to be sliced correctly. #410 --- lib/Slic3r/TriangleMesh.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/Slic3r/TriangleMesh.pm b/lib/Slic3r/TriangleMesh.pm index 5def6e34..f9b06c1b 100644 --- a/lib/Slic3r/TriangleMesh.pm +++ b/lib/Slic3r/TriangleMesh.pm @@ -15,7 +15,7 @@ has 'edges_facets' => (is => 'ro', default => sub { [] }); # id => [ $f1_id, $f use constant MIN => 0; use constant MAX => 1; -use constant I_FMT => 'ffLLLllc'; +use constant I_FMT => 'ffllLllc'; use constant I_B => 0; use constant I_A_ID => 1; use constant I_B_ID => 2; @@ -142,8 +142,7 @@ sub unpack_line { my @data = unpack I_FMT, $packed; splice @data, 0, 2, [ @data[0,1] ]; - $data[$_] ||= undef for I_A_ID, I_B_ID; - $data[$_] = undef for grep $data[$_] == -1, I_FACET_EDGE, I_PREV_FACET_INDEX, I_NEXT_FACET_INDEX; + $data[$_] = undef for grep $data[$_] == -1, I_A_ID, I_B_ID, I_FACET_EDGE, I_PREV_FACET_INDEX, I_NEXT_FACET_INDEX; return [@data]; } @@ -489,8 +488,8 @@ sub intersect_facet { return pack I_FMT, ( $points[A][X], $points[A][Y], # I_B - $points[B][2] || 0, # I_A_ID - $points[A][2] || 0, # I_B_ID + $points[B][2] // -1, # I_A_ID / + $points[A][2] // -1, # I_B_ID / $facet_id, # I_FACET_INDEX $prev_facet_index // -1, # I_PREV_FACET_INDEX / $next_facet_index // -1, # I_NEXT_FACET_INDEX /