From 32d500be36e8c1b5e091748b28d852809d66e2a4 Mon Sep 17 00:00:00 2001 From: mcallieri Date: Tue, 5 Jan 2016 10:27:50 +0000 Subject: [PATCH] corrected a bug: a pushback of normal was missing in the case (qH[m.face[i].V(j)] == 0) --- vcg/complex/algorithms/intersection.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vcg/complex/algorithms/intersection.h b/vcg/complex/algorithms/intersection.h index 668dbc1f..0a527ec0 100644 --- a/vcg/complex/algorithms/intersection.h +++ b/vcg/complex/algorithms/intersection.h @@ -159,7 +159,7 @@ bool IntersectionPlaneMesh(TriMeshType & m, nmVec.clear(); for(int j=0;j<3;++j) { - if((qH[m.face[i].V0(j)] * qH[m.face[i].V1(j)])<0) + if((qH[m.face[i].V0(j)] * qH[m.face[i].V1(j)])<0) { const Point3 &p0 = m.face[i].V0(j)->cP(); const Point3 &p1 = m.face[i].V1(j)->cP(); @@ -175,7 +175,11 @@ bool IntersectionPlaneMesh(TriMeshType & m, Point3 nn =(n0*fabs(q1) + n1*fabs(q0))/fabs(q0-q1); nmVec.push_back(nn); } - if(qH[m.face[i].V(j)]==0) ptVec.push_back(m.face[i].V(j)->cP()); + if (qH[m.face[i].V(j)] == 0) + { + ptVec.push_back(m.face[i].V(j)->cP()); + nmVec.push_back(m.face[i].V(j)->cN()); + } } if(ptVec.size()>=2) {