Documentation for vtkDecimate

vtkDecimate - reduce the number of triangles in a mesh

Super Class: vtkPolyDataToPolyDataFilter

Description:

vtkDecimate is a filter to reduce the number of triangles in a triangle mesh, while preserving the original topology and a forming good approximation to the original geometry. The input to vtkDecimate is a vtkPolyData object, and only triangles are treated. If you desire to decimate polygonal meshes, first triangulate the polygons with the vtkTriangleFilter object. The algorithm proceeds as follows. Each vertex in the triangle list is evaluated for local planarity (i.e., the triangles using the vertex are gathered and compared to an "average" plane). If the region is locally planar, that is if the target vertex is within a certain distance of the average plane (i.e., the error), and there are no edges radiating from the vertex that have a dihedral angle greater than a user-specified edge angle (i.e., feature angle), and topology is not altered, then that vertex is deleted. The resulting hole is then patched by re-triangulation. The process continues over the entire vertex list (this constitutes an iteration). Iterations proceed until a target reduction is reached or a maximum iteration count is exceeded. There are a number of additional parameters you can set to control the decimation algorithm. The Error ivar may be increased over each iteration with the ErrorIncrement. (These two variables have the largest effect.) Edge preservation (i.e., PreserveEdges ivar) may be disabled or enabled. You can turn on/off edge vertex deletion (i.e., BoundaryVertexDeletion ivar). (Edge vertices are vertices that lie along boundaries of meshes.) Sub iterations are iterations that are performed without changing the decimation criterion. The AspectRatio ivar controls the shape of the triangles that are created, and is the ratio of maximum edge length to minimum edge length. The Degree is the number of triangles using a single vertex. Vertices of high degree are considered "complex" and are never deleted.

 

Caveats:

This implementation has been adapted for a global error bound decimation criterion. That is, the error is a global bound on distance to original surface. This is an improvement over the original Siggraph paper ("Decimation of Triangle Meshes", Proc Siggraph `92.) The algorithm has been extended with a special flag to allow topology modification. When the PreserveTopology flag is on, then the algorithm will preserve the topology of the original mesh. If off, the algorithm may close holes and/or collapse tunnels (i.e., form non-manifold attachments).

 

See Also:

vtkDecimatePro

 

Methods:

void vtkDecimate ()
void vtkDecimate ()
static vtkDecimate *New ()
const char *GetClassName ()
void PrintSelf (unknown & ,vtkIndent )
void SetInitialError (float )
float GetInitialError ()
void SetErrorIncrement (float )
float GetErrorIncrement ()
void SetMaximumError (float )
float GetMaximumError ()
void SetTargetReduction (float )
float GetTargetReduction ()
void SetMaximumIterations (int )
int GetMaximumIterations ()
void SetMaximumSubIterations (int )
int GetMaximumSubIterations ()
void SetInitialFeatureAngle (float )
float GetInitialFeatureAngle ()
void SetFeatureAngleIncrement (float )
float GetFeatureAngleIncrement ()
void SetMaximumFeatureAngle (float )
float GetMaximumFeatureAngle ()
void SetPreserveEdges (int )
int GetPreserveEdges ()
void PreserveEdgesOn ()
void PreserveEdgesOff ()
void SetBoundaryVertexDeletion (int )
int GetBoundaryVertexDeletion ()
void BoundaryVertexDeletionOn ()
void BoundaryVertexDeletionOff ()
void SetAspectRatio (float )
float GetAspectRatio ()
void SetPreserveTopology (int )
int GetPreserveTopology ()
void PreserveTopologyOn ()
void PreserveTopologyOff ()
void SetDegree (int )
int GetDegree ()
void SetMaximumNumberOfSquawks (int )
int GetMaximumNumberOfSquawks ()
void Execute ()
void CreateOutput (int ,int ,int ,vtkPointData * ,vtkPoints *)
int BuildLoop (int ,unsigned short ,int *)
void EvaluateLoop (int & ,int & ,vtkLocalVertexPtr )
int CanSplitLoop (vtkLocalVertexPtr ,int ,vtkLocalVertexPtr ,int & ,vtkLocalVertexPtr ,int & ,vtkLocalVertexPtr ,float &)
void SplitLoop (vtkLocalVertexPtr ,int ,vtkLocalVertexPtr * ,int & ,vtkLocalVertexPtr * ,int & ,vtkLocalVertexPtr *)
void Triangulate (int ,vtkLocalVertexPtr )
int CheckError ()

 

Detailed Method Descriptions:

Set the decimation error bounds. Expressed as a fraction of the longest side of the input data's bounding box.

void SetInitialError (float )
float GetInitialError ()

Set the value of the increment by which to increase the decimation error after each iteration.

void SetErrorIncrement (float )
float GetErrorIncrement ()

Set the largest decimation error that can be achieved by incrementing the error.

void SetMaximumError (float )
float GetMaximumError ()

Specify the desired reduction in the total number of polygons. Because of various constraints, this level of reduction may not be realizable.

void SetTargetReduction (float )
float GetTargetReduction ()

Specify the maximum number of iterations to attempt. If decimation target is reached first, this value will not be reached.

void SetMaximumIterations (int )
int GetMaximumIterations ()

Specify the maximum sub-iterations to perform. If no triangles are deleted in a sub-iteration, the sub-iteration process is stopped.

void SetMaximumSubIterations (int )
int GetMaximumSubIterations ()

Specify the mesh feature angles.

void SetInitialFeatureAngle (float )
float GetInitialFeatureAngle ()

Set/Get the angle by which to increase feature angle over each iteration.

void SetFeatureAngleIncrement (float )
float GetFeatureAngleIncrement ()

Set the largest permissible feature angle.

void SetMaximumFeatureAngle (float )
float GetMaximumFeatureAngle ()

Turn on/off the preservation of feature edges.

void SetPreserveEdges (int )
int GetPreserveEdges ()
void PreserveEdgesOn ()
void PreserveEdgesOff ()

Turn on/off the deletion of vertices on the boundary of a mesh.

void SetBoundaryVertexDeletion (int )
int GetBoundaryVertexDeletion ()
void BoundaryVertexDeletionOn ()
void BoundaryVertexDeletionOff ()

Specify the maximum allowable aspect ratio during triangulation.

void SetAspectRatio (float )
float GetAspectRatio ()

If the number of triangles connected to a vertex exceeds "Degree", then the vertex is considered complex and is never deleted. (NOTE: the complexity of the triangulation algorithm is proportional to Degree^2.)

void SetDegree (int )
int GetDegree ()

Control the printout of warnings. This flag limits the number of warnings regarding non-manifold geometry and complex vertices. If set to zero, no warnings will appear.

void SetMaximumNumberOfSquawks (int )
int GetMaximumNumberOfSquawks ()