From 08ffe4b7a118442ac1b3c3fdfa4fffd9500d074c Mon Sep 17 00:00:00 2001 From: cignoni Date: Fri, 8 May 2009 21:41:37 +0000 Subject: [PATCH] re-correct the assert that was causing a failure. The previous commit tho marching cubes.h (done by me!) was rather wrong. Sorry,. --- vcg/complex/trimesh/create/marching_cubes.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/vcg/complex/trimesh/create/marching_cubes.h b/vcg/complex/trimesh/create/marching_cubes.h index 9612b577..1d732ccc 100644 --- a/vcg/complex/trimesh/create/marching_cubes.h +++ b/vcg/complex/trimesh/create/marching_cubes.h @@ -707,7 +707,9 @@ namespace vcg default: { assert(false); /* Invalid edge identifier */ } } // end of switch - assert((vp - &_mesh->vert[0])>=0 && vertices_idx[vert]<_mesh->vert.size()); + // Note that vp can be zero if we are in case 12 and that vertices_idx is surely >0 so the following assert has to be corrected as below. + // assert((vp - &_mesh->vert[0])>=0 && vertices_idx[vert]<_mesh->vert.size()); + assert(vertices_idx[vert]<_mesh->vert.size()); } // end for (int vert=0 ...) _mesh->face[face_idx].V(0) = &_mesh->vert[vertices_idx[0]];