Trimesh is a Python library for loading, viewing, processing, and analyzing triangular meshes, with a strong emphasis on vectorized operations for performance. It's actively developed and frequently updated, providing a comprehensive set of tools for 3D geometry manipulation.
pip install trimeshVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates creating a basic mesh, performing common analyses like volume and area calculation, and loading a mesh from a remote URL. It focuses on core functionality that doesn't require interactive display.
Install `trimesh[full]` to get most common optional dependencies, or install specific packages as needed (e.g., `pip install trimesh scipy pyrender`). Consult the official documentation for feature-specific dependencies.
Consult the `trimesh` documentation for your specific version regarding visualization. For robust rendering, consider using `pyrender` directly or `open3d` integration rather than `trimesh.show()` which relies on `pyglet`.
For headless visualization, use `pyrender` or `open3d` which support offscreen rendering, or export your mesh to a common file format (e.g., OBJ, STL). For interactive use, ensure `pyglet` is installed and your environment has a working OpenGL display server.