Skip to main content

VoronoiNd

Struct VoronoiNd 

Source
#[non_exhaustive]
pub struct VoronoiNd { pub points: Vec<Vec<f64>>, pub vertices: Vec<Vec<f64>>, pub ridge_points: Vec<[usize; 2]>, pub ridge_vertices: Vec<Vec<Option<usize>>>, pub regions: Vec<Vec<Option<usize>>>, pub furthest_site: bool, }
Expand description

The Voronoi diagram of points in any dimension (SciPy’s Voronoi), as the dual of the Delaunay triangulation: one Voronoi vertex per Delaunay simplex (its circumcentre), one region per input point, and one ridge per Delaunay edge (pair of neighbouring points).

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>>§vertices: Vec<Vec<f64>>§ridge_points: Vec<[usize; 2]>

The pairs of input points that each ridge separates.

§ridge_vertices: Vec<Vec<Option<usize>>>

The Voronoi vertices of each ridge, with None for a vertex at infinity (SciPy’s −1).

§regions: Vec<Vec<Option<usize>>>

For each input point, the vertices of its region (unordered), with None if unbounded.

§furthest_site: bool

Whether this is the furthest-site diagram.

Implementations§

Source§

impl VoronoiNd

Source

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

Source

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

The furthest-site Voronoi diagram (SciPy’s Voronoi(furthest_site=True)): the dual of the furthest-site Delaunay triangulation, whose cells are the points of the plane (or space) for which a given input point is the farthest. Only the vertices of the convex hull have a region, and every region is unbounded; the other points get empty regions.

Source

pub fn with_options( points: &[Vec<f64>], furthest_site: bool, options: &QhullOptions, ) -> Result<VoronoiNd, ErrorsJSL>

As VoronoiNd::new or VoronoiNd::new_furthest_site with Qhull-style options.

Trait Implementations§

Source§

impl Clone for VoronoiNd

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 VoronoiNd

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.