Documentation for vtkDecimatePro

vtkDecimatePro - reduce the number of triangles in a mesh

Super Class: vtkPolyDataToPolyDataFilter

Description:

vtkDecimatePro is a filter to reduce the number of triangles in a triangle mesh, forming a good approximation to the original geometry. The input to vtkDecimatePro is a vtkPolyData object, and only triangles are treated. If you desire to decimate polygonal meshes, first triangulate the polygons with vtkTriangleFilter object. The implementation of vtkDecimatePro is similar to the algorithm originally described in "Decimation of Triangle Meshes", Proc Siggraph `92, with three major differences. First, this algorithm does not necessarily preserve the topology of the mesh. Second, it is guaranteed to give the a mesh reduction factor specified by the user (as long as certain contraints are not set - see Caveats). Third, it is set up generate progressive meshes, that is a stream of operations that can be easily transmitted and incrementally updated (see Hugues Hoppe's Siggraph '96 paper on progressive meshes). The algorithm proceeds as follows. Each vertex in the mesh is classified and inserted into a priority queue. The priority is based on the error to delete the vertex and retriangulate the hole. Vertices that cannot be deleted or triangulated (at this point in the algorithm) are skipped. Then, each vertex in the priority queue is processed (i.e., deleted followed by hole triangulation using edge collapse). This continues until the priority queue is empty. Next, all remaining vertices are processed, and the mesh is split into separate pieces along sharp edges or at non-manifold attachment points and reinserted into the priority queue. Again, the priority queue is processed until empty. If the desired reduction is still not achieved, the remaining vertices are split as necessary (in a recursive fashion) so that it is possible to eliminate every triangle as necessary. To use this object, at a minimum you need to specify the ivar TargetReduction. The algorithm is guaranteed to generate a reduced mesh at this level as long as the following four conditions are met: 1) topology modification is allowed (i.e., the ivar PreserveTopology is off); 2) mesh splitting is enabled (i.e., the ivar Splitting is on); 3) the algorithm is allowed to modify the boundary of the mesh (i.e., the ivar BoundaryVertexDeletion is on); and 4) the maximum allowable error (i.e., the ivar MaximumError) is set to VTK_LARGE_FLOAT. Other important parameters to adjust include the FeatureAngle and SplitAngle ivars, since these can impact the quality of the final mesh. Also, you can set the ivar AccumulateError to force incremental error update and distribution to surrounding vertices as each vertex is deleted. The accumulated error is a conservative global error bounds and decimation error, but requires additional memory and time to compute.

 

Caveats:

To guarantee a given level of reduction, the ivar PreserveTopology must be off; the ivar Splitting is on; the ivar BoundaryVertexDeletion is on; and the ivar MaximumError is set to VTK_LARGE_FLOAT. If PreserveTopology is off, and SplitEdges is off; the mesh topology may be modified by closing holes. Once mesh splitting begins, the feature angle is set to the split angle.

 

See Also:

vtkDecimate

 

Methods:

void vtkDecimatePro ()
void vtkDecimatePro ()
const char *GetClassName ()
void PrintSelf (unknown & ,vtkIndent )
static vtkDecimatePro *New ()
void SetTargetReduction (float )
float GetTargetReduction ()
void SetPreserveTopology (int )
int GetPreserveTopology ()
void PreserveTopologyOn ()
void PreserveTopologyOff ()
void SetFeatureAngle (float )
float GetFeatureAngle ()
void SetSplitting (int )
int GetSplitting ()
void SplittingOn ()
void SplittingOff ()
void SetSplitAngle (float )
float GetSplitAngle ()
void SetPreSplitMesh (int )
int GetPreSplitMesh ()
void PreSplitMeshOn ()
void PreSplitMeshOff ()
void SetMaximumError (float )
float GetMaximumError ()
void SetAccumulateError (int )
int GetAccumulateError ()
void AccumulateErrorOn ()
void AccumulateErrorOff ()
void SetBoundaryVertexDeletion (int )
int GetBoundaryVertexDeletion ()
void BoundaryVertexDeletionOn ()
void BoundaryVertexDeletionOff ()
void SetDegree (int )
int GetDegree ()
void SetInflectionPointRatio (float )
float GetInflectionPointRatio ()
int GetNumberOfInflectionPoints ()
void GetInflectionPoints (float *)
float *GetInflectionPoints ()
void Execute ()
void SplitMesh ()
int EvaluateVertex (int ,unsigned short ,int * ,int )
int FindSplit (int ,int ,int & ,int & ,vtkIdList *)
int IsValidSplit (int )
void SplitLoop (int ,int & ,int * ,int & ,int *)
void SplitVertex (int ,int ,unsigned short ,int * ,int )
int CollapseEdge (int ,int ,int ,int ,int ,vtkIdList *)
void DistributeError (float )
void InitializeQueue (int )
void DeleteQueue ()
void Insert (int ,float )
int Pop (float &)
float DeleteId (int )
void Reset ()

 

Detailed Method Descriptions:

Create object with specified reduction of 90% and feature angle of 15 degrees. Edge splitting is on, defer splitting is on, and the split angle is 75 degrees. Topology preservation is off, delete boundary vertices is on, and the maximum error is set to VTK_LARGE_FLOAT. The inflection point ratio is 10 and the vertex degree is 25. Error accumulation is turned off.

static vtkDecimatePro *New ()

Specify the desired reduction in the total number of polygons. Because of various constraints, this level of reduction may not be realized. If you want to guarantee a particular reduction, you must turn off PreserveTopology and BoundaryVertexDeletion, turn on SplitEdges, and set the MaximumError to VTK_LARGE_FLOAT (these ivars are initialized this way when the object is instantiated).

void SetTargetReduction (float )
float GetTargetReduction ()

Turn on/off whether to preserve the topology of the original mesh. If on, mesh splitting and hole elimination will not occur. This may limit the maximumm reduction that may be achieved.

void SetPreserveTopology (int )
int GetPreserveTopology ()
void PreserveTopologyOn ()
void PreserveTopologyOff ()

Specify the mesh feature angle. This angle is used to define what an edge is (i.e., if the surface normal between two adjacent triangles is >= FeatureAngle, an edge exists).

void SetFeatureAngle (float )
float GetFeatureAngle ()

Turn on/off the splitting of the mesh at corners, along edges, at non-manifold points, or anywhere else a split is required. Turning splitting off will better preserve the original topology of the mesh, but you may not obtain the requested reduction.

void SetSplitting (int )
int GetSplitting ()
void SplittingOn ()
void SplittingOff ()

Specify the mesh split angle. This angle is used to control the splitting of the mesh. A split line exists when the surface normals between two edge connected triangles are >= SplitAngle.

void SetSplitAngle (float )
float GetSplitAngle ()

In some cases you may wish to split the mesh prior to algorithm execution. This separates the mesh into semi-planar patches, which are disconnected from each other. This can give superior results in some cases. If the ivar PreSplitMesh ivar is enabled, the mesh is split with the specified SplitAngle. Otherwise mesh splitting is deferred as long as possible.

void SetPreSplitMesh (int )
int GetPreSplitMesh ()
void PreSplitMeshOn ()
void PreSplitMeshOff ()

Set the largest decimation error that is allowed during the decimation process. This may limit the maximum reduction that may be achieved. The maximum error is specified as a fraction of the maximum length of the input data bounding box.

void SetMaximumError (float )
float GetMaximumError ()

The computed error can either be computed directly from the mesh or the error may be accumulated as the mesh is modified. If the error is accumulated, then it represents a global error bounds, and the ivar MaximumError becomes a global bounds on mesh error. Accumulating the error requires extra memory proportional to the number of vertices in the mesh. If AccumulateError is off, then the error is not accumulated.

void SetAccumulateError (int )
int GetAccumulateError ()
void AccumulateErrorOn ()
void AccumulateErrorOff ()

Turn on/off the deletion of vertices on the boundary of a mesh. This may limit the maximum reduction that may be achieved.

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

If the number of triangles connected to a vertex exceeds "Degree", then the vertex will be split. (NOTE: the complexity of the triangulation algorithm is proportional to Degree^2. Setting degree small can improve the performance of the algorithm.)

void SetDegree (int )
int GetDegree ()

Specify the inflection point ratio. An inflection point occurs when the ratio of reduction error between two iterations is greaten than or equal to the InflectionPointRatio.

void SetInflectionPointRatio (float )
float GetInflectionPointRatio ()

Get the number of inflection points. Only returns a valid value after the filter has executed. The values in the list are mesh reduction values at each inflection point. Note: the first inflection point always occurs right before non-planar triangles are decimated (i.e., as the error becomes non-zero).

int GetNumberOfInflectionPoints ()

Get a list of inflection points. These are float values 0

void GetInflectionPoints (float *)

Get a list of inflection points. These are float values 0

float *GetInflectionPoints ()