#[non_exhaustive]pub struct DelaunayNd {
pub points: Vec<Vec<f64>>,
pub simplices: Vec<Vec<usize>>,
pub neighbors: Vec<Vec<Option<usize>>>,
pub transform: Vec<Vec<Vec<f64>>>,
pub furthest_site: bool,
/* private fields */
}Expand description
The Delaunay triangulation of points in any dimension d ≥ 2 (SciPy’s Delaunay): the
lower facets of the hull of the points lifted to (x, ‖x‖²). Degenerate (cospherical) sets,
such as grids, are triangulated by a tiny deterministic perturbation of the lifted
coordinate, which picks one of their valid triangulations (Qhull’s “joggle”).
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.points: Vec<Vec<f64>>§simplices: Vec<Vec<usize>>Each simplex as d + 1 point indices.
neighbors: Vec<Vec<Option<usize>>>neighbors[s][i]: the simplex opposite vertex i of simplex s, or None on the hull.
transform: Vec<Vec<Vec<f64>>>For each simplex, the barycentric transform: rows 0..d hold T⁻¹ and row d the
vertex r = x_{v_d}, so that c = T⁻¹ (x − r) gives the first d barycentric
coordinates (SciPy’s transform).
furthest_site: boolWhether this is the furthest-site triangulation.
Implementations§
Source§impl DelaunayNd
impl DelaunayNd
pub fn new(points: &[Vec<f64>]) -> Result<DelaunayNd, ErrorsJSL>
Sourcepub fn with_options(
points: &[Vec<f64>],
options: &QhullOptions,
) -> Result<DelaunayNd, ErrorsJSL>
pub fn with_options( points: &[Vec<f64>], options: &QhullOptions, ) -> Result<DelaunayNd, ErrorsJSL>
As DelaunayNd::new with Qhull-style options (see QhullOptions): QJ moves the
points by a larger amount than the built-in tiny joggle, and E sets the tolerance of the
lifted hull.
Sourcepub fn new_furthest_site(points: &[Vec<f64>]) -> Result<DelaunayNd, ErrorsJSL>
pub fn new_furthest_site(points: &[Vec<f64>]) -> Result<DelaunayNd, ErrorsJSL>
The furthest-site Delaunay triangulation (SciPy’s Delaunay(furthest_site=True)): the
simplices whose circumscribed sphere contains all the points, from the upper facets of
the lifted hull. It triangulates the convex hull of the points, using only the points that
are vertices of the hull; the others appear in no simplex.
Sourcepub fn new_furthest_site_with_options(
points: &[Vec<f64>],
options: &QhullOptions,
) -> Result<DelaunayNd, ErrorsJSL>
pub fn new_furthest_site_with_options( points: &[Vec<f64>], options: &QhullOptions, ) -> Result<DelaunayNd, ErrorsJSL>
The furthest-site triangulation with Qhull-style options.
Sourcepub fn add_points(&mut self, new: &[Vec<f64>]) -> Result<(), ErrorsJSL>
pub fn add_points(&mut self, new: &[Vec<f64>]) -> Result<(), ErrorsJSL>
Adds points (SciPy’s add_points): the new points get the next indices. They are lifted in
the frame (the box and the joggle sequence) fixed when the triangulation was made and added to
the lifted hull as Quickhull does, so the old points are not touched: only the facets that a
new point sees are replaced. In general position the result is the triangulation of a fresh
computation; for cospherical sets it is one of the valid ones, which may differ from a fresh
computation’s, since the joggle depends on the order in which the points arrive.
Sourcepub fn barycentric(&self, s: usize, x: &[f64]) -> Vec<f64>
pub fn barycentric(&self, s: usize, x: &[f64]) -> Vec<f64>
The barycentric coordinates of x in simplex s (d + 1 values summing to 1).
Sourcepub fn find_simplex(&self, x: &[f64]) -> Option<usize>
pub fn find_simplex(&self, x: &[f64]) -> Option<usize>
The simplex containing x, or None outside the triangulation (SciPy’s find_simplex),
by a walk from simplex 0 towards x, falling back to a full search.