mymesh.converter#

Mesh conversion tools

Mesh type conversion#

solid2surface(NodeCoords, NodeConn[, ...])

Extract the 2D surface elements from a 3D volume mesh

im2voxel(img, voxelsize[, scalefactor, ...])

Convert 3D image data to a cubic mesh.

voxel2im(VoxelCoords, VoxelConn, Vals)

Convert a rectilinear voxel mesh (grid) to an 3D image matrix.

surf2voxel(SurfCoords, SurfConn, h[, ...])

Convert a surface mesh to a filled voxel mesh.

surf2dual(NodeCoords, SurfConn[, Centroids, ...])

Convert a surface mesh to it's dual mesh.

Connectivity conversion#

solid2faces(NodeCoords, NodeConn[, ...])

Convert solid mesh to faces.

solid2edges(NodeCoords, NodeConn[, ...])

Convert a solid mesh to edges.

surf2edges(NodeCoords, NodeConn[, ElemType])

Extract the edges of an unclosed surface mesh.

EdgesByElement(NodeCoords, NodeConn[, ElemType])

Returns edges grouped by the element from which they came.

faces2surface(Faces[, return_ids])

Identify surface elements, i.e. faces that aren't shared between two elements.

faces2unique(Faces[, return_idx, return_inv])

Reduce set of mesh faces to contain only unique faces, i.e. there will only be one entry to indicate a face shared between two elements.

edges2unique(Edges[, return_idx, ...])

Reduce set of mesh edges to contain only unique edges, i.e. there will only be one entry to indicate a edge shared between multiple elements.

tet2faces(NodeCoords, NodeConn)

Extract triangular faces from all elements of a purely 4-Node tetrahedral mesh.

hex2faces(NodeCoords, NodeConn)

Extract quadrilateral faces from all elements of a purely 8-Node hexahedral mesh.

pyramid2faces(NodeCoords, NodeConn)

Extract triangular and quadrilateral faces from all elements of a purely 5-Node pyramidal mesh.

wedge2faces(NodeCoords, NodeConn)

Extract triangular and quadrilateral faces from all elements of a purely 6-Node wedge elemet mesh.

tri2edges(NodeCoords, NodeConn)

Extract edges from all elements of a purely 3-Node triangular mesh.

quad2edges(NodeCoords, NodeConn)

Extract edges from all elements of a purely 4-Node quadrilateral mesh.

polygon2edges(NodeCoords, NodeConn)

Extract edges from all elements of a polygonal mesh.

tet2edges(NodeCoords, NodeConn)

Extract edges from all elements of a purely 4-Node tetrahedral mesh.

pyramid2edges(NodeCoords, NodeConn)

Extract edges from all elements of a purely 5-Node pyramidal mesh.

wedge2edges(NodeCoords, NodeConn)

Extract edges from all elements of a purely 6-Node wedge element mesh.

hex2edges(NodeCoords, NodeConn)

Extract edges from all elements of a purely 8-Node hexahedral mesh.

Element type conversion#

solid2tets(NodeCoords, NodeConn[, ...])

Decompose all elements of a 3D volume mesh to tetrahedra.

hex2tet(NodeCoords, NodeConn[, method])

Decompose all elements of a 3D hexahedral mesh to tetrahedra.

wedge2tet(NodeCoords, NodeConn[, method])

Decompose all elements of a 3D wedge-element mesh to tetrahedra.

pyramid2tet(NodeCoords, NodeConn[, method])

Decompose all elements of a 3D pyramidal mesh to tetrahedra.

surf2tris(NodeCoords, NodeConn[, ...])

Decompose all elements of a surface mesh to triangles.

quad2tri(NodeCoords, NodeConn)

Converts a quadrilateral mesh to a triangular mesh by splitting each quad into 2 tris

tet102tet4(NodeCoords, Tet10NodeConn)

Converts a 10-node tetradehdral mesh to a 4-node tetradehedral mesh.

tet42tet10(NodeCoords, Tet4NodeConn)

Converts a 4 node tetrahedral mesh to 10 node tetrahedral mesh.

hexsubdivide(NodeCoords, NodeConn)

Subdivide hexahedra into 8 sub-hexahedra, connecting corners to the element, face, and edge centroids.