Skip to main content

DelaunayNd

Struct DelaunayNd 

Source
#[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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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: bool

Whether this is the furthest-site triangulation.

Implementations§

Source§

impl DelaunayNd

Source

pub fn new(points: &[Vec<f64>]) -> Result<DelaunayNd, ErrorsJSL>

Source

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.

Source

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.

Source

pub fn new_furthest_site_with_options( points: &[Vec<f64>], options: &QhullOptions, ) -> Result<DelaunayNd, ErrorsJSL>

The furthest-site triangulation with Qhull-style options.

Source

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.

Source

pub fn barycentric(&self, s: usize, x: &[f64]) -> Vec<f64>

The barycentric coordinates of x in simplex s (d + 1 values summing to 1).

Source

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.

Trait Implementations§

Source§

impl Clone for DelaunayNd

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DelaunayNd

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> MaybeSerialize for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.