MeshPy offers quality triangular and tetrahedral mesh generation for Python. Meshes of this type are chiefly used in finite-element simulation codes, but also have many other applications ranging from computer graphics to robotics.
In order to generate these 2D and 3D meshes, MeshPy provides Python interfaces to two well-regarded mesh generators, Triangle by J. Shewchuk and TetGen by Hang Si. Both are included in the package in slightly modified versions.
git clone http://git.tiker.net/trees/meshpy.git
Documentation and Support
MeshPy makes scripted mesh generation as easy as never before. This simple code suffices to generate an elementary mesh of a “brick”:
from meshpy.tet import MeshInfo, build mesh_info = MeshInfo() mesh_info.set_points([ (0,0,0), (2,0,0), (2,2,0), (0,2,0), (0,0,12), (2,0,12), (2,2,12), (0,2,12), ]) mesh_info.set_facets([ [0,1,2,3], [4,5,6,7], [0,4,5,1], [1,5,6,2], [2,6,7,3], [3,7,4,0], ]) mesh = build(mesh_info) mesh.write_vtk("test.vtk")
The result of this short script is below: