Struct Delaunay3

Source
pub struct Delaunay3 { /* private fields */ }
Expand description

An incremental 3D Delaunay triangulation of a point set.

Built with Delaunay3::from_points or point by point with Delaunay3::insert. Every decision is an exact sign from axiolid-predicates; ties (cospherical points, points in the plane of a hull face) are broken by a symbolic perturbation that depends only on the coordinates, so the result is a Delaunay triangulation – every circumsphere has no point strictly inside – and it is the same for every insertion order. Exact duplicates are merged, not inserted twice.

Implementations§

Source§

impl Delaunay3

Source

pub fn new() -> Self

An empty triangulation.

Source

pub fn from_points(points: &[Point3]) -> Result<Self, Delaunay3Error>

The Delaunay triangulation of points.

Points keep their indices: Delaunay3::points is points (with -0.0 read as 0.0). They are inserted in Hilbert-curve order, which changes only the running time.

§Errors

Delaunay3Error::NonFinite or Delaunay3Error::OutOfRange for the first offending point, and Delaunay3Error::NotFullDimensional when the points are empty, all equal, collinear or coplanar.

Source

pub fn insert(&mut self, point: Point3) -> Result<Insertion, Delaunay3Error>

Insert one point.

Before four affinely independent points have arrived there is no tetrahedron; points are held and inserted as soon as one exists.

§Errors

Delaunay3Error::NonFinite or Delaunay3Error::OutOfRange, with index the index the point would have had; the triangulation is left unchanged.

Source

pub fn points(&self) -> &[Point3] ⓘ

Every point given so far, duplicates included, by index.

Source

pub fn vertex_of(&self, index: usize) -> usize

The vertex that point index became: index itself, or the earlier point it exactly duplicates.

§Panics

If index is not a point index.

Source

pub fn dimension(&self) -> Option<usize>

Affine dimension of the points so far: None when there are none.

Source

pub fn tetrahedron_count(&self) -> usize

Number of finite tetrahedra.

Source

pub fn tetrahedra(&self) -> Tetrahedra

The finite tetrahedra and their adjacency.

Source

pub fn hull_triangles(&self) -> Vec<[usize; 3]>

The convex hull’s faces, as vertex triples ordered counter-clockwise seen from outside: the normal (b - a) x (c - a) points out.

Coplanar hull facets come triangulated (Delaunay within their plane, under the same perturbation). Empty below three dimensions.

Trait Implementations§

Source§

impl Clone for Delaunay3

Source§

fn clone(&self) -> Delaunay3

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Delaunay3

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Delaunay3

Source§

fn default() -> Self

Returns the “default value” for a type. 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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.