Version 0.59.0

Visual Edges Smoothing

When creating 3D models with trCAD, the resulting solids are made up of triangular meshes, which means that their surfaces lack true curvatures. However, in certain situations, it may be desirable to visually smooth out these surfaces, especially when using certain renderers that can exaggerate the "edginess" of the meshes.

To achieve this, trCAD offers a visual smoothing mechanism that uses normal interpolation to smooth out edges along a surface. This mechanism can be activated by setting the document variable render_vis_smooth to true:

Example

document.render_vis_smooth = true

It's important to note that not all edges of a solid should be smoothed out. For example, a cylinder has three surfaces that should be smoothed out individually (the top and bottom lids and the side face), but the edges connecting them should remain sharp.

Two identical cylinders, one without (left) and one with visual smoothing (right).

By default, trCAD solids are aware of which subsurfaces should be smoothed and which edges should remain unsmoothed, but this may not always be the case for imported meshes. In these cases, the vis_smooth function can be used to smooth out the entire solid or specific surfaces.

It's worth noting that this process only affects the visual appearance of the solid and does not alter the actual tessellation of the surfaces. For more information on changing tessellation precision, see the 'Tesselation' section'.

Gouraud shading is a similar technique used in computer graphics to simulate the shading of curved surfaces.

See also

🗙

Search results for