numpy-stl
Library to make reading, writing and modifying both binary and ascii STL files easy.
What it is and what it does
numpy-stl is a Python library for loading, saving, and manipulating 3D mesh files in STL format (and experimentally, PLY and 3MF). It wraps mesh geometry in NumPy arrays, enabling fast vectorized operations like rotation, translation, matrix transforms, and mass property calculations (volume, center of gravity, inertia tensor). The library auto-detects binary vs. ASCII STL on load and provides CLI tools for format conversion.
Typical workflows include loading a mesh file, inspecting or modifying its geometry, computing physical properties, combining multiple meshes, and saving the result. All core operations use NumPy's array math for speed; optional Cython speedups (via the `speedups` package) can accelerate ASCII parsing by ~5x. It requires Python 3.10+ and numpy 1.24+.
Use it for:
- Load and inspect 3D CAD models (STL files) to extract geometry, bounding box, or triangle count for validation.
- Transform mesh geometry by rotating, translating, or applying 4x4 matrix transforms before export.
- Calculate mass properties (volume, center of gravity, inertia tensor) for closed mesh models in engineering workflows.
- Combine multiple STL parts into a single mesh by concatenating their data arrays.
- Convert between STL binary and ASCII formats, or read PLY files for interoperability with other 3D tools.
- Visualize 3D meshes using matplotlib by extracting vectors and rendering as 3D polygon collections.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Reads, writes, and modifies STL mesh files (binary and ASCII formats) using NumPy-backed vectorized operations for fast geometry processing.
Yes. The package is mature, actively maintained, has no known vulnerabilities, installs with low friction, and solves a specific problem (STL mesh I/O and manipulation) with a clean NumPy-backed API. Use it if you need to read, write, or transform STL files in Python; skip it only if you have no mesh-processing requirements.
Install
numpy-stl on PyPI
pip
pip install numpy-stluv
uv add numpy-stlpoetry
poetry add numpy-stlInstalling numpy-stl
Before you install
Low friction: pure Python wheel with three lightweight runtime dependencies (numpy, python-utils, typing-extensions). Actively maintained as of 2026-06-17 with recent activity.
License in practice
BSD-3-Clause is permissive; you can use, modify, and distribute this package with minimal legal constraints, provided you retain the license notice.
Quickstart
pip install numpy-stl
from stl import mesh
# Load an STL file
your_mesh = mesh.Mesh.from_file('model.stl')
# Inspect
print(f'{len(your_mesh)} triangles')
# Save
your_mesh.save('output.stl')
Requires Python 3.10 or later; numpy 1.24+ is installed automatically.
Verify before relying
- Whether PLY write support is stable or still experimental like 3MF read support
- Performance characteristics of mesh operations on very large files beyond the 871,414-triangle benchmark shown
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — numpy, python-utils, typing-extensions |
| Maintenance | actively maintained — 58 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 605,073/month — #5,799 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: numpy_stl-4.0.0-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
plyfileplyfile reads and writes ASCII and binary PLY…
copyleft · top 5,000 on PyPI
trimeshTrimesh loads, manipulates, and analyzes…
permissive · top 5,000 on PyPI
meshioplusplusmeshioplusplus reads and writes mesh files in…
permissive · top 15,000 on PyPI
meshioReads and writes mesh files in dozens of…
permissive · top 5,000 on PyPI
fast-simplificationSimplifies 3D meshes by reducing the number of…
permissive · top 15,000 on PyPI
lib3mflib3mf reads, writes, and validates 3D…
permissive · top 15,000 on PyPI
pytetwildpytetwild converts surface meshes into…
copyleft · top 15,000 on PyPI
PyGEL3DPyGEL3D provides Python bindings for a C++…
permissive · top 15,000 on PyPI
DracoPyDracoPy is a Python wrapper for Google's Draco…
permissive · top 15,000 on PyPI
py-lib3mfProvides Python bindings to Lib3MF, enabling…
permissive · top 15,000 on PyPI