Skip to content

Commit

Permalink
Added a MissingPreconditionException for FaceNormalNormalized
Browse files Browse the repository at this point in the history
  • Loading branch information
cignoni committed Aug 20, 2024
1 parent 2d05c94 commit 047ef5c
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion vcg/complex/algorithms/mesh_assert.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,16 @@ class MeshAssert
throw vcg::MissingPreconditionException("Vertex Normal are not normalized");
}
}


/// \brief Throw vcg::MissingPreconditionException if Face Normals are not unit lenght
static void FaceNormalNormalized(MeshType &m)
{
for(auto fi=m.face.begin();fi!=m.face.end();++fi) if(!fi->IsD())
{
if(fabs(fi->cN().Norm()-1.0)>0.000001)
throw vcg::MissingPreconditionException("Face Normal are not normalized");
}
}


/// \brief Throw vcg::MissingPreconditionException if There are unreferenced vertices
Expand Down

0 comments on commit 047ef5c

Please sign in to comment.