pymeshfix
Repair triangular meshes using MeshFix
What it is and what it does
PyMeshFix is a Python wrapper around Marco Attene's MeshFix C++ library, designed to repair polygon meshes by correcting defects common in raw digitized 3D models. It removes self-intersections, degenerate elements, singularities, and fills holes to produce a single watertight triangle mesh representing a closed solid object. The package offers both low-level Cython access to the underlying algorithm and a higher-level object interface that optionally integrates with pyvista for visualization and mesh I/O.
The library is intended for mesh repair workflows in 3D scanning, digitization, and geometry processing. Input is expected to represent a single closed solid; regions without defects are left unmodified. It trades off generality for robustness on its target use case—the documentation notes it may fail or produce coarse results on other mesh types like tessellated CAD models.
Use it for:
- Clean and repair raw 3D scans from digitization hardware before downstream processing or analysis.
- Remove self-intersections and degenerate elements from polygon meshes in batch geometry pipelines.
- Convert imperfect digitized mesh models into watertight solids for 3D printing or CAD workflows.
- Preprocess mesh data in scientific computing or computational geometry applications.
- Fill holes and repair topology in mesh datasets before feeding them to simulation or rendering engines.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
PyMeshFix repairs triangular meshes by removing defects like self-intersections, degenerate elements, and singularities, producing watertight output meshes from digitized 3D models.
Yes, if your workflow involves repairing raw digitized meshes. The package is actively maintained, has no known vulnerabilities, and offers pre-built wheels for modern Python versions on all major platforms. AGPL licensing is a hard constraint for commercial use—you must either use it only in open-source projects or negotiate a separate commercial license with the copyright holders. For non-commercial research or open-source 3D geometry work, it is a solid, well-integrated choice.
Install
pymeshfix on PyPI
pip
pip install pymeshfixuv
uv add pymeshfixpoetry
poetry add pymeshfixInstalling pymeshfix
Before you install
Medium install friction due to compiled C++ bindings; wheels are pre-built for Python 3.10–3.14 on macOS (Intel and ARM), Linux (x86_64 and aarch64), and Windows, so most users will have a straightforward pip install. Repository is active with recent commits.
License in practice
Licensed under AGPL v3, which requires derivative works and modifications to be released under the same license if distributed. Commercial use requires a separate licensing agreement with the copyright holders (IMATI-GE / CNR).
Quickstart
pip install pymeshfix
import pymeshfix
import numpy as np
# Repair mesh from vertex and face arrays
vclean, fclean = pymeshfix.clean_from_arrays(v, f)
Requires numpy; optional pyvista dependency for plotting and advanced mesh operations.
Verify before relying
- Whether the package handles non-digitized meshes (e.g., tessellated CAD models) reliably, given the stated design focus on raw digitized models.
- Performance characteristics and typical runtime for meshes of varying complexity or size.
Package facts
| License | not declared (agpl) |
| Python support | supports the current Python release (<3.15,>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | actively maintained — 113 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 181,268/month — #10,129 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pymeshfix-0.18.1-cp310-cp310-macosx_10_13_x86_64.whl; pymeshfix-0.18.1-cp310-cp310-macosx_11_0_arm64.whl; pymeshfix-0.18.1-cp310-cp310-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pymeshfix-0.18.1-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pymeshfix-0.18.1-cp310-cp310-win_amd64.whl; pymeshfix-0.18.1-cp311-cp311-macosx_10_13_x86_64.whl; pymeshfix-0.18.1-cp311-cp311-macosx_11_0_arm64.whl; pymeshfix-0.18.1-cp311-cp311-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pymeshfix-0.18.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pymeshfix-0.18.1-cp311-cp311-win_amd64.whl; pymeshfix-0.18.1-cp312-abi3-macosx_10_13_x86_64.whl; pymeshfix-0.18.1-cp312-abi3-macosx_11_0_arm64.whl; pymeshfix-0.18.1-cp312-abi3-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl; pymeshfix-0.18.1-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pymeshfix-0.18.1-cp312-abi3-win_amd64.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
fast-simplificationSimplifies 3D meshes by reducing the number of…
permissive · top 15,000 on PyPI
manifold3dManifold3d creates and operates on manifold…
permissive · top 5,000 on PyPI
trimeshTrimesh loads, manipulates, and analyzes…
permissive · top 5,000 on PyPI
pymeshlabPyMeshLab provides Python bindings to MeshLab,…
copyleft · top 15,000 on PyPI
cytriangleCyTriangle wraps Jonathan Shewchuk's Triangle…
copyleft · top 15,000 on PyPI
vhacdxComputes approximate convex decomposition of…
unclear · top 5,000 on PyPI
pytetwildpytetwild converts surface meshes into…
copyleft · top 15,000 on PyPI
tetgentetgen wraps the TetGen C++ library to generate…
permissive · top 15,000 on PyPI
pysplashsurfpySplashsurf provides Python bindings for…
permissive · top 15,000 on PyPI
meshioplusplusmeshioplusplus reads and writes mesh files in…
permissive · top 15,000 on PyPI