Decimate To Quality
The Decimate To Quality function is used to efficiently reduce a model's polycount, whilst preserving as much as possible its visual quality.
It works by smartly deleting vertices of the meshes (Vertex removal technique), using quality criteria to prevent smoothing artifacts and topological irregularities.
The function is available from the Optimize Mesh menu.
Parameters
The algorithm behind the Decimate To Quality function uses a combination of 4 main parameters, which are geometrical tolerances to obtain the lightest model possible (in terms of polycount), whilst keeping acceptable quality:
Surfacic tolerance: defines the maximum distance between vertices of the original model and resulting simplified surfaces.
Lineic tolerance: defines the maximum distance between lineic vertices of the original model and resulting simplified lines.
The Lineic tolerance is meant to preserve the boundaries of the original surface (where the edges are “sharp”, or "hard").
Note
Thanks to the Lineic control, the Decimate To Quality function is particularly adapted for CAD models, which generally contain a lot of hard edges!
Normal tolerance: defines the maximum angle existing between the original normals and those interpolated on the simplified surface.
The Normal tolerance setting preserves the quality of how the light reacts on the surface of a mesh. Combined with the Surfacic tolerance setting, it will act as a quality controller, keeping polygons where the surface curvature is important and preserving the visual quality of the model.
Texture Coordinates tolerance: this setting is meant to preserve the UV (or Texture Coordinates) whilst decimating a mesh (0,01 is a good value). The higher the value is, the more aggressive the decimation is. Use -1 to bypass this tolerance.
Note
The Texture Coordinates tolerance is used to control UV distortion whilst decimating. But UV seams (like sharp edges) remain "significant" edges for the algorithm: they are affected by the Lineic tolerance, but decimation cannot ignore them. That can cause decimation effectiveness to be restrained. To allow the Decimate To Quality function to go further in terms of polygon reduction, you should delete the UVs prior to decimating.
Presets
The function Decimate To Quality comes with 3 default presets, that define the value for each parameter:
- Low: the meshes will not be much decimated. This preset is good when it comes to remove some useless polygons, left behind after a Remove Holes process for example
- Medium: the meshes will be more decimated. Visible consequences might start showing but the result will be acceptable for meshes not visible from a reasonable distance
- Strong: the meshes will be heavily decimated. They might start showing some artifacts on some places: it is good to use this preset for objects far from the camera
Example
Let's see a practical example with the Buggy model below (3DXML model, courtesy of Dassault Systèmes), to explain how each parameter controls the algorithm.
This model contains 140 846 triangles: let's use the Decimate To Quality function to reduce the polycount.
Tip
Prior to performing a decimation, it's best to repair the model first, in order to reconnect potential cracks or gaps existing in the original model and prevent the decimation to accentuate them. Set the parameter Orient to false if you are happy with the polygon face orientation and do not want to damage them.
Surfacic Tolerance
The surfacic tolerance is the maximum distance between the original model and the simplified one.
The higher the tolerance, the lower the quality, but the higher the polygon reduction.
Decimation with surfacic tolerance = 0.1 mm: the polycount is reduced to 66 636 but the quality is quite good:
Decimation with surfacic tolerance = 1 mm: the polygon count is now reduced to 7 155 but the quality is poor, and causes a lot of lighting problems:
To obtain very low polycount without destroying visual quality of the model, the algorithm can control normal distortion during the decimation process.
Normal distortion tolerance
The normal distortion tolerance is the maximum angle between a normal at each vertex of the original model and its corresponding normal on the simplified one.
Decimation with surfacic tolerance = 1 mm and normal distortion tolerance = 5 degrees: the polycount is reduced to 9 525 with an almost imperceptible quality loss:
Finally, the high surfacic tolerance (1mm) produces a significant aliasing visible on sharp edges:
Lineic tolerance
This tolerance is equivalent to the surfacic tolerance but it is applied only on sharp edges (or hard edges) or on lines of interest.
Decimation with surfacic tolerance = 1 mm, normal distortion tolerance = 5 degrees and lineic tolerance = 0.1mm: the polycount is reduced to 13 126 with an almost imperceptible quality loss, even on sharp edges. The quality is better than using only a surfacic tolerance of 0.1 mm with a triangle count widely inferior (13 126 against 66 636):
Summary
The best way to decimate a model using the Decimate To Quality function, is to combine the 3 main parameters to obtain the lighter model while keeping an acceptable quality.
Parameters combination | Quality | Triangles | Reduction % |
---|---|---|---|
Surfacic 1mm | - | 7 155 | 94 |
Surfacic 0.1mm | + | 66 636 | 52 |
Surfacic 1mm + Normal 5° | ++ | 9 525 | 93 |
Surfacic 1mm + Normal 5° + Lineic 0.1mm | +++ | 13 126 | 90 |
Original Mesh | ++++ | 140 846 | 0 |
About the Texture coordinates tolerance
As explained above, this parameter prevents the UVs from being too distorted at decimation.
Decimation with texture coordinates tolerance = False (not used at decimation): the wooden textures moves because the underlying UVs get distorted:
Decimation with texture coordinates tolerance = 0.001 (very small UV displacement allowed): the wooden texture moves far less than above, because the underlying UVs gets preserved:
API function parameters
Check the API Reference page to learn how to use this function in Python code: Decimate To Quality API Reference page