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.
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.