NOTE Have a look at About 3D Models Types to understand the difference between CAD models and Polygonal models
To be displayed in a 3D application, CAD models' faces need to be translated into tessellated surfaces, also called meshes.
A mesh is composed of multiple connected polygons, or triangles (1 polygon generally equals 2 coplanar triangles), forming a discretized geometry that is understandable by a GPU, to be rendered in a 3D application.
The more triangles used to represent a surface, the more realistic the rendering, but the more computation is required.
The tessellation step is very important in Data Preparation as it defines the maximum quality of the CAD model. Pixyz tessellation algorithm has proven to be very efficient at transforming any CAD model into meshes, ready to be displayed and exported, with a perfect balance between visual quality and polygon count.
The "Tessellate" function is available from the "CAD" menu.
TIP Want to learn more about the process of tessellating CAD models? Please have a look at this keynote!
Several parameters are used to control the tessellation (see the function dialog box), the most important ones being:
- Max Sag: The maximum distance between the geometry and the tessellation (also called "Chord error"). This parameter ensures that the mesh is similar enough to the original analytical surface (exact geometry).
A low value means that a very fine mesh is created. The distance values are expressed in millimeters.
- Max Angle: The maximum angle allowed between normals of two adjacent polygons (on the same face). This provides more precision on small radius fillets.
Adjust the "Max angle" parameter to keep enough polygons in high curvature areas whose radius is lower than the "Max Sag" value: fillets and chamfers for example.
- Max length: Used to control the maximum length of a polygon (edge).
For a rendering usage, it is often recommended not to use the "Max Length" parameter. It increases the polygons count without significant improvement on the visual aspect. But in case of very long objects (a plane body, a train cabin…), this setting can avoid lighting artifacts caused by too long polygons.
In the example below, reducing the "Max Sag" value from 0.2mm to 0.1mm made the mesh less rough and more realistic:
Then, adding the "Max angle" parameter (with a 20° value) has improved fillet precision by adding a row of polygons without increasing the polygon count for the yellow piece contour:
The function "Tessellate" comes with 3 default presets, that define the value for all parameters of the function:
- Medium (default): delivers well-balanced meshes. It is the default preset that will give the best result in most situations, a good average between polycount and visual quality
- High: delivers more detailed meshes. Use this preset for objects that will be observed more closely (close to the virtual camera), for objects that have small details that are important, or for very small objects (you can even set the "Max Sag" to 0.01mm for very small objects like rings, microchips...)
- Low: delivers less accurate meshes. Use this preset for objects that will be seen from a distance, or for large objects with no detail that need to be seen.
On the right side of the pictures is the same model as on the left side, but without the wireframe (edges of the mesh) displayed.
The difference of quality is very hard to distinguish, especially between "Medium" and "High" presets. With "Low" preset, the lack of polygons is starting to show.
This demonstrates that using the "Medium" preset is most of the time the best solution, especially if you do not need to zoom closely on the model's details.
TIP Once you have found the perfect set of tessellation parameters that gives the quality you need, save them in a new preset!
Tessellation and Part size
The "Max Sag" is a distance criteria: a smaller value is necessary to guarantee a sufficient quantity of polygons on small parts.
Anyway, a bigger Part in term of “scale” does not mean that this Part does not contain some potentially important details.
So a small Sag value can also be used to maintain quality on detailed areas of bigger Parts.
In the below example, the red beam (way bigger than the yellow ring) was tessellated with a 5 mm Sag, and 0.1 mm for the ring.
The result is that the hole in the beam was turned into a square: we lost details on a big part.
This explains why Pixyz tessellation algorithm, through its "Max Sag" parameter, is not dependent from the scale (or bounding box size) of each of Part, because we might lose details on bigger parts.
Anyway, there can be some good reasons to set the tessellation settings based on the scale of the Parts of the scene. It can easily been done using Python scripting in Pixyz Studio, targeting the Bounding Box size of the parts for example.
In a general approach, the best strategy is to find criteria (size, material, any metadata…) to perform a targeted tessellation, with different settings, based on these criteria.
For example you can tessellate with fine settings on a car body that has a shinny aspect, so that reflections look nice.
API function parameters
Check the API documentation page to learn more about the other function parameters and use it in Python code: