10.148. Verify Triangle Winding

Group (Subgroup)

Surface Meshing (Connectivity/Arrangement)

Description

WARNING: If your mesh contains multiple disconnected objects, you should run Label CAD Geometry beforehand and convert the output (region ids) into face labels. The recommended procedure is described below in Multi-Object Meshes.

This filter attempts to repair the winding of a mesh so that it is consistent across the surface. The winding is the order in which a triangle’s three vertices are listed; that order determines which way the triangle’s normal points (the triangle’s “front” versus “back” face). Consistent winding means every triangle of a closed surface has its normal pointing the same way relative to the enclosed volume. Achieving fully consistent winding may not be possible because of how meshes are stored in the software.

Key Nuances

While this filter modifies nothing more than the Shared Faces List, it has wider downstream implications for the mesh, so it is recommended to run it as close to the start of the pipeline as possible. This avoids recalculating extensive amounts of face data later. This is especially important for Multi-Object Meshes, which have additional prerequisites.

The meshes treat both sides of each triangle as valid. The upside is that less space is needed to store meshes, but it means giving every feature the proper winding is impossible. The order of execution is based on feature label numbering, so randomizing that order may lead to more visual distinction.

This filter requires that vertices are unique; well-formed meshes should not have an issue with this. The filter checks this at runtime and returns an error if duplicates are found. If this happens, run Identify Duplicate Vertices followed by Remove Flagged Vertices prior to this filter.

This filter offers recalculating triangle normals as an option; this is a convenience that simply calls Compute Triangle Normals at the end.

Both Create Surface Mesh (Surface Nets) and Create Surface Mesh (QuickMesh) (the only synthetic mesh generators currently available) already apply this algorithm at the end of their execution. This filter is therefore redundant when run on meshes generated by the software’s integrated algorithms.

This filter determines candidates for winding reversal feature by feature, based on the volume of each feature. A feature whose triangle windings are “inside-out” computes a negative volume (the signed volume comes out negative because the surface normals point inward instead of outward). It is possible to input a mesh containing a feature with negative volume that is left untouched during winding repair but then gets all of its windings reversed as a result. To our knowledge there is no case where such a feature would not already be “inside-out” prior to execution. Essentially, this filter will additionally perform winding reversal for you when the mesh contains invalid (inside-out) features.

Multi-Object Meshes

If your mesh has more than one disconnected object, run Label CAD Geometry beforehand. This can be confusing because the output of that filter is a region ids array, not a face labels array. To convert the output to face labels, merge that array with an array of zeros (created with Create Data Array) using Combine Attribute Arrays. The order is not strictly enforced, but the internal convention is to place the zeros array above the region ids array (Option A below). The difference in output is as follows:

Option A:

  • Zeros array first

  • Region Ids array second

{{0,1}, {0,1}, {0,1}, ...}

OR

Option B:

  • Region Ids array first

  • Zeros array second

{{1,0}, {1,0}, {1,0}, ...}

The output of this combination becomes the face labels for the mesh.

The pipeline for multi-object meshes should look something like this:

  1. Identify Duplicate Vertices (optional)

  2. Remove Flagged Vertices (optional)

  3. Label CAD Geometry

  4. Create Data Array (fill with 0’s)

  5. Combine Attribute Arrays (make face labels [Zeros Array + Region Ids])

  6. Verify Triangle Winding

Required Input Sources

Input Face Data

Parameter Name

Parameter Type

Parameter Notes

Description

Face labels or Region Ids Array

Array Selection

Allowed Types: int32

The path to the face labels or region ids array, MUST reside in target surface mesh (Triangle Geom)

Optional

Parameter Name

Parameter Type

Parameter Notes

Description

Repair Triangle Normals

Bool

If enabled, the triangle normals will be recomputed if the triangle normals exist

Triangle Normals Array

Array Selection

Allowed Types: float64 Comp. Shape: 3

The path to the triangle normals array

DREAM3D-NX Help

If you need help, need to file a bug report or want to request a new feature, please head over to the DREAM3DNX-Issues GitHub site where the community of DREAM3D-NX users can help answer your questions.