skillfed

pymeshfix

Repair triangular meshes using MeshFix

pymeshfix v0.18.1 181.3K downloads/30d#10,129 on PyPI395
AGPL license Active released

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 pymeshfix

uv

uv add pymeshfix

poetry

poetry add pymeshfix

Installing 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

Intended Audience :: Science/ResearchLicense :: OSI Approved :: GNU Affero General Public License v3Operating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14

Tags

mesh repair triangularfix mesh defectswatertight mesh generationremove mesh self-intersectionsdigitized mesh cleanuppolygon mesh correction3d mesh defect removal
mesh-repair3d-geometrydigitization

More Scientific/Engineering packages