Calculate average normal for poly mesh faces. Otherwise an arbitrary triangle is taken

git-svn-id: http://www.openmesh.org/svnrepo/OpenMesh/trunk@309 fdac6126-5c0c-442c-9429-916003d36597
This commit is contained in:
Jan Möbius
2010-03-09 13:32:23 +00:00
parent c0ea2968e3
commit 13204f4afc
4 changed files with 53 additions and 9 deletions

View File

@@ -66,6 +66,21 @@ namespace OpenMesh {
//== IMPLEMENTATION ==========================================================
template <class Kernel>
typename TriMeshT<Kernel>::Normal
TriMeshT<Kernel>::
calc_face_normal(FaceHandle _fh) const
{
assert(halfedge_handle(_fh).is_valid());
ConstFaceVertexIter fv_it(cfv_iter(_fh));
const Point& p0(point(fv_it)); ++fv_it;
const Point& p1(point(fv_it)); ++fv_it;
const Point& p2(point(fv_it));
return PolyMesh::calc_face_normal(p0, p1, p2);
}
//=============================================================================
} // namespace OpenMesh
//=============================================================================