mod delaunay;
mod dynamic;
mod linear;
pub use delaunay::*;
pub use dynamic::*;
pub use linear::*;
use crate::{
math::{IndexType, Vector2D},
mesh::{IndexedVertex2D, Triangulation},
};
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
enum ChainDirection {
Left,
Right,
None,
}
pub trait MonotoneTriangulator: Sized + std::fmt::Debug + Clone {
type V: IndexType;
type Vec2: Vector2D;
fn new(v: usize) -> Self;
fn last_opposite(&self) -> usize;
fn is_right(&self) -> bool;
fn sanity_check(&self, left_start: usize, right_start: usize, fixup: &Option<Self>);
fn right(
&mut self,
value: usize,
indices: &mut Triangulation<Self::V>,
vec2s: &Vec<IndexedVertex2D<Self::V, Self::Vec2>>,
);
fn left(
&mut self,
value: usize,
indices: &mut Triangulation<Self::V>,
vec2s: &Vec<IndexedVertex2D<Self::V, Self::Vec2>>,
);
fn finish(
&mut self,
indices: &mut Triangulation<Self::V>,
vec2s: &Vec<IndexedVertex2D<Self::V, Self::Vec2>>,
);
}