- 1Università degli Studi di Milano-Bicocca - Bicocca, DISAT, Milano, Italy (waqas.hussain@unimib.it)
- 2GFZ Helmholtz Centre for Geosciences, Potsdam, Germany (mauro.cacace@gfz.de)
Three-dimensional geological models can be used to simply return a visual representation of complex subsurface structures; however, when they are used to define the geometry and properties of bodies used in downstream numerical simulations (e.g., geothermal, geomechanical, and/or fluid flow simulations), their application is limited by the difficulty in generating computational meshes that preserve the geological topology. In particular, intersecting faults, unconformities, and stratigraphic contacts present challenges because numerical simulations require watertight models, with consistently defined surface intersections that do not pose any ambiguity whatsoever regarding the attribution of a certain 3D region to a given closed volume. As such, to generate watertight models and meshes is the critical step that quite often hinders practical downstream applications of geological models.
We present PyMeshIt (https://github.com/waqashussain117/PyMeshit), a pure-Python open-source modelling engine that addresses this bottleneck by automating the generation of conforming tetrahedral meshes from complex geological interpretations. PyMeshIt is available both as a standalone application and as an integrated meshing engine within the PZero geological modelling platform (https://github.com/gecos-lab/PZero), supporting a wide range of geomodelling workflows without imposing assumptions on downstream simulations.
PyMeshIt implements an interactive multistage workflow that supports point clouds, triangulated surfaces, well trajectories, and model boundaries. The central focus of the software is the explicit preservation of geological/topological relationships during meshing. Surface-surface and polyline-surface intersections are computed automatically, producing intersection polylines that trace fault cutoffs, unconformity truncations, and formation contacts. Locations where three or more geological features converge are identified as triple points and are retained as topological constraints. These intersections and junctions are used as constraints during surface reconstruction and volumetric meshing to ensure that element faces align with the geological boundaries in the final mesh.
Material regions are assigned through interactive seed-point placement, allowing tetrahedral volumes to be consistently attributed to geological units. The output formats include VTK/VTU for visualisation, STL for CAD applications, and EXODUS II for numerical modelling frameworks. When used within PZero, PyMeshIt directly accesses the geological model entities without intermediate file conversion, preserving pre-triangulated geometries and allowing the possibility of creating geological interpretations within a single framework, thereby ensuring a complete open-source workflow from geological interpretation and modelling to meshing.
How to cite: Hussain, W., Cacace, M., Bistacchi, A., and Monti, R.: PyMeshIt: An Open-Source Python modelling engine in PZERO and a standalone software for Conforming Tetrahedral Mesh Generation, EGU General Assembly 2026, Vienna, Austria, 3–8 May 2026, EGU26-16992, https://doi.org/10.5194/egusphere-egu26-16992, 2026.