Skip to content

Mesh Decimation Using VTK

SHAO YIYANG edited this page Mar 6, 2017 · 2 revisions

Objective

This documentation aims to introduce how to achieve mesh density normalization using Virsualization Toolkit(VTK). Originally, we used qslim to normalize mesh density. The problem discovered with qslim is that it does not promise to reduce or increase mesh density of all parts to a same level. VTK is an experiment of alternative methods for qslim and current result shows that it solves the problem pretty well.
There will be a brief introduction of VTK and a detailed description on specific algorithms used by us.

Visualization Toolkit (VTK)

The Visualization Toolkit (VTK) is an open-source, freely available software system for 3D computer graphics, image processing, and visualization. VTK has many visualization algorithms built in within a C++library. We mainly make use of the polygon reduction and mesh subdivision algorithms to average our mesh density of each 3D part. The download and installation guide can be found here. (OpenGL is required).
The main advantage of VTK is that a specific reduction rate can be set. Therefore, we can reduce the number of meshes to a desired target to make sure all the 3D parts have similar mesh density. Moreover, VTK mesh decimation also preserves the topology and the visual shape of the original geometry very well.

Mesh Decimation with VTK

Input and Output

Because the original algorithm qslim uses smf file format for both input and output, our VTK version will keep it same for easy integration into original system. The classes implementing the algorithms we used require vtkPolyData as input and output, so custom smf reader and writer are implemented in the VTK version.

Algorithms

The complete process of normalizing mesh density makes use of two main classes of VTK: vtkSubdivisionFilter and vtkDecimatePro. vtkSubdivision Class is used when the original number of meshes of the part is smaller than the target mesh number. In this situation, we first use vtkSubdivisionFilter to increase the number of meshes above the target. After number of meshes of all parts are larger than the target, we use vtkDecimatePro Class to reduce the mesh number to a specific level.

vtkSubdivisionFilter

There are different subdivision schemes available, including linear scheme, loop scheme and butterfly scheme, etc. We chose to use linear scheme because it preserves geometry relatively better for most of cases.
Due to the design of subdivision algorithm, the number of triangles can only increase by approximately a factor of 4 each time.

vtkDecimatePro

The decimation process is separated into three steps: Vertex classification, Decimation criterion and Triangulation.

  • Vertex Classification: It characterizes the local geometry and topology for each vertex by classifying them into different types according to their neighborhoods.
  • Decimation Criterion: This step measures the error of each vertex if removed.
  • Triangulation: The resulting hole polygon after removing vertex needs to be triangulated.

Result and Conclusion

Decimation result of three typical parts is listed below with the comparison of visual geometries and mesh numbers before and after the mesh decimation using this algorithm.
Sorry, Screenshot Not Public
From the testing result, it is seen that this algorithm is effective to reduce mesh density to a desired target (1000 polygons in this testing case). It is able to solve the problem of current qslim that 3D parts may have various mesh densities after mesh simplification.