--- id: numpy-stl version: "4.0.0" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # numpy-stl — Library to make reading, writing and modifying both binary and ascii STL files easy. License: permissive · Maintenance: active · Downloads: 605.1K/mo ## 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 above — 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 pip install numpy-stl uv add numpy-stl poetry add numpy-stl ## Installing 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_current - Install friction: low - Maintenance: active - Downloads: 605.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags STL file reader writer, 3D mesh manipulation, STL binary ASCII conversion, NumPy mesh operations, 3D geometry processing, CAD file handling, mesh rotation translation, 3d-geometry, mesh-processing, cad-formats [View on SkillFed](https://skillfed.io/packages/numpy-stl) · [View on PyPI](https://pypi.org/project/numpy-stl/)