bermuda
Spatial algorithms for napari project, compiled for performance
What it is and what it does
Bermuda is a Rust-backed Python package that exports three specialized triangulation functions for 2D geometry: path edge triangulation (for stroked lines), polygon face triangulation (for filled shapes), and combined face-and-edge triangulation. It was built as a performance-critical backend for napari, a scientific image viewer, and accepts only numpy float32 arrays as input. The package returns triangulation indices and vertex coordinates suitable for GPU rendering or mesh processing.
The functions decompose geometric primitives into triangle meshes, with path triangulation using miter/bevel joins and polygon triangulation using a sweeping-line algorithm. All three functions are exported at the module level and documented with full type hints. The package is actively maintained, supports Python 3.9 through 3.14, and ships pre-compiled wheels for most common platforms, reducing installation friction despite its Rust implementation.
Use it for:
- Render stroked 2D paths in napari or other visualization tools by triangulating path edges with configurable line width and join styles.
- Triangulate filled 2D polygons (including non-convex and self-intersecting shapes) for mesh-based rendering or geometric analysis.
- Generate both face and edge triangulations for polygon outlines in a single call, useful for rendering filled shapes with visible borders.
- Speed up batch triangulation of multiple polygons in scientific imaging pipelines where performance is critical.
- Integrate with GPU-based rendering by obtaining triangle indices and vertex coordinates in a format ready for graphics APIs.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Rust-accelerated triangulation functions for 2D paths and polygons, designed as a backend for napari's spatial geometry operations.
Yes, if you need fast 2D triangulation for napari or similar visualization work. The package is actively maintained, has no known vulnerabilities, uses a permissive license, and provides pre-built wheels for most platforms. The Alpha status means it is still evolving; verify that the three exported functions match your exact triangulation needs before committing.
Install
bermuda on PyPI
pip
pip install bermudauv
uv add bermudapoetry
poetry add bermudaInstalling bermuda
Before you install
Medium install friction due to compiled Rust bindings, but wheels are pre-built for common platforms (macOS, Linux, Windows on x86_64 and ARM64). Active maintenance with recent commits and permissive BSD-3-Clause license.
License in practice
BSD-3-Clause is permissive; you can use this in commercial or proprietary projects with minimal restrictions, provided you include the license text and do not hold the authors liable.
Quickstart
import numpy as np
from bermuda import triangulate_path_edge
path = np.array([[0, 0], [1, 1], [2, 0]], dtype=np.float32)
centers, offsets, triangles = triangulate_path_edge(path, closed=False)
Input arrays must be float32 dtype; numpy is required as a runtime dependency.
Verify before relying
- Whether the package handles 3D triangulation or is strictly 2D.
- Performance benchmarks compared to other triangulation libraries.
- Stability guarantees given the Alpha development status.
- Real-world usage scale and adoption beyond napari ecosystem.
Package facts
| License | BSD-3-Clause (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — numpy |
| Maintenance | actively maintained — 181 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 85,252/month — #13,938 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: bermuda-0.1.7-cp310-cp310-macosx_10_12_x86_64.whl; bermuda-0.1.7-cp310-cp310-macosx_11_0_arm64.whl; bermuda-0.1.7-cp310-cp310-manylinux_2_28_aarch64.whl; bermuda-0.1.7-cp310-cp310-manylinux_2_28_x86_64.whl; bermuda-0.1.7-cp310-cp310-musllinux_1_2_aarch64.whl; bermuda-0.1.7-cp310-cp310-musllinux_1_2_x86_64.whl; bermuda-0.1.7-cp310-cp310-win_amd64.whl; bermuda-0.1.7-cp311-cp311-macosx_10_12_x86_64.whl; bermuda-0.1.7-cp311-cp311-macosx_11_0_arm64.whl; bermuda-0.1.7-cp311-cp311-manylinux_2_28_aarch64.whl; bermuda-0.1.7-cp311-cp311-manylinux_2_28_x86_64.whl; bermuda-0.1.7-cp311-cp311-musllinux_1_2_aarch64.whl; bermuda-0.1.7-cp311-cp311-musllinux_1_2_x86_64.whl; bermuda-0.1.7-cp311-cp311-win_amd64.whl; bermuda-0.1.7-cp311-cp311-win_arm64.whl; bermuda-0.1.7-cp312-cp312-macosx_10_13_x86_64.whl; bermuda-0.1.7-cp312-cp312-macosx_11_0_arm64.whl; bermuda-0.1.7-cp312-cp312-manylinux_2_28_aarch64.whl; bermuda-0.1.7-cp312-cp312-manylinux_2_28_x86_64.whl; bermuda-0.1.7-cp312-cp312-musllinux_1_2_aarch64.whl
Tags
More Bio-Informatics packages
NetworkX provides data structures and…
permissive · top 1,000 on PyPI
biopythonBiopython provides Python tools for…
unclear · top 5,000 on PyPI
firecrawl-pyClient library for the Firecrawl API that…
permissive · top 5,000 on PyPI
intervaltreeA self-balancing interval tree data structure…
permissive · top 5,000 on PyPI
albumentationsAlbumentations applies image transformations to…
permissive · top 5,000 on PyPI
PubChemPyPubChemPy is a Python wrapper around the…
permissive · top 5,000 on PyPI
alphashapeGenerates n-dimensional alpha shapes—concave or…
permissive · top 5,000 on PyPI
mapbox-earcutFast 2D polygon triangulation using the Mapbox…
permissive · top 5,000 on PyPI
triangleTriangle wraps Jonathan Richard Shewchuk's C…
copyleft · top 15,000 on PyPI
vhacdxComputes approximate convex decomposition of…
unclear · top 5,000 on PyPI
cytriangleCyTriangle wraps Jonathan Shewchuk's Triangle…
copyleft · top 15,000 on PyPI
cmeel-qhullProvides precompiled qhull binaries (convex…
unclear · top 15,000 on PyPI
fast-simplificationSimplifies 3D meshes by reducing the number of…
permissive · top 15,000 on PyPI
quadrilateral-fitterFits the smallest-area quadrilateral that…
permissive · top 15,000 on PyPI
xatlasGenerates UV texture coordinates for 3D…
permissive · top 15,000 on PyPI
naparinapari is an interactive, multi-dimensional…
permissive · top 15,000 on PyPI