--- id: bermuda version: "0.1.7" license: BSD-3-Clause license_treatment: permissive maintenance: active --- # bermuda — Spatial algorithms for napari project, compiled for performance License: permissive · Maintenance: active · Downloads: 85.3K/mo ## 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 above — 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 pip install bermuda uv add bermuda 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_current - Install friction: medium - Maintenance: active - Downloads: 85.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags 2d triangulation numpy, path triangulation rust, polygon triangulation fast, napari geometry backend, mesh generation 2d, computational geometry triangulation, line path triangulation, computational-geometry, rust-bindings, napari-plugin [View on SkillFed](https://skillfed.io/packages/bermuda) · [View on PyPI](https://pypi.org/project/bermuda/)