IGLMeshDS

Module: meshvs

A finite element mesh data structure with geometry and group information. This class manages mesh topology, node coordinates, element connectivity, and element grouping for visualization and FEA analysis.

__init__

method
__init__(self, mesh_id: int, name: str)
Initializes the mesh data structure.

Args

Name Type Description
mesh_id Unique identifier for the mesh.
name Display name for the mesh.

SetMeshData

method
SetMeshData(self, impmesh)
Populates mesh data from an imported mesh object.

Copies node coordinates, element connectivity, element metadata,
and group information from the source mesh.

Args

Name Type Description
impmesh Source mesh object containing nodes, connectivity, element types, dimensions, triangles, edges, and group data.

GetElements

method
GetElements(self)
Returns the element connectivity array.

Returns

np.ndarray: Element connectivity with shape (M, 3) for triangular meshes.

GetNormals

method
GetNormals(self)
Returns the vertex normal vectors.

Returns

np.ndarray: Normal vectors with shape (N, 3) in float32, or None if not computed.

ComputeNormals

method
ComputeNormals(self)
Computes per-vertex normals from triangle geometry. Calculates normal vectors for each vertex by averaging cross products of edge vectors from all incident triangles. Results are normalized and stored as float32.

GetNumNodes

method
GetNumNodes(self)
Returns the number of nodes in the mesh.

Returns

int: Number of vertices, or 0 if mesh is empty.

GetProperties

method
GetProperties(self)
Returns a formatted dictionary of mesh properties and statistics.

Includes mesh summary (node/element counts), element type distribution,
bounding box coordinates, and physical group information.

Returns

dict: Properties dictionary with hierarchical string keys and string values.

GetMshGrps

method
GetMshGrps(self)
Returns the list of mesh group names.

Returns

list: Physical group identifiers from the mesh.

GetNodeIdToIdx

method
GetNodeIdToIdx(self)