added two assert that checks that you have consistently prepared your mesh before feeding it into a grid for distance checking.
This commit is contained in:
parent
fb261dc8bf
commit
b399b4943f
|
@ -268,7 +268,13 @@ namespace vcg {
|
|||
vcg::Point3<typename FaceType::ScalarType> & p )
|
||||
{
|
||||
typedef typename FaceType::ScalarType ScalarType;
|
||||
// assert(f.cN().SquaredNorm() > 0.9999 && f.cN().SquaredNorm()<1.0001);
|
||||
// remember that the macro NDEBUG is defined when you want to optimize a lot.
|
||||
#ifndef NDEBUG
|
||||
static int staticCnt=0; // small piece of code that sometime check that face normals are really normalized
|
||||
if((staticCnt++%100)==0)
|
||||
assert(f.cN().SquaredNorm() > 0.9999 && f.cN().SquaredNorm()<1.0001); // if you get this assert you have forgot to make a UpdateNormals::PerFaceNormalized(m)
|
||||
|
||||
#endif
|
||||
Plane3<ScalarType> fPlane;
|
||||
fPlane.Init(f.cP(0),f.cN());
|
||||
const ScalarType EPSILON = ScalarType( 0.000001);
|
||||
|
@ -427,6 +433,7 @@ namespace vcg {
|
|||
else return false;
|
||||
}
|
||||
break;
|
||||
default: assert(0); // if you get this assert it means that you forgot to set the required UpdateFlags<MeshType>::FaceProjection(m);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue