pub struct TriangulationIndex {
pub points: Vec<[f64; 2]>,
pub triangles: Vec<[usize; 3]>,
pub neighbors: Vec<[Option<usize>; 3]>,
/* private fields */
}Expand description
A Delaunay triangulation with neighbour links and a bucket grid for point location.
Fields§
§points: Vec<[f64; 2]>§triangles: Vec<[usize; 3]>Triangles, counter-clockwise.
neighbors: Vec<[Option<usize>; 3]>neighbors[t][k]: the triangle across the edge opposite vertex k (Qhull’s convention).
Implementations§
Source§impl TriangulationIndex
impl TriangulationIndex
Sourcepub fn new(points: &[[f64; 2]]) -> Result<TriangulationIndex, ErrorsJSL>
pub fn new(points: &[[f64; 2]]) -> Result<TriangulationIndex, ErrorsJSL>
Triangulates the points (at least three, not all collinear).
Sourcepub fn barycentric(&self, t: usize, p: [f64; 2]) -> [f64; 3]
pub fn barycentric(&self, t: usize, p: [f64; 2]) -> [f64; 3]
The barycentric coordinates of p in triangle t.
Sourcepub fn find(&self, p: [f64; 2]) -> Option<(usize, [f64; 3])>
pub fn find(&self, p: [f64; 2]) -> Option<(usize, [f64; 3])>
A triangle containing p and its barycentric coordinates, allowing a relative slack of
100 ε on the coordinates (as Qhull’s find_simplex); None outside the convex hull.
Sourcepub fn vertex_neighbors(&self) -> Vec<Vec<usize>>
pub fn vertex_neighbors(&self) -> Vec<Vec<usize>>
The neighbours of each vertex (sorted, without duplicates).
Trait Implementations§
Source§impl Clone for TriangulationIndex
impl Clone for TriangulationIndex
Auto Trait Implementations§
impl Freeze for TriangulationIndex
impl RefUnwindSafe for TriangulationIndex
impl Send for TriangulationIndex
impl Sync for TriangulationIndex
impl Unpin for TriangulationIndex
impl UnsafeUnpin for TriangulationIndex
impl UnwindSafe for TriangulationIndex
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more