MeshRepair

A grouping of various mesh repair tools.

Example

application = cf.Application.GetInstance()
project = application:NewProject()

    -- Initialise the frequency

project.Contents.SolutionConfigurations.GlobalFrequency.Start = "1e06"

    -- Create geometry and mesh

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

    -- Obtain a handle to the helix mesh

helixMesh = project.Contents.Meshes["Helix1_1"]

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

hasIntersectingMeshElements = meshRepair:RemoveDuplicates(helixMesh)

Inheritance

The MeshRepair object is derived from the Object object.

Usage locations

The MeshRepair object can be accessed from the following locations:

Property List

Label
The object label. (Read/Write string)
Type
The object type string. (Read only string)

Method List

AddTriangle (meshface MeshTriangleFace, corner1 Point, corner2 Point, corner3 Point)
Creates a triangle and adds it to the provided MeshTriangleFace.
CreateTriangle (mesh Mesh, corner1 Point, corner2 Point, corner3 Point)
Creates a triangle and adds it to a new MeshTriangleFace on the provided mesh.
Delete ()
Deletes the entity.
Duplicate ()
Duplicates the entity. (Returns a Object object.)
GetProperties ()
Returns a table of properties representing the state of the object. The properties table can be used with the SetProperties method to change multiple properties of the object in one step. (Returns a table 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 MeshTopology)
Merge the given mesh entities into a single mesh entity to ensure coincident vertices are connected. (Returns a MeshTopology 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.
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.
SetProperties (properties Object)
Modifies the state of the object using the provided table of properties. This method is used to modify multiple properties of the object in a single step.

Static Function List

GetDefaultProperties ()
Creates a table containing the default settings to create an object. (Returns a table object.)

Property Details

Label
The object label.
Type
string
Access
Read/Write
Type
The object type string.
Type
string
Access
Read only

Method Details

AddTriangle (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.
CreateTriangle (mesh Mesh, corner1 Point, corner2 Point, corner3 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.
corner3(Point)
One of the triangle's three corners.
Delete ()
Deletes the entity.
Duplicate ()
Duplicates the entity.
Return
Object
The new (duplicated) entity.
GetProperties ()
Returns a table of properties representing the state of the object. The properties table can be used with the SetProperties method to change multiple properties of the object in one step.
Return
table
A table defining the properties.
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 MeshTopology)
Merge the given mesh entities into a single mesh entity to ensure coincident vertices are connected.
Input Parameters
meshentitylist(List of MeshTopology)
The table containing the meshes entities to merge.
Return
MeshTopology
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.
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.
SetProperties (properties Object)
Modifies the state of the object using the provided table of properties. This method is used to modify multiple properties of the object in a single step.
Input Parameters
properties(Object)
A table of properties defining the new state of the object.

Static Function Details

GetDefaultProperties ()
Creates a table containing the default settings to create an object.
Return
table
A table containing the default properties.