Expand description
Delaunay triangulation algorithms
This module provides implementations for Delaunay triangulation of points in 2D and higher dimensions. Delaunay triangulation is a way of connecting a set of points to form triangles such that no point is inside the circumcircle of any triangle.
§Implementation
This module uses the Qhull library (via qhull-rs) for computing Delaunay triangulations. Qhull implements the Quickhull algorithm for Delaunay triangulation and convex hull computation.
§Examples
use scirs2_spatial::delaunay::Delaunay;
use ndarray::array;
// Create a set of 2D points
let points = array![
[0.0, 0.0],
[1.0, 0.0],
[0.0, 1.0],
[0.5, 0.5]
];
// Compute Delaunay triangulation
let tri = Delaunay::new(&points).unwrap();
// Get the simplex (triangle) indices
let simplices = tri.simplices();
println!("Triangles: {:?}", simplices);
// Find the triangle containing a point
let point = [0.25, 0.25];
if let Some(idx) = tri.find_simplex(&point) {
println!("Point {:?} is in triangle {}", point, idx);
}Structs§
- Delaunay
- Structure for storing and querying a Delaunay triangulation