skillfed

bermuda

Spatial algorithms for napari project, compiled for performance

bermuda v0.1.7 85.3K downloads/30d#13,938 on PyPI4
Permissive license BSD-3-Clause Active released

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 bermuda

uv

uv add bermuda

poetry

poetry add bermuda

Installing 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

Development Status :: 3 - AlphaOperating System :: OS IndependentProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: RustTopic :: Scientific/Engineering :: Bio-Informatics

Tags

2d triangulation numpypath triangulation rustpolygon triangulation fastnapari geometry backendmesh generation 2dcomputational geometry triangulationline path triangulation
computational-geometryrust-bindingsnapari-plugin

More Bio-Informatics packages