Template Function lvr2::calcFaceNormals

Function Documentation

template<typename BaseVecT>
DenseFaceMap<Normal<typename BaseVecT::CoordType>> lvr2::calcFaceNormals(const BaseMesh<BaseVecT> &mesh)

Calculates a normal for each face in the mesh.

A face’s normal is calculated based on the position of its three vertices. If a face has zero area, the normal cannot be calculated correctly. In this case, a dummy normal (0, 0, 1) is inserted.