<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE article PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "https://jats.nlm.nih.gov/nlm-dtd/publishing/3.0/journalpublishing3.dtd">
<article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" article-type="methods-article" specific-use="SMUR" dtd-version="3.0" xml:lang="en">
<front>
<journal-meta>
<journal-id journal-id-type="publisher">EGUsphere</journal-id>
<journal-title-group>
<journal-title>EGUsphere</journal-title>
<abbrev-journal-title abbrev-type="publisher">EGUsphere</abbrev-journal-title>
<abbrev-journal-title abbrev-type="nlm-ta">EGUsphere</abbrev-journal-title>
</journal-title-group>
<issn pub-type="epub"></issn>
<publisher><publisher-name>Copernicus Publications</publisher-name>
<publisher-loc>Göttingen, Germany</publisher-loc>
</publisher>
</journal-meta>
<article-meta>
<article-id pub-id-type="doi">10.5194/egusphere-2026-4815</article-id>
<title-group>
<article-title>PyMeshIt: An open-source geological solid modeling and tetrahedral meshing engine integrated in PZero</article-title>
</title-group>
<contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Hussain</surname>
<given-names>Waqas</given-names>
<ext-link>https://orcid.org/0009-0006-6424-5009</ext-link>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
</contrib>
<contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Cacace</surname>
<given-names>Mauro</given-names>
<ext-link>https://orcid.org/0000-0001-6101-9918</ext-link>
</name>
<xref ref-type="aff" rid="aff2">
<sup>2</sup>
</xref>
</contrib>
<contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Bistacchi</surname>
<given-names>Andrea</given-names>
<ext-link>https://orcid.org/0000-0002-0139-2785</ext-link>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
</contrib>
<contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>Monti</surname>
<given-names>Riccardo</given-names>
<ext-link>https://orcid.org/0009-0008-3682-311X</ext-link>
</name>
<xref ref-type="aff" rid="aff1">
<sup>1</sup>
</xref>
</contrib>
</contrib-group><aff id="aff1">
<label>1</label>
<addr-line>Dipartimento di Scienze dell’Ambiente e della Terra, Università degli Studi di Milano-Bicocca, 20126, Italy</addr-line>
</aff>
<aff id="aff2">
<label>2</label>
<addr-line>Helmholtz Centre Potsdam (GFZ) German Research Centre for Geosciences, Telegrafenberg, 14473 Potsdam, Germany</addr-line>
</aff>
<pub-date pub-type="epub">
<day>04</day>
<month>09</month>
<year>2026</year>
</pub-date>
<volume>2026</volume>
<fpage>1</fpage>
<lpage>51</lpage>
<permissions>
<copyright-statement>Copyright: &#x000a9; 2026 Waqas Hussain et al.</copyright-statement>
<copyright-year>2026</copyright-year>
<license license-type="open-access">
<license-p>This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this licence, visit <ext-link ext-link-type="uri"  xlink:href="https://creativecommons.org/licenses/by/4.0/">https://creativecommons.org/licenses/by/4.0/</ext-link></license-p>
</license>
</permissions>
<self-uri xlink:href="https://egusphere.copernicus.org/preprints/2026/egusphere-2026-4815/">This article is available from https://egusphere.copernicus.org/preprints/2026/egusphere-2026-4815/</self-uri>
<self-uri xlink:href="https://egusphere.copernicus.org/preprints/2026/egusphere-2026-4815/egusphere-2026-4815.pdf">The full text article is available as a PDF file from https://egusphere.copernicus.org/preprints/2026/egusphere-2026-4815/egusphere-2026-4815.pdf</self-uri>
<abstract>
<p>Volumetric mesh generation from surface-based geological models is a fundamental preprocessing step for numerical simulation of subsurface processes including fluid flow, heat transport, and deformation, with applications spanning geothermal energy, groundwater modeling and management, underground facility design, slope stability and hazard modeling, carbon sequestration and hydrocarbon reservoirs. To convert a surface-based geomodel into a volumetric mesh, build a watertight Piecewise Linear Complex (PLC) of the geological model as input to boundary-conforming meshing kernels to guarantee geometry-consistent tetrahedralization. Discretization remains challenging because geological models contain internal intersecting discontinuities, concave boundaries, folded or overturned surfaces, and geological attributes such as stratigraphic and structural identifiers and boundary condition tags that must be preserved during the meshing stage.&lt;/p&gt;
&lt;p&gt;We present PyMeshIt, an open-source Python implementation and extension of the C++ MeshIt meshing engine (Cacace and Bl&amp;ouml;cher 2015), developed to generate watertight PLCs and tetrahedral meshes for complex geological models. PyMeshIt is developed to be used either as a standalone meshing software or as a modeling engine integrated into the open-source PZero geological modeling framework, a platform for 3D structural interpretation and modeling (Bistacchi et al. 2021). The internal architecture of PyMeshIt splits the meshing process into several sequential stages: geometric preprocessing, hull construction, primary surface generation and interpolation, intersection resolution into a consistent PLC, and a final constrained tetrahedralization.&lt;/p&gt;
&lt;p&gt;A central technical contribution in PyMeshIt is the preservation and recovery of facet identity through the Python- TetGen interface, enabling exact extraction of fault and boundary triangle sets from the final volumetric mesh that can be input to the later numerical simulation stages (e.g., to be used to impose boundary conditions). To define boundary objects, PyMeshIt combines adaptive alpha-shape extraction for concave but projection-compatible surfaces, a 3D angular gap method for raw folded point clouds where projection-based hull algorithms fail, and a mesh-connectivity- based boundary extraction for pre-triangulated surfaces and already triangulated surfaces imported from PZero, with respect to MeshIt. We tested PyMeshIt on multiple synthetic benchmarks and five real case studies, reporting element counts and mesh quality metrics, and compared the outcomes against the original C++ implementation of MeshIt. Results demonstrate that PyMeshIt extends the original MeshIt workflow from faulted reservoir geometries to more complex folded geological models while maintaining controllable per-surface resolution, PLC consistency, and simulation-ready geological attribution. We additionally discuss the main limitations of the current implementation when dealing with very tight folds in the raw point-cloud pathway, where k-nearest-neighbour graphs used for Isomap may create cross-limb shortcuts; for such cases, pre-triangulated PZero surfaces with topology-derived boundaries currently provide a more robust alternative.</p>
</abstract>
<counts><page-count count="51"/></counts>
</article-meta>
</front>
<body/>
<back>
</back>
</article>