MyMesh: General purpose, implicit, and image-based meshing in python#

Documentation Build Date: Feb 20, 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:

MyMesh was originally developed in support of the Ph.D. research of Tim Josephson in Elise Morgan’s Skeletal Mechanobiology and Biomechanics Lab at Boston University. MyMesh was used extensively in the scaffold design optimization research by Josephson and Morgan [JM24] and is currently being used in various ongoing projects at Boston University, including vertebral modeling (Andre Gutierrez Marty, Neilesh Frings), hip fracture modeling (Joshua Auger, Ariella Blake), mechanobiologically-driven growth modeling of skeletal tissue (Tim Josephson, Vivian Shi), and analysis of micro CT-scanned teeth (Sydney Holder, Shadi Mohebi).

Statement of need#

There are a variety of software packages for working with and generating meshes. Some are general purpose, like CGAL, VTK, and gmsh, and others are more focused and do specific tasks very well, such as triangular (Triangle [She96]) or tetrahedral (TetGen [Si15]) mesh generation. In Python, most meshing packages depend on (or are direct wrappers to) one or more of these libraries, such as PyVista (a pythonic interface to VTK), PyMesh (which depends on CGAL, Triangle, TetGen, and others), and MeshPy (which interfaces to Triangle and TetGen). While these interfaces are useful and provide access to powerful mesh generation tools, their reliance on external, compiled dependencies limits code readability and makes it difficult to build upon and extend the algorithms. A notable exception is TriMesh, a pure-python library focused on triangular surfaces meshes.

MyMesh strives to be a comprehensive 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 meshing tools. Rather than wrapping other libraries, algorithms are implemented from scratch, either directly based on or loosely inspired by published algorithms and research.

As we aim to contribute to the existing community of meshing software, MyMesh was designed to allow for easy extraction of key mesh information that can be passed to other libraries’ data structures in python or written to various file types using meshio.

Note

MyMesh is intended for research purposes. Any applications of MyMesh should be should be validated and verified appropriately.

Acknowledgements#

MyMesh was initially developed to further the aims of research funded by the National Institutes of Health (Grant #AG073671).

Colors used throughout this documentation are based on the Nord Theme