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
impl Delaunay3
Sourcepub fn from_points(points: &[Point3]) -> Result<Self, Delaunay3Error>
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.
Sourcepub fn insert(&mut self, point: Point3) -> Result<Insertion, Delaunay3Error>
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.
Sourcepub fn vertex_of(&self, index: usize) -> usize
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.
Sourcepub fn dimension(&self) -> Option<usize>
pub fn dimension(&self) -> Option<usize>
Affine dimension of the points so far: None when there are none.
Sourcepub fn tetrahedron_count(&self) -> usize
pub fn tetrahedron_count(&self) -> usize
Number of finite tetrahedra.
Sourcepub fn tetrahedra(&self) -> Tetrahedra
pub fn tetrahedra(&self) -> Tetrahedra
The finite tetrahedra and their adjacency.
Sourcepub fn hull_triangles(&self) -> Vec<[usize; 3]>
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.