#delaunay-triangulation #mesh #comp-geometry

delaunay

A d-dimensional Delaunay triangulation library with float coordinate support

14 unstable releases (4 breaking)

Uses new Rust 2024

0.5.3 Oct 31, 2025
0.5.0 Sep 27, 2025
0.1.0 Apr 11, 2023
0.0.0 Mar 29, 2022

#126 in Algorithms

Download history 78/week @ 2025-08-09 188/week @ 2025-08-16 138/week @ 2025-08-23 227/week @ 2025-08-30 48/week @ 2025-09-06 182/week @ 2025-09-13 128/week @ 2025-09-20 183/week @ 2025-09-27 29/week @ 2025-10-04 140/week @ 2025-10-11 55/week @ 2025-10-18 98/week @ 2025-10-25

328 downloads per month

BSD-3-Clause

3MB
45K SLoC

Rust 36K SLoC // 0.1% comments Python 8K SLoC // 0.2% comments Just 326 SLoC // 0.1% comments Shell 271 SLoC // 0.2% comments

delaunay

DOI Crates.io Downloads License Docs.rs CI rust-clippy analyze codecov Audit dependencies Codacy Badge

D-dimensional Delaunay triangulations in Rust, inspired by CGAL.

📐 Introduction

This library implements d-dimensional Delaunay triangulations in Rust. It is inspired by CGAL, which is a C++ library for computational geometry, and Spade, a Rust library that implements 2D Delaunay triangulations, Constrained Delaunay triangulations, and Voronoi diagrams. The goal of this library is to provide a lightweight alternative to CGAL for the Rust ecosystem.

✨ Features

  • Copy-able data types associated with vertices and cells (integers, floats, chars, custom enums)
  • d-dimensional Delaunay triangulations
  • d-dimensional Convex hulls
  • Geometry quality metrics for simplices: radius ratio and normalized volume (dimension-agnostic)
  • Serialization/Deserialization of all data structures to/from JSON
  • Tested for 2-, 3-, 4-, and 5-dimensional triangulations

See CHANGELOG.md for details.

🚧 Project History

This crate was originally maintained at https://github.com/oovm/shape-rs through version 0.1.0. The original implementation provided basic Delaunay triangulation functionality.

Starting with version 0.3.4, maintenance transferred to this repository, which hosts a completely rewritten d-dimensional implementation focused on computational geometry research applications.

🤝 How to Contribute

We welcome contributions! Here's a 30-second quickstart:

# Clone and setup
git clone https://github.com/acgetchell/delaunay.git
cd delaunay

# Setup development environment (installs tools, builds project)
cargo install just
just setup            # Installs all development tools and dependencies

# Development workflow
just dev              # Quick development cycle: format, lint, test
just quality          # Comprehensive quality checks before pushing
just commit-check     # Verify your changes will pass CI
just --list           # See all available commands

Try the examples:

just examples         # Run all examples
# Or run specific examples:
cargo run --release --example triangulation_3d_100_points
cargo run --release --example convex_hull_3d_100_points

📋 Examples

The examples/ directory contains several demonstrations:

  • triangulation_3d_100_points: Complete 3D Delaunay triangulation with 100 random points
  • convex_hull_3d_100_points: 3D convex hull extraction and analysis with performance benchmarks
  • into_from_conversions: Demonstrates Into/From trait conversions and utilities
  • point_comparison_and_hashing: Demonstrates point comparison and hashing behavior
  • memory_analysis: Memory usage analysis for triangulations across dimensions with allocation tracking
  • zero_allocation_iterator_demo: Performance comparison between allocation and zero-allocation iterators

For detailed documentation, sample output, and usage instructions for each example, see examples/README.md.

For comprehensive guidelines on development environment setup, testing, benchmarking, performance analysis, and development workflow, please see CONTRIBUTING.md.

This includes information about:

  • Building and testing the library
  • Running benchmarks and performance analysis
  • Code style and standards
  • Submitting changes and pull requests
  • Project structure and development tools

📚 References

For a comprehensive list of academic references and bibliographic citations used throughout the library, see REFERENCES.md.

Portions of this library were developed with the assistance of these AI tools:

All code was reviewed and/or edited by the author.

Dependencies

~11MB
~213K SLoC