pub mod arrangement;
pub mod broadphase;
pub mod budget;
pub mod coplanar;
pub mod fixed;
pub mod fixed_int;
pub mod interner;
pub mod interval;
pub mod manifest;
pub mod mesh_bridge;
pub mod mesh_volume;
pub(crate) mod near_band;
pub(crate) mod plane_weld;
pub mod predicates;
pub mod rational;
pub(crate) mod signed_volume;
pub mod retriangulate;
mod retriangulate_audit;
mod retriangulate_cleanup;
mod retriangulate_recover;
#[cfg(test)]
mod retriangulate_recover_tests;
pub mod tritri;
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub enum Sign {
Negative,
Zero,
Positive,
}
impl Sign {
#[inline]
pub fn from_f64(x: f64) -> Sign {
if x < 0.0 {
Sign::Negative
} else if x > 0.0 {
Sign::Positive
} else {
Sign::Zero
}
}
#[inline]
pub fn flip(self) -> Sign {
match self {
Sign::Positive => Sign::Negative,
Sign::Negative => Sign::Positive,
Sign::Zero => Sign::Zero,
}
}
}
#[derive(Clone, Copy, PartialEq, Eq, Debug)]
pub enum DropAxis {
X,
Y,
Z,
}
#[derive(Clone, Debug)]
pub enum ImplicitPoint {
Explicit([f64; 3]),
Lpi(Lpi),
Tpi(Tpi),
}
#[derive(Clone, Copy, Debug)]
pub struct Lpi {
pub p: [f64; 3],
pub q: [f64; 3],
pub r: [f64; 3],
pub s: [f64; 3],
pub t: [f64; 3],
}
#[derive(Clone, Copy, Debug)]
pub struct Tpi {
pub planes: [[[f64; 3]; 3]; 3],
}
#[inline]
pub fn assemble_sign(lambda_det_sign: Sign, den_signs: &[Sign]) -> Sign {
let mut negatives = 0u32;
for &d in den_signs {
match d {
Sign::Negative => negatives += 1,
Sign::Zero => return Sign::Zero,
Sign::Positive => {}
}
}
if negatives % 2 == 1 {
lambda_det_sign.flip()
} else {
lambda_det_sign
}
}