Cleaning a Mesh

This task will show you how to clean a mesh.

Imported STL files or generated meshes may present some irregularities such as:

  • Corrupted triangles, i.e. triangles that have the same vertex twice,
  • Duplicated triangles, i.e. triangles that share the same three vertices,
  • Inconsistent Orientation, i.e. triangles that can not be oriented consistently with respect to each other,
  • Non-manifold edges, i.e. edges shared by more than two triangles,
  • Non-manifold vertices, i.e. vertices shared by two or more connected shells.

A mesh may also present some structural problems such as:

  • Orientation problems, i.e. all the triangles are not oriented in the same direction,
  • Isolated triangles, i.e. triangles belonging to small connected areas of the mesh,
  • Disconnected zones, i.e. the mesh is made of several disconnected zones,
  • Triangles with long edges.
  • Thin triangles.

Mesh cleaner proposes two families of treatments on such meshes:

  • Deletion, i.e. visualization and deletion of corrupted or duplicated triangles,
    of triangles with an inconsistent orientation, of non-manifold edges, or non-manifold vertices,
    of isolated triangles and triangles with long edges.
  • Structure, i.e. re-orientation or split.
  • Edition, e.g. collapsing thin triangles.
You can process simultaneously several types of problems in the Deletion tab.
Structure problems must be processed separately.
Open MeshCleaner1.CATPart from the samples directory for Deletion and Structure.
Open MeshCleaner2.CATPart from the samples directory for Edition.

Deletion

  1. Click Mesh Cleaner and select the mesh.
    The dialog box is displayed.

  2. In the Deletion tab, click Analyze.

    Once the analysis is completed, the lines corresponding to the problems found become active.
    The Statistics column is updated with the number of cases found.
    Here, only non-manifold vertices have been found, and there are 5 such vertices.

  3. You can visualize the problems found:

    Select the check boxes of the problems you want to visualize. By default, they are displayed in white.
    You can choose another color from the Preview colors list.
  4. For Isolated Triangles, use the slider to define the maximum number of triangles that a disconnected area may contain.
    If you set the slider to n, all the areas containing between 1 and n triangles will be visualized, then deleted.
    The limit values of the slider are defined according to the mesh.

  5. For Long Edges, use the spinner to define the maximum allowed length edge of triangles.
    All triangles with edges longer than this value will be deleted.

  6. Select the Small Angles check box and enter 8 deg as the value to be considered as small angle.
    The triangles with an angle equal to 8 deg or lower are displayed.

  7. Click Apply to delete the unwanted elements and OK to exit the action and save the processed part.

 

Structure

  1. Click Mesh Cleaner and select the mesh.
    The dialog box is displayed.

  2. In the Structure tab, select the Orientation check box.
    The triangles are displayed as direct or indirect, in the color of your choice.
    Those that are candidates for a re-orientation are shown by an arrow:

    Click the arrow of the triangles you want to re-orient.
    The color and the direction of the arrow change:

    Click Apply. The triangles are  re-oriented, if that is possible.

    Note that a contextual menu is provided on each arrow:

    Invert This:
    Inverts the orientation of the area linked to the arrow.
    Equivalent to clicking the arrow.

    All Connected as This:
    Applies the same orientation to all the areas connected to that linked to the arrow.

    Invert All Connected:
    Inverts the orientation of the area connected to the arrow, and of all the areas connected to it.

    Invert All Zones:
    Inverts the orientation of all the mesh areas.

  3. Select the Split in Connected Zones check box.
    If there is only one zone, split is not possible and the check box cannot be selected.
    If connected zones are found, the text box below is updated with the number of connected zones found.
    Choose to split them in Distinct zones or in one Grouped  zone.
    Click Apply. SubMesh.x elements are then created in the specification tree.

  4. Click OK to save the processed part and exit the action.

Edition

  1. Click Mesh Cleaner and select the mesh.
    The dialog box is displayed.

  2. Go to the Edition tab.
    Select the
    Small Angles check box and enter 8 deg as the value to be considered as small angle.
    The triangles with an angle equal to 8 deg or lower are displayed.

    Change the value to 6deg. Fewer triangles correspond to that criterion.

  3. Click Apply, those triangles are collapsed. If you re-enter 8deg, only triangles with angles between 6deg and 8deg are highlighted.
    Click OK to validate and exit the dialog box.

 Below are some examples of how triangles are collapsed:
Input Output