Fast tools for simplex meshes.
Compute all sorts of interesting points, areas, and volumes in simplex (triangle, tetrahedral, n-simplex) meshes of any dimension, with a focus on efficiency. Useful in many contexts, e.g., finite-element and finite-volume computations.
Installation
Install meshplex from PyPI with
pip install meshplex
For full usage of meshplex, you require a license. Licenses for personal and academic use can be purchased here. For more info, see here.
Quickstart
meshplex can compute the following data:
import meshplex
# create a simple Mesh instance
# (could be tetrahedra or even higher dimensional simplices)
points = [[0.0, 0.0], [1.0, 0.0], [0.0, 1.0]]
cells = [[0, 1, 2]]
mesh = meshplex.Mesh(points, cells)
# or read it from a file
# mesh = meshplex.read("pacman.vtk")
# simplex volumes, heights
print(mesh.cell_volumes)
print(mesh.signed_cell_volumes)
print(mesh.cell_heights)
print(mesh.volume)
print(mesh.surface_area)
# centers of any kind
print(mesh.cell_circumcenters)
print(mesh.cell_centroids)
print(mesh.cell_incenters)
print(mesh.cell_monge_points)
print(mesh.cell_nagel_points)
print(mesh.cell_spieker_centers)
print(mesh.cell_lemoine_points)
print(mesh.center_of_gravity)
# circumradius, inradius, cell quality
print(mesh.cell_circumradius)
print(mesh.cell_inradius)
print(mesh.q_radius_ratio) # d * inradius / circumradius (min 0, max 1)
# control volumes, centroids
print(mesh.control_volumes)
print(mesh.control_volume_centroids)
# covolume/edge length ratios
print(mesh.ce_ratios)
# count Delaunay violations
print(mesh.num_delaunay_violations)
# get all boundary angles in radians
print(mesh.outside_boundary_angles_radians)
# removes some cells
mesh.remove_cells([0])
For triangular meshes (MeshTri), meshplex also has some mesh manipulation routines:
mesh.show() # show the mesh
mesh.angles # compute angles
mesh.flip_until_delaunay() # flips edges until the mesh is Delaunay
For a documentation of all classes and functions, see readthedocs.
(For mesh creation, check out this list).
Plotting
Triangles
import meshplex
mesh = meshplex.read("pacman.vtk")
mesh.show(
# show_coedges=True,
# control_volume_centroid_color=None,
# mesh_color="k",
# nondelaunay_edge_color=None,
# boundary_edge_color=None,
# comesh_color=(0.8, 0.8, 0.8),
show_axes=False,
)
Tetrahedra
import numpy as np
import meshplex
# Generate tetrahedron
points = np.array(
[
[1.0, 0.0, -1.0 / np.sqrt(8)],
[-0.5, +np.sqrt(3.0) / 2.0, -1.0 / np.sqrt(8)],
[-0.5, -np.sqrt(3.0) / 2.0, -1.0 / np.sqrt(8)],
[0.0, 0.0, np.sqrt(2.0) - 1.0 / np.sqrt(8)],
]
) / np.sqrt(3.0)
cells = [[0, 1, 2, 3]]
# Create mesh object
mesh = meshplex.MeshTetra(points, cells)
# Plot cell 0 with control volume boundaries
mesh.show_cell(
0,
# barycenter_rgba=(1, 0, 0, 1.0),
# circumcenter_rgba=(0.1, 0.1, 0.1, 1.0),
# circumsphere_rgba=(0, 1, 0, 1.0),
# incenter_rgba=(1, 0, 1, 1.0),
# insphere_rgba=(1, 0, 1, 1.0),
# face_circumcenter_rgba=(0, 0, 1, 1.0),
control_volume_boundaries_rgba=(1.0, 0.0, 0.0, 1.0),
line_width=3.0,
)
Release files for meshplex 0.22.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| meshplex-0.22.5-cp314-none-any.whl | CPython 3.14 | none | any | Details |
| meshplex-0.22.5-cp313-none-any.whl | CPython 3.13 | none | any | Details |
| meshplex-0.22.5-cp312-none-any.whl | CPython 3.12 | none | any | Details |
| meshplex-0.22.5-cp311-none-any.whl | CPython 3.11 | none | any | Details |
| meshplex-0.22.5-cp310-none-any.whl | CPython 3.10 | none | any | Details |
Total release size: 699.7 kB
Release files / meshplex-0.22.5-cp314-none-any.whl
| Download URL | meshplex-0.22.5-cp314-none-any.whl |
|---|---|
| Size | 163.3 kB |
| Tags | CPython 3.14 |
|
SHA-256 checksum How to use checksums |
c78d292837be29ee3fae304659790d5410d6deb64a7009e107a9b42f349e913c
|
|
BLAKE2b-256 checksum How to use checksums |
86f9962762b7bbeae4351b1beca303db7e3f6a79bf47c6b75018553052fc833e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 18, 2026.
Transparency logRelease files / meshplex-0.22.5-cp313-none-any.whl
| Download URL | meshplex-0.22.5-cp313-none-any.whl |
|---|---|
| Size | 153.9 kB |
| Tags | CPython 3.13 |
|
SHA-256 checksum How to use checksums |
68b88e2c15ffd904a2252ee740c7f9c1bd2b350721998e61499ba27ddd60baab
|
|
BLAKE2b-256 checksum How to use checksums |
6729c2ee884d465be9f23448136e3a1180ca961bc9a084c0cf4c614919e5b7dc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 18, 2026.
Transparency logRelease files / meshplex-0.22.5-cp312-none-any.whl
| Download URL | meshplex-0.22.5-cp312-none-any.whl |
|---|---|
| Size | 153.7 kB |
| Tags | CPython 3.12 |
|
SHA-256 checksum How to use checksums |
1b9fd9e79cbb4d48b23edb95a43711fdd3bf29796edfe07aab0c6ef3b2637bbc
|
|
BLAKE2b-256 checksum How to use checksums |
b98b6ee0377e773cf5c6cd41b11af80d1b463b9cb149dac077caca86fbee0a51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 18, 2026.
Transparency logRelease files / meshplex-0.22.5-cp311-none-any.whl
| Download URL | meshplex-0.22.5-cp311-none-any.whl |
|---|---|
| Size | 158.0 kB |
| Tags | CPython 3.11 |
|
SHA-256 checksum How to use checksums |
82dd7ce5f6014bb9742da254601471c9ad6aacc88224f2697a6c7081c297d0a4
|
|
BLAKE2b-256 checksum How to use checksums |
4262161cb6682992953611ae7a3cb2bbe61e4c802be416a5b05db88687840d94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 18, 2026.
Transparency logRelease files / meshplex-0.22.5-cp310-none-any.whl
| Download URL | meshplex-0.22.5-cp310-none-any.whl |
|---|---|
| Size | 70.9 kB |
| Tags | CPython 3.10 |
|
SHA-256 checksum How to use checksums |
3507df6fe0f511e3ae72d9b20dfeccff5399dce5535a939daec3f5f5bc79212b
|
|
BLAKE2b-256 checksum How to use checksums |
5040284b982e7d6b0e9c926b385e443cd5339b10a8d659a73ed76741cb50252a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 18, 2026.
Transparency log