vtkDecimateDX

IBM Data Explorer module that reduces the number of triangles in a triangle mesh


Overview

IBM Data Explorer modules such as Rubbersheet and Isosurface generate polygonal meshes (vertices connected by quads or triangles). Many times these meshes contain a very large number of polygons, and it becomes desirable to reduce the number of polygons before final rendering. This module will reduce the number of triangles in a triangle mesh, providing a good approximation to the original geometry while preserving the original topology of the object.

This module uses the triangle decimation routine found in the vtk library (The Visualization Toolkit, copyright 1993-1995 by Ken Martin, Will Schroeder, and Bill Lorensen). You will need to build the vtk library before attempting to compile this module. The original paper describing the decimation algorithm, "Decimation of Triangle Meshes" by Schroeder, Zarge, and Lorensen, can be found in the July 1992 issue of Computer Graphics (SIGGRAPH '92 Conference Proceedings) on page 65. The campanion book for the vtk library, "The Visualization Toolkit, An Object-Oriented Approach to 3D Graphics" (Prentice Hall, ISBN 013199837-4), should be in print by Feb. 1996.


Source Code

You will need a C++ compiler to build the libvtk software and the vtkDecimateDX module. The Makefile in this archive may have to be modified to support your particular workstation and software installation. Such modifications should be fairly straightforward; consult the DX Programmer's Manual for more information.


Algorithm

The description of this algorithm is taken directly from the vtkDecimate man page included with the libvtk distribution.

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 creates 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 may be increased over each iteration with the error increment. Edge preservation may be disabled or enabled. You can turn on/off edge vertex deletion. (Edge vertices are vertices that lie along boundaries of meshes). Sub iterations are iterations that are performed without changing the decimation criterion. The aspect ratio 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.

This implementation has been adapted for a global error bound decimation criterion. That is, the error is a global bounds on distance to original surface.


Usage

The following is a brief description of the input and output connections found in the vtkDecimateDX module. For detailed information, refer to the article in Computer Graphics referenced in the Overview section above.

Inputs

  • object - Only accepts DX objects whose connections are triangles. Two modules that output meshes that are ideal candidates for decimation are Isosurface and Rubbersheet. The Isosurface module generates objects with triangle connections, so its output can be sent directly to the vtkDecimateDX module. The Rubbersheet module generates objects with quad connections, so its output has to be sent to the Refine module before being processed by vtkDecimateDX.

  • reduction - Desired reduction in the total number of polygons. Because of various constraints, this level of reduction may not be realizable.

  • initial_error - Decimation error bounds expresses as a fraction of the longest side of the input data's bounding box.

  • error_increment - Value by which to increase the decimation error after each iteration.

  • max_error - Largest decimation error that can be achieved by incrementing error.

  • max_iterations - Maximum number of iterations to attempt. If decimation target is reached first, this value will not be reached.

  • max_subiterations - Maximum sub-iterations to perform. If no triangles are deleted in a sub-iteration, the subiteration process is stopped.

  • initial_angle - Mesh feature angles.

  • angle_increment - Increment by which to increase feature angle over each iteration.

  • max_angle - Maximum permissible feature angle.

  • edges - Turn on/off the preservation of feature edges.

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

  • aspect_ratio - Maximum aspect ratio allowed during triangulation.

  • degree - Number used to determine whether a vertex is considered complex, and is never deleted.

  • Output

  • decimated - Decimated triangular mesh. At this time, normals and colors input components are not processed or output from the vtkDecimateDX module.


  • Sample Network

    Here is the screen dump of a sample DX network used to decimate and render a terrain model created with USGS DEM data and the Rubbersheet module.