trimesh
Import, export, process, analyze and view triangular meshes.
What it is and what it does
Trimesh is a pure Python library for working with triangular mesh geometry, designed to handle 3D surface models with an API modeled after Shapely's Polygon object. It loads and processes common mesh formats (STL, PLY, OBJ, GLTF/GLB, 3MF, XAML, 3DXML) and provides a unified Trimesh object for manipulation and analysis. The library emphasizes watertight surfaces and includes built-in caching and change tracking via numpy array hashing.
Core functionality includes geometric queries (volume, center of mass, moment of inertia, convex hulls, bounding boxes), mesh repair (winding, normals, holes), connectivity analysis, ray-mesh intersection, cross-sectioning for 3D printing, boolean operations, and visualization via OpenGL or Jupyter notebooks. Optional soft dependencies unlock additional features. The library is actively maintained, requires only numpy as a hard dependency, and supports Python 3.10+.
Use it for:
- Load and analyze 3D mesh files for geometric properties like volume, center of mass, and moment of inertia.
- Repair and validate mesh topology (check watertightness, fix winding, merge duplicate vertices) before 3D printing or simulation.
- Perform geometric operations like slicing meshes for 3D printing or computing convex hulls.
- Query ray-mesh intersections and perform boolean operations (union, intersection, difference) on mesh geometry.
- Visualize 3D meshes interactively in OpenGL windows or inline in Jupyter notebooks.
- Split connected mesh components and analyze mesh connectivity using graph algorithms.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Trimesh loads, manipulates, and analyzes triangular mesh geometry in pure Python, with emphasis on watertight surfaces and a single hard dependency on numpy.
Yes. Trimesh is actively maintained (release 13 days ago, 3649 GitHub stars), has zero known vulnerabilities, low install friction (numpy only), and permissive MIT licensing. It is the standard choice for 3D mesh processing in Python when you need to load, analyze, or manipulate triangular geometry.
Install
trimesh on PyPI
pip
pip install trimeshuv
uv add trimeshpoetry
poetry add trimeshInstalling trimesh
Before you install
Low friction: pure Python wheel with only numpy as a hard dependency. Active maintenance (last commit 2026-08-14, release 13 days ago). Requires Python 3.10+. Optional soft dependencies add functionality but are not required for core mesh loading and analysis.
License in practice
MIT license (permissive): you can use, modify, and distribute trimesh freely in commercial and private projects with minimal restrictions. Include the license notice in distributions.
Quickstart
pip install trimesh
import trimesh
import numpy as np
# Create mesh from vertices and faces
mesh = trimesh.Trimesh(
vertices=[[0, 0, 0], [0, 0, 1], [0, 1, 0]],
faces=[[0, 1, 2]]
)
# Query properties
print(mesh.volume, mesh.is_watertight, mesh.center_mass)
Requires Python 3.10 or later.
Verify before relying
- Whether soft dependencies (scipy, networkx, pyglet, lxml, xxhash, embreex, shapely, rtree) install cleanly on platforms beyond Linux x86_64, MacOS ARM, and Windows x86_64.
- Stability guarantees for the API beyond the stated one-year deprecation warning period.
- Which specific mesh formats are supported for import and export beyond those mentioned in the description.
Package facts
| License | The MIT License (MIT) Copyright (c) 2023 Michael Dawson-Haggerty Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the… (full text in the JSON record) (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | actively maintained — 13 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 12,763,403/month — #1,306 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: trimesh-5.0.0-py3-none-any.whl
Keywords: graphics, mesh, geometry, 3D
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
numpy-stlReads, writes, and modifies STL mesh files…
permissive · top 15,000 on PyPI
pymeshfixPyMeshFix repairs triangular meshes by removing…
agpl · top 15,000 on PyPI
manifold3dManifold3d creates and operates on manifold…
permissive · top 5,000 on PyPI
vhacdxComputes approximate convex decomposition of…
unclear · top 5,000 on PyPI
fast-simplificationSimplifies 3D meshes by reducing the number of…
permissive · top 15,000 on PyPI
embreexembreex provides Python bindings to Intel's…
unclear · top 5,000 on PyPI
xatlasGenerates UV texture coordinates for 3D…
permissive · top 15,000 on PyPI
pymeshlabPyMeshLab provides Python bindings to MeshLab,…
copyleft · top 15,000 on PyPI
cmeel-qhullProvides precompiled qhull binaries (convex…
unclear · top 15,000 on PyPI
alphashapeGenerates n-dimensional alpha shapes—concave or…
permissive · top 5,000 on PyPI