pub struct Triangulation<'a, T, V>{ /* private fields */ }
Implementations§
Source§impl<'a, T, V> Triangulation<'a, T, V>
impl<'a, T, V> Triangulation<'a, T, V>
Sourcepub fn new(points: &'a [V]) -> Self
pub fn new(points: &'a [V]) -> Self
Returns a new Triangulations object that holds the configuration and a reference to the points
use triangular::Triangulation;
let points = vec![(0.6, 1.1),
(0.2, 1.5),
(0.8, 1.6)];
let triangles = Triangulation::new(&points);
Sourcepub fn with_bounds(self, c1: V, c2: V) -> Self
pub fn with_bounds(self, c1: V, c2: V) -> Self
Return all Triangles calculated within the specified bounds
use triangular::Triangulation;
// build a set of points
let points = vec![(0.6, 1.1),
(0.2, 1.5),
(0.8, 1.6)];
let triangles = Triangulation::new(&points)
.with_bounds((0.0, 0.0), (2.0, 2.0))
.build();
assert_eq!(&*triangles, &[2, 1, 0]);
Sourcepub fn with_max_len(self, max_len: T) -> Self
pub fn with_max_len(self, max_len: T) -> Self
Return all Triangles Calculated with edges < max_len
use triangular::Triangulation;
// build a set of points
let points = vec![(0.6, 1.1),
(0.2, 1.5),
(0.8, 1.6)];
let triangles = Triangulation::new(&points)
.with_max_len(0.1)
.build();
assert_eq!(&*triangles, &[]);
Auto Trait Implementations§
impl<'a, T, V> Freeze for Triangulation<'a, T, V>
impl<'a, T, V> RefUnwindSafe for Triangulation<'a, T, V>where
T: RefUnwindSafe,
V: RefUnwindSafe,
impl<'a, T, V> Send for Triangulation<'a, T, V>
impl<'a, T, V> Sync for Triangulation<'a, T, V>
impl<'a, T, V> Unpin for Triangulation<'a, T, V>
impl<'a, T, V> UnwindSafe for Triangulation<'a, T, V>
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