VCG Library 0.1
vcg::tri::UpdateNormals< ComputeMeshType > Class Template Reference

Management, updating and computation of per-vertex and per-face normals. More...

#include <vcg/complex/trimesh/update/normal.h>

Static Public Member Functions

static void PerFace (ComputeMeshType &m)
 Calculates the face normal (if stored in the current face type)
 
static void PerVertexFromCurrentFaceNormal (ComputeMeshType &m)
 Calculates the vertex normal. Exploiting or current face normals.
 
static void PerFaceFromCurrentVertexNormal (ComputeMeshType &m)
 Calculates the vertex normal. Exploiting or current face normals.
 
static void PerVertexAngleWeighted (ComputeMeshType &m)
 Calculates the vertex normal. Without exploiting or touching face normals.
 
static void PerVertexWeighted (ComputeMeshType &m)
 Calculates the vertex normal. Without exploiting or touching face normals.
 
static void PerVertex (ComputeMeshType &m)
 Calculates the vertex normal. Without exploiting or touching face normals.
 
static void PerVertexPerFace (ComputeMeshType &m)
 Calculates both vertex and face normals.
 
static void PerVertexNormalizedPerFace (ComputeMeshType &m)
 Calculates both vertex and face normals.
 
static void NormalizeVertex (ComputeMeshType &m)
 Normalize the lenght of the face normals.
 
static void NormalizeFace (ComputeMeshType &m)
 Normalize the lenght of the face normals.
 
static void PerVertexNormalized (ComputeMeshType &m)
 Calculates the vertex normal.
 
static void PerVertexMatrix (ComputeMeshType &m, const Matrix44< ScalarType > &mat, bool remove_scaling=true)
 Multiply the vertex normals by the matrix passed. By default, the scale component is removed.
 
static void PerFaceMatrix (ComputeMeshType &m, const Matrix44< ScalarType > &mat, bool remove_scaling=true)
 Multiply the face normals by the matrix passed. By default, the scale component is removed.
 

Detailed Description

template<class ComputeMeshType>
class vcg::tri::UpdateNormals< ComputeMeshType >

Management, updating and computation of per-vertex and per-face normals.

This class is used to compute or update the normals that can be stored in the vertex or face component of a mesh.

Member Function Documentation

◆ NormalizeFace()

template<class ComputeMeshType >
static void vcg::tri::UpdateNormals< ComputeMeshType >::NormalizeFace ( ComputeMeshType & m)
inlinestatic

Normalize the lenght of the face normals.

◆ NormalizeVertex()

template<class ComputeMeshType >
static void vcg::tri::UpdateNormals< ComputeMeshType >::NormalizeVertex ( ComputeMeshType & m)
inlinestatic

Normalize the lenght of the face normals.

◆ PerFace()

template<class ComputeMeshType >
static void vcg::tri::UpdateNormals< ComputeMeshType >::PerFace ( ComputeMeshType & m)
inlinestatic

Calculates the face normal (if stored in the current face type)

◆ PerFaceFromCurrentVertexNormal()

template<class ComputeMeshType >
static void vcg::tri::UpdateNormals< ComputeMeshType >::PerFaceFromCurrentVertexNormal ( ComputeMeshType & m)
inlinestatic

Calculates the vertex normal. Exploiting or current face normals.

The normal of a face f is the average of the normals of the vertices of f.

◆ PerFaceMatrix()

template<class ComputeMeshType >
static void vcg::tri::UpdateNormals< ComputeMeshType >::PerFaceMatrix ( ComputeMeshType & m,
const Matrix44< ScalarType > & mat,
bool remove_scaling = true )
inlinestatic

Multiply the face normals by the matrix passed. By default, the scale component is removed.

◆ PerVertex()

template<class ComputeMeshType >
static void vcg::tri::UpdateNormals< ComputeMeshType >::PerVertex ( ComputeMeshType & m)
inlinestatic

Calculates the vertex normal. Without exploiting or touching face normals.

The normal of a vertex v is the classical area weigthed average of the normals of the faces incident on v.

◆ PerVertexAngleWeighted()

template<class ComputeMeshType >
static void vcg::tri::UpdateNormals< ComputeMeshType >::PerVertexAngleWeighted ( ComputeMeshType & m)
inlinestatic

Calculates the vertex normal. Without exploiting or touching face normals.

The normal of a vertex v computed as a weighted sum f the incident face normals. The weight is simlply the angle of the involved wedge. Described in:

G. Thurmer, C. A. Wuthrich "Computing vertex normals from polygonal facets" Journal of Graphics Tools, 1998

◆ PerVertexFromCurrentFaceNormal()

template<class ComputeMeshType >
static void vcg::tri::UpdateNormals< ComputeMeshType >::PerVertexFromCurrentFaceNormal ( ComputeMeshType & m)
inlinestatic

Calculates the vertex normal. Exploiting or current face normals.

The normal of a vertex v is the weigthed average of the normals of the faces incident on v.

◆ PerVertexMatrix()

template<class ComputeMeshType >
static void vcg::tri::UpdateNormals< ComputeMeshType >::PerVertexMatrix ( ComputeMeshType & m,
const Matrix44< ScalarType > & mat,
bool remove_scaling = true )
inlinestatic

Multiply the vertex normals by the matrix passed. By default, the scale component is removed.

◆ PerVertexNormalized()

template<class ComputeMeshType >
static void vcg::tri::UpdateNormals< ComputeMeshType >::PerVertexNormalized ( ComputeMeshType & m)
inlinestatic

Calculates the vertex normal.

◆ PerVertexNormalizedPerFace()

template<class ComputeMeshType >
static void vcg::tri::UpdateNormals< ComputeMeshType >::PerVertexNormalizedPerFace ( ComputeMeshType & m)
inlinestatic

Calculates both vertex and face normals.

The normal of a vertex v is the weigthed average of the normals of the faces incident on v.

◆ PerVertexPerFace()

template<class ComputeMeshType >
static void vcg::tri::UpdateNormals< ComputeMeshType >::PerVertexPerFace ( ComputeMeshType & m)
inlinestatic

Calculates both vertex and face normals.

The normal of a vertex v is the weigthed average of the normals of the faces incident on v.

◆ PerVertexWeighted()

template<class ComputeMeshType >
static void vcg::tri::UpdateNormals< ComputeMeshType >::PerVertexWeighted ( ComputeMeshType & m)
inlinestatic

Calculates the vertex normal. Without exploiting or touching face normals.

The normal of a vertex v is computed according to the formula described by Nelson Max in Max, N., "Weights for Computing Vertex Normals from Facet Normals", Journal of Graphics Tools, 4(2) (1999)

The weight for each wedge is the cross product of the two edge over the product of the square of the two edge lengths. According to the original paper it is perfect only for spherical surface, but it should perform well...


The documentation for this class was generated from the following file:

Generated on Mon Sep 27 08:13:16 2004 for VCG Library by doxygen 1.3.7