mmgpy¶
Python bindings for the MMG remeshing library.
Features¶
| 3D Volume Meshing | Tetrahedral remeshing |
| 2D Meshing | Triangular remeshing for planar domains |
| Surface Meshing | 3D surface remeshing and optimization |
| Local Sizing | Sphere, box, cylinder, and point-based refinement |
| Anisotropic Metrics | Custom metric tensors for directional adaptation |
| Level-Set | Extract isosurfaces from implicit functions |
| Lagrangian Motion | Remesh while preserving displacement fields |
| PyVista Integration | Seamless conversion for visualization |
| 40+ File Formats | VTK, STL, OBJ, GMSH, and more via meshio |
Quick Start¶
import mmgpy
# Load a mesh from any supported format
mesh = mmgpy.read("input.mesh")
# Remesh with target edge size
result = mesh.remesh(hmax=0.1)
print(f"Quality: {result.quality_mean_before:.2f} → {result.quality_mean_after:.2f}")
# Save the result
mesh.save("output.vtk")
Installation¶
Gallery¶
Surface remeshing of a mechanical part
Smooth surface mesh optimization
3D volumetric mesh quality improvement
Learn More¶
- Quick Start — Get started in 5 minutes
- Tutorials — Step-by-step guides
- API Reference — Complete documentation
- Examples — Real-world use cases