MeshRepair

A grouping of various mesh repair tools.

Example

app = cf.GetApplication()
project = app:NewProject()

    -- Settings for normal meshing

project.Mesher.Settings.WireRadius = "0.01"

project.SolutionConfigurations[1].Frequency.Start = "1e08"

    -- Create geometry and mesh

project.Geometry:AddHelix(cf.Point(0,0,0), 0.1, 0.1, 1.0, 5.0, false)
project.Mesher:Mesh()
project.Geometry["Helix1"]:UnlinkMesh()

    -- Obtain a handle to the helix mesh

helixMesh = project.Meshes["Helix1_1"]

    -- Obtain the 'MeshRepair' object
    
meshRepair = project.Meshes.Repair

hasIntersectingMeshElements = meshRepair:RemoveDuplicates(helixMesh)

Usage locations (object properties)

The following objects have properties using the MeshRepair object:

Property List

Type
The object type string. (Read only string)

Method List

CreateTriangle (meshface MeshTriangleFace, corner1 Point, corner2 Point, corner3 Point)
Creates a triangle and adds it to the provided MeshTriangleFace. (Returns a MeshTriangle object.)
CreateTriangle (mesh Mesh, corner1 Point, corner2 Point, corner2 Point)
Creates a triangle and adds it to a new MeshTriangleFace on the provided mesh. (Returns a MeshTriangle object.)
FindOverlappingEntities (mesh Mesh)
Find a list of overlapping MeshEntities (e.g. MeshTriangleFace) in the mesh. Useful to help derive input to RemoveDuplicatesWithOrder. (Returns a List of MeshEntity object.)
Merge (meshlist List of Mesh)
Merge meshes into a single mesh part to ensure coincident vertices are connected. (Returns a Mesh object.)
Merge (meshentitylist List of MeshEntity)
Merge the given mesh entities into a single mesh entity to ensure coincident vertices are connected. (Returns a MeshEntity object.)
MergeVertices (mesh Mesh, tolerance number, snaptogeometrypoints boolean, snaptonamedpoints boolean)
Find and merge vertices in the given mesh that are within a tolerance of each other.
MergeVertices (verticestomerge List of MeshVertex, vertextomergewith MeshVertex)
Merge the list of vertices with the given vertex.
Regroup (elementstogroup List of MeshTriangle)
Groups the given triangle mesh elements into a new mesh label, removing them from their original labels. (Returns a MeshEntity object.)
Regroup (elementstogroup List of MeshCurvilinearTriangle)
Groups the given curvilinear triangle mesh elements into a new mesh label, removing them from their original labels. (Returns a MeshEntity object.)
Regroup (elementstogroup List of MeshSegment)
Groups the given wire segment mesh elements into a new mesh label, removing them from their original labels. (Returns a MeshEntity object.)
Regroup (elementstogroup List of MeshCurvilinearSegment)
Groups the given curvilinear wire segment mesh elements into a new mesh label, removing them from their original labels. (Returns a MeshEntity object.)
Regroup (elementstogroup List of MeshPolygon)
Groups the given UTD plate mesh elements into a new mesh label, removing them from their original labels. (Returns a MeshEntity object.)
RemoveCollapsed (mesh Mesh)
Find and remove collapsed elements (e.g. triangles) in a mesh.
RemoveDuplicates (mesh Mesh)
Find and remove duplicate elements (e.g. triangles) in a mesh.
RemoveDuplicatesWithOrder (mesh Mesh, meshentitylist List of MeshEntity)
Find and remove duplicate elements (e.g. triangles) in a mesh. Elements closer to the start of the list are preserved. FindOverlappingEntities may be used to derive input for this function.

Property Details

Type
The object type string.
Type
string
Access
Read only

Method Details

CreateTriangle (meshface MeshTriangleFace, corner1 Point, corner2 Point, corner3 Point)
Creates a triangle and adds it to the provided MeshTriangleFace.
Input Parameters
meshface(MeshTriangleFace)
The mesh face to which the triangle should be added.
corner1(Point)
One of the triangle's three corners.
corner2(Point)
One of the triangle's three corners.
corner3(Point)
One of the triangle's three corners.
Return
MeshTriangle
The created triangle.
CreateTriangle (mesh Mesh, corner1 Point, corner2 Point, corner2 Point)
Creates a triangle and adds it to a new MeshTriangleFace on the provided mesh.
Input Parameters
mesh(Mesh)
The mesh to which the triangle should be added.
corner1(Point)
One of the triangle's three corners.
corner2(Point)
One of the triangle's three corners.
corner2(Point)
One of the triangle's three corners.
Return
MeshTriangle
The created triangle.
FindOverlappingEntities (mesh Mesh)
Find a list of overlapping MeshEntities (e.g. MeshTriangleFace) in the mesh. Useful to help derive input to RemoveDuplicatesWithOrder.
Input Parameters
mesh(Mesh)
The mesh to find overlapping MeshEntities in.
Return
List of MeshEntity
The list of MeshEntities that contain overlapping elements (e.g. triangles).
Merge (meshlist List of Mesh)
Merge meshes into a single mesh part to ensure coincident vertices are connected.
Input Parameters
meshlist(List of Mesh)
The table containing the Meshes to merge.
Return
Mesh
The merged mesh.
Merge (meshentitylist List of MeshEntity)
Merge the given mesh entities into a single mesh entity to ensure coincident vertices are connected.
Input Parameters
meshentitylist(List of MeshEntity)
The table containing the meshes entities to merge.
Return
MeshEntity
The merged mesh entity.
MergeVertices (mesh Mesh, tolerance number, snaptogeometrypoints boolean, snaptonamedpoints boolean)
Find and merge vertices in the given mesh that are within a tolerance of each other.
Input Parameters
mesh(Mesh)
The mesh to merge vertices in.
tolerance(number)
Vertices closer than the tolerance distance will be merged.
snaptogeometrypoints(boolean)
If true vertices within the tolerance distance of geometry points will be snapped to them and possibly merged.
snaptonamedpoints(boolean)
If true vertices within the tolerance distance of named points will be snapped to them and possibly merged.
MergeVertices (verticestomerge List of MeshVertex, vertextomergewith MeshVertex)
Merge the list of vertices with the given vertex.
Input Parameters
verticestomerge(List of MeshVertex)
The list of vertices to merge away (deleted).
vertextomergewith(MeshVertex)
The vertex to merge with.
Regroup (elementstogroup List of MeshTriangle)
Groups the given triangle mesh elements into a new mesh label, removing them from their original labels.
Input Parameters
elementstogroup(List of MeshTriangle)
The list of triangle elements to group (which must all belong to the same mesh part).
Return
MeshEntity
The new mesh label containing the grouped elements.
Regroup (elementstogroup List of MeshCurvilinearTriangle)
Groups the given curvilinear triangle mesh elements into a new mesh label, removing them from their original labels.
Input Parameters
elementstogroup(List of MeshCurvilinearTriangle)
The list of curvilinear triangle mesh elements to group (which must all belong to the same mesh part).
Return
MeshEntity
The new mesh label containing the grouped elements.
Regroup (elementstogroup List of MeshSegment)
Groups the given wire segment mesh elements into a new mesh label, removing them from their original labels.
Input Parameters
elementstogroup(List of MeshSegment)
The list of wire segment elements to group (which must all belong to the same mesh part).
Return
MeshEntity
The new mesh label containing the grouped elements.
Regroup (elementstogroup List of MeshCurvilinearSegment)
Groups the given curvilinear wire segment mesh elements into a new mesh label, removing them from their original labels.
Input Parameters
elementstogroup(List of MeshCurvilinearSegment)
The list of curvilinear wire segment elements to group (which must all belong to the same mesh part).
Return
MeshEntity
The new mesh label containing the grouped elements.
Regroup (elementstogroup List of MeshPolygon)
Groups the given UTD plate mesh elements into a new mesh label, removing them from their original labels.
Input Parameters
elementstogroup(List of MeshPolygon)
The list of UTD plate mesh elements to group (which must all belong to the same mesh part).
Return
MeshEntity
The new mesh label containing the grouped elements.
RemoveCollapsed (mesh Mesh)
Find and remove collapsed elements (e.g. triangles) in a mesh.
Input Parameters
mesh(Mesh)
The mesh to remove collapsed elements from.
RemoveDuplicates (mesh Mesh)
Find and remove duplicate elements (e.g. triangles) in a mesh.
Input Parameters
mesh(Mesh)
The mesh to remove duplicate triangles from.
RemoveDuplicatesWithOrder (mesh Mesh, meshentitylist List of MeshEntity)
Find and remove duplicate elements (e.g. triangles) in a mesh. Elements closer to the start of the list are preserved. FindOverlappingEntities may be used to derive input for this function.
Input Parameters
mesh(Mesh)
The mesh to remove duplicate triangles from.
meshentitylist(List of MeshEntity)
An table containing MeshEntities. If elements are duplicated across different MeshEntities, elements belonging to MeshEntities closer to the start of the list will be preserved. Use FindOverlappingEntities() to determine valid MeshEntities for this ordered list.