DynamicMonoTriangulator

Struct DynamicMonoTriangulator 

Source
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>

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<V: Debug + IndexType, Vec2: Debug + Vector2D, Poly: Debug + Polygon<Vec2>> Debug for DynamicMonoTriangulator<V, Vec2, Poly>

Source§

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

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

impl<V: IndexType, Vec2: Vector2D, Poly: Polygon<Vec2>> MonotoneTriangulator for DynamicMonoTriangulator<V, Vec2, Poly>

Source§

fn new(v: usize) -> Self

Create a new reflex chain with a single value

Source§

fn is_right(&self) -> bool

Whether the chain is oriented to the right

Source§

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>>, )

Finish triangulating the reflex chain

Source§

type V = V

The index type used in the mesh
Source§

type Vec2 = Vec2

The vector type used in the mesh
Source§

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 sanity_check(&self, _: usize, _: usize, _: &Option<Self>)

Validate the data structure
Source§

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>
where V: RefUnwindSafe, Vec2: RefUnwindSafe, Poly: RefUnwindSafe,

§

impl<V, Vec2, Poly> Send for DynamicMonoTriangulator<V, Vec2, Poly>
where V: Send, Vec2: Send, Poly: Send,

§

impl<V, Vec2, Poly> Sync for DynamicMonoTriangulator<V, Vec2, Poly>
where V: Sync, Vec2: Sync, Poly: Sync,

§

impl<V, Vec2, Poly> Unpin for DynamicMonoTriangulator<V, Vec2, Poly>
where V: Unpin, Vec2: Unpin, Poly: Unpin,

§

impl<V, Vec2, Poly> UnwindSafe for DynamicMonoTriangulator<V, Vec2, Poly>
where V: UnwindSafe, Vec2: UnwindSafe, Poly: UnwindSafe,

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V