mymesh.utils#
Various mesh utilities
Mesh Connectivity#
|
Determines the adjacent nodes for each node in the mesh |
|
Determines the elements connected to each node in the mesh |
|
Gives the connected nodes in an n ring neighborhood for each node in the mesh |
|
Gives the connected nodes in a neighborhood with a specified radius for each node in the mesh. |
|
Get list of neighboring elements for each element in the mesh. |
|
Identifies groups of connected nodes. |
|
Identifies groups of connected nodes. |
Mesh Measurements#
|
Calculate element centroids. |
|
Calculates normal vectors on the faces of a triangular surface mesh. |
|
Calculate node normal vectors based on the element face normals. |
|
Classifies nodes as edges or corners if the angle between adjacent surface elements is less than or equal to angle. |
|
Calculates the volume contained within a surface mesh. |
|
Calculates the volume contained within a tetrahedral mesh |
|
Calculate the minimum volume bounding box of the set of points |
|
Calculate the axis-aligned bounding box of a set of points |
Mesh Manipulations#
|
Creates a mirrored copy of a mesh by mirroring about the planes defined by X=x, Y=y, and Z=z |
|
Merge two meshes together |
|
For a given voxel mesh, will generate a layer of voxels that wrap around the current voxel mesh. |
|
Removes the specified number of layers from a hexahedral mesh |
|
Generate a set of pyramid elements that cover the surface of the voxel mesh. |
Surface Projection#
|
Maps nodal values one surface to another. |
|
Generate a mapping matrix from to map data from one surface to another using barycentric interpolation. |
|
Projects a node along its normal vector onto a surface. |
|
Returns the bary centric coordinates of a point (Pt) relative to a triangle (Nodes) |
|
Returns the barycentric coordinates of a point or points relative to a triangle. |
|
Returns the bary centric coordinates of a point (Pt) relative to a tetrahedron (Nodes) |
Mesh Clean Up#
|
Remove nodes that are duplicated in the mesh, either at exactly the same location as another node or a distance < tol apart. |
|
Deletes degenerate elements from a mesh. |
|
Checks for elements with degenerate edges and either changes the element type or removes the element depending on how degenerate it is. |
|
Relabel the nodes in the mesh according to the newIds list |
Miscellaneous#
|
Sorted a ragged list of lists by the length of each sublist |
|
Split a ragged list of lists into a list of array_like groupings of the original list in which all rows are equal length. |
|
Pads a 2d list of lists with variable length into a rectangular numpy array with specified fill value. |
|
Convert a padded numpy array to a ragged list of list by removing entries that match the specified value. |
|
Classify the mesh as either a surface or volume. A mesh is classified as a volume mesh ( |