MyMesh: General purpose, implicit, and image-based meshing in python#
Documentation Build Date: Dec 23, 2025 Version: dev
User Guide
The user guide has information on getting started with MyMesh, an overview of how to use MyMesh, and demos & examples that highlight some of the key features.
API Reference
The API reference has detailed descriptions of all objects and functions contained in the MyMesh library.
Theory Guide
The theory guide explains the details of the algorithms and code for a variety of functions in the MyMesh library.
Summary#
MyMesh is a general purpose toolbox for generating, manipulating, and analyzing
meshes. It’s particularly focused on implicit function and
image-based meshing, with other functionality including:
Mesh type conversion (e.g. volume to surface, hexahedral or mixed-element to tetrahedral),
Mesh
qualityevaluation andimprovement,Mesh
curvatureanalysis,Mesh boolean operations (intersection, union, difference).
MyMesh was originally developed in support of research within the Skeletal Mechanobiology and Biomechanics Lab at Boston University. It was used extensively in the scaffold design optimization research by Josephson and Morgan [JM24] and is currently being used in various ongoing projects, including vertebral modeling, hip fracture modeling, growth modeling of skeletal tissue, and analysis of objects imaged using micro-computed tomography (μCT). MyMesh has proven useful in a variety of research applications, well beyond those that inspired its original development, and we expect it to remain a valuable tool in future research efforts.
Statement of need#
Mesh-based representations of geometries are essential in a wide variety of research applications, and as such, there is a need for robust, efficient, and easy-to-use software for creating, analyzing, and manipulating meshes. There are a variety of software packages for working with and generating meshes. Some are general purpose, like CGAL, VTK [SML06], and Gmsh [GR09], while others are more focused on specific tasks, such as triangular or tetrahedral mesh generation (e.g. Triangle [She96] and TetGen [Si15], respectively). In Python, most meshing packages depend on (or are direct wrappers to) one or more of these libraries, such as PyVista [SK19] (a pythonic interface to VTK), MeshPy (which interfaces to Triangle and TetGen), and PyMesh (which depends on CGAL, Triangle, TetGen, and others). While these interfaces are useful and provide access to powerful mesh generation tools, their reliance on external dependencies can make them less easy to use and limit code readability, making it more difficult to understand how the code works. TriMesh stands out as a capable, pure-Python library focused on triangular surface meshes, but it isn’t intended for use with quadrilateral, mixed-element, or volumetric meshes. There is thus a need for a full-featured, accessible, and easy to use Python package for creating and working with meshes.
MyMesh strives to meet this need as a library of meshing tools, written in Python, with clear documentation that makes it both easy to use and easy to understand. MyMesh has a particular focus on implicit function and image-based meshes, but also supplies a wide variety of general purpose tools. Rather than wrapping other libraries, algorithms are implemented from scratch, often based on or inspired by published algorithms and research. By providing an easily usable interface to both high-level and low-level functionality, we hope to provide both complete solutions and a set of building blocks for the development of other mesh-related tools.
Note
MyMesh is intended for research purposes. Any uses of MyMesh should be validated and verified appropriately.
Examples#
See the gallery of examples to see some of the ways MyMesh can be used.
Acknowledgements#
This work was developed with funding support from the National Institutes of Health (Grant #AG073671). We are additionally grateful to all of the users who have tested the code, reported bugs, requested features, and provided feedback which has been vital to the development of MyMesh.
Colors used throughout this documentation are based on the Nord Theme