pub struct DynamicMonoTriangulator<V: IndexType, Vec2: Vector2D, Poly: Polygon<Vec2>> { /* private fields */ }Expand description
A variant of the sweep-line algorithm that finds the min-weight triangulation for each monotone sub-polygon using dynamic programming, leading to an overall O(n^2) time complexity.
When using the bound k, the approximation quality decreases the smaller k is, with time O(k^2 n log n). However, for k << n this comes in most cases very quickly close to O(n log n).
For the quality of the approximation it is generally beneficial to rotate the mesh such that the mesh can be decomposed in a large number of y-monotone components.
Trait Implementations§
Source§impl<V: Clone + IndexType, Vec2: Clone + Vector2D, Poly: Clone + Polygon<Vec2>> Clone for DynamicMonoTriangulator<V, Vec2, Poly>
impl<V: Clone + IndexType, Vec2: Clone + Vector2D, Poly: Clone + Polygon<Vec2>> Clone for DynamicMonoTriangulator<V, Vec2, Poly>
Source§fn clone(&self) -> DynamicMonoTriangulator<V, Vec2, Poly>
fn clone(&self) -> DynamicMonoTriangulator<V, Vec2, Poly>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<V: Debug + IndexType, Vec2: Debug + Vector2D, Poly: Debug + Polygon<Vec2>> Debug for DynamicMonoTriangulator<V, Vec2, Poly>
impl<V: Debug + IndexType, Vec2: Debug + Vector2D, Poly: Debug + Polygon<Vec2>> Debug for DynamicMonoTriangulator<V, Vec2, Poly>
Source§impl<V: IndexType, Vec2: Vector2D, Poly: Polygon<Vec2>> MonotoneTriangulator for DynamicMonoTriangulator<V, Vec2, Poly>
impl<V: IndexType, Vec2: Vector2D, Poly: Polygon<Vec2>> MonotoneTriangulator for DynamicMonoTriangulator<V, Vec2, Poly>
Source§fn left(
&mut self,
value: usize,
_: &mut Triangulation<'_, V>,
_: &Vec<IndexedVertex2D<V, Vec2>>,
)
fn left( &mut self, value: usize, _: &mut Triangulation<'_, V>, _: &Vec<IndexedVertex2D<V, Vec2>>, )
Add a new value to the left reflex chain
Source§fn finish(
&mut self,
indices: &mut Triangulation<'_, V>,
vec2s: &Vec<IndexedVertex2D<V, Vec2>>,
)
fn finish( &mut self, indices: &mut Triangulation<'_, V>, vec2s: &Vec<IndexedVertex2D<V, Vec2>>, )
Finish triangulating the reflex chain
Source§fn last_opposite(&self) -> usize
fn last_opposite(&self) -> usize
Get the last inserted element of the opposite chain
TODO: Get rid of this. It’s confusing to use and only use in the split case.
Source§fn right(
&mut self,
value: usize,
_: &mut Triangulation<'_, V>,
_: &Vec<IndexedVertex2D<V, Vec2>>,
)
fn right( &mut self, value: usize, _: &mut Triangulation<'_, V>, _: &Vec<IndexedVertex2D<V, Vec2>>, )
Add a new value to the right chain
Auto Trait Implementations§
impl<V, Vec2, Poly> Freeze for DynamicMonoTriangulator<V, Vec2, Poly>
impl<V, Vec2, Poly> RefUnwindSafe for DynamicMonoTriangulator<V, Vec2, Poly>
impl<V, Vec2, Poly> Send for DynamicMonoTriangulator<V, Vec2, Poly>
impl<V, Vec2, Poly> Sync for DynamicMonoTriangulator<V, Vec2, Poly>
impl<V, Vec2, Poly> Unpin for DynamicMonoTriangulator<V, Vec2, Poly>
impl<V, Vec2, Poly> UnwindSafe for DynamicMonoTriangulator<V, Vec2, Poly>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.