Applies to: Surfaces

Summary: Automatically meshes surface geometry with triangle elements using the third part MeshGems tool.

GUI: The GUI command panel is accessed via Mesh/Surface/Mesh/Trimesh.


Surface <range> Scheme TriMesh [Geometry Approximation Angle <angle>] [Minimum Size <value>]

Related Commands:

[Set] Trimesher Surface Gradation <value>

[Set] Trimesher Volume Gradation <value>


The TriMesh scheme fills a surface of arbitrary shape with triangle elements. The TriMesh scheme serves as the default method for meshing the surfaces of volumes for the TetMesh scheme.

Included in Trelis is a third party software library for generating triangle meshes called MeshGems. This is a robust and fast triangle mesher developed and distributed by Distene. Figure 1 shows a CAD model where surfaces have been meshed with the TriMesh scheme. The triangle mesh was then used as input to the TetMesh scheme.

Figure 1. Triangle meshes generated with the TriMesh scheme using default settings on the surfaces of a CAD model.

The TriMesh scheme is usually very good at generating a mesh with its default settings. In most cases no adjustments to default settings are necessary. Using the size assigned to the surface, either assigned explicitly or defined with an auto size, the TriMesh scheme will attempt to maintain the assigned size, except where features smaller than the specified size exist. In this case, smaller triangles will automatically be generated to match the feature size. The triangle mesher will then generate a smooth gradation from the small triangles used to capture features, to the size specified on the surface. This effect is shown in figure 1 where the transitions in triangle sizes can be seen. If no size is specified on the surface, it will use the size that was set on its parent volume. User defined sizes and intervals can also be assigned to individual curves for more specific control of element sizes.

Although rare, if meshing fails when using the TriMesh scheme, Trelis will automatically attempt to mesh the surface with the TriDelaunay scheme. Subsequent mesh failures will also attempt meshing with the TriAdvance and QTri schemes.

A sizing function can also be used with the TriMesh scheme to control element sizes, however the algorithm used for meshing will automatically revert to the TriAdvance scheme. This is because the MeshGems algorithm provides built-in capabilities for adaptively controlling the element sizes based on geometry. More details can be found in Geometry Adaptive Sizing for TriMesh and TetMesh Schemes

When using the TriMesh and TetMesh schemes, recommended practice is to mesh all surfaces and volumes simultaneously. This provides the greatest flexibility to the algorithms to determine feature sizes and their effect on neighboring surfaces and volumes.

TriMesh Scheme Options

The TriMesh options described below can be set to adjust the default behavior of the tri mesher. Scheme options are assigned independently to each surface as part of the scheme TriMesh command. Note that the options described here will apply only if the TriMesh scheme is used. TriDelaunay and TriAdvance schemes will not utilize these options when meshing.

Geometry Approximation Angle <angle = 15>

For non-planar CAD surfaces and non-linear curves, an approximation must always be made to capture the curved features using the linear edges of the triangle. When a geometry approximation angle is specified, the triangle mesher will adjust triangle sizes on curved boundaries so that the linear edges of the triangle will deviate from the geometry by no greater than the specified angle. Figure 2 illustrates how the geometry approximation angle is determined. If the red curve representes the geometry and the black segments represent the mesh, the angle &theta; is the angle between the tangent plane at point A and the plane of a triangle at A. &theta; represents the maximum deviation from the geometry that the mesh will attempt to capture. As shown in figure 2(b), a smaller geometry approximation angle will normally result in more elements, but it will more closely approximate the actual geometry. The default approximation angle is 15 degrees.



Figure 2. The geometry approximation angle &theta; is shown as the maximum deviation between the tangent plane at A and the plane of a triangle at A.

Note that the geometry approximation angle is also effective in controlling the element size on the interior of surfaces as illustrated in figure 3. This is most useful when used in conjunction with the TetMesh Scheme where smaller tets will be placed in regions of higher curvature.

Figure 3. Demonstrates the effect of the geometry approximation angle to better capture surface curvature on the interior of surfaces.

Minimum Size <value>

When specifying a minimum size the triangle mesher will attempt to prevent creating elements smaller than this specified size. It should be noted that there may still be a small number of elements with a size slightly less than this value.

Global Trimesher Gradation Options

The user may set options that control the gradation of the tri-meshing algorithms. These trimesher options are global settings and apply to all trimeshes generated when the scheme is set to TriMesh until the option is changed by the user.

The global gradation options control how fast the triangle sizes can change when transitioning from small to larger sizes. For example a value of 1.5 will attempt to limit the change in element size of adjacent triangles to no greater than a factor of 1.5. Valid values for gradation should be greater than 1.0 and usually less than 2 or 3. The larger the value, the faster the transition resulting in fewer total elements. Likewise, values closer to 1.0 can result in significantly more elements, especially when small features are present. The default setting for gradation is 1.3. Gradation can be controlled for both surfaces and volumes.

[Set] Trimesher Surface Gradation <value>

Surface gradation will control the growth of triangles where element size has been determined by bounding curves. For example, Figure 4 shows a small feature where element sizes have been determined locally by the length of the small curves. A gradation is applied so that triangle sizes increase away from the small feature. A surface gradation of 1.3 is shown on the left, while a surface gradation of 1.1 is shown on the right.



Figure 4. Demonstrates the effect of changing the default gradation, where (a) is the default gradation of 1.3, compared with (b) using a gradation of 1.1. Note that both images use the same interval size setting for the surface.

[Set] Trimesher Volume Gradation <value>

Volume gradation will control the growth of triangles where element size has been determined by the proximity of other nearby surfaces. For example, Figure 5a and 5b shows a brick with a small void where the surface meshes are generated with the TriMesh scheme. The surface gradation has been adjusted to a large number so its effect is negligible. The small element size determined for the void is propagated to the exterior surfaces. The resulting gradation of the nearby triangles on the surface is determined by the trimesh volume gradation setting.

Note that the trimesh volume gradation command is different than the growth factor control setting. The trimesh volume gradation controls the gradation of triangles on the surface due to nearby features where small tets will exist, whereas the volume <range> tetmesh growth_factor command controls the gradation of the interior tet elements.

Figure 5a. An example of a cut-away mesh with a volume gradation, where the small size on the interior void propagates to the exterior surfaces

Figure 5a. An example of a cut-away mesh with a volume gradation, where the small size on the interior void propagates to the exterior surfaces