MeshTriangles

The list of mesh triangles.

Example

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

	-- Set the frequency
	
project.SolutionConfigurations[1].Frequency.Start = "1e06"

    -- Create geometry and mesh

project.Geometry:AddSphere(cf.Point(0,0,0),1.0)
project.Mesher:Mesh()
project.Geometry["Sphere1"]:UnlinkMesh()

meshTriangleFaces = project.Meshes["Sphere1_1"].TriangleFaces

for i in ipairs(meshTriangleFaces) do    
    meshTriangleFace = meshTriangleFaces[i]    
    
    -- Obtain a handle to 'MeshTriangles'
    
    meshTriangles = meshTriangleFace.Triangles   
    
    -- Store the number of mesh triangles
    
    meshTrianglesCount = meshTriangles.Count
end

Usage locations (object properties)

The following objects have properties using the MeshTriangles object:

Property List

Count
The number of triangles in the mesh entity. (Read only number)
Type
The object type string. (Read only string)

Method List

ClosestVertexTo (point Point)
Gets the closest vertex, of the mesh element to the given point. (Returns a MeshVertex object.)

Index List

[number]
Returns the Triangle at the given index. (Read MeshTriangle)

Property Details

Count
The number of triangles in the mesh entity.
Type
number
Access
Read only
Type
The object type string.
Type
string
Access
Read only

Method Details

ClosestVertexTo (point Point)
Gets the closest vertex, of the mesh element to the given point.
Input Parameters
point(Point)
The point to query against.
Return
MeshVertex
The closest vertex of the element to the point.