use crate::misc::FloatingPoint;
#[derive(Debug, Clone)]
pub struct AdvancingFrontOptions<T: FloatingPoint> {
pub tolerance: T,
pub min_edge_length: T,
pub max_edge_length: T,
}
impl<T: FloatingPoint> Default for AdvancingFrontOptions<T> {
fn default() -> Self {
Self {
tolerance: T::from_f64(0.1).unwrap(),
min_edge_length: T::from_f64(1e-6).unwrap(),
max_edge_length: T::from_f64(1e3).unwrap(),
}
}
}
impl<T: FloatingPoint> AdvancingFrontOptions<T> {
pub fn with_tolerance(mut self, tolerance: T) -> Self {
self.tolerance = tolerance;
self
}
pub fn with_deflection(self, deflection: T) -> Self {
self.with_tolerance(deflection)
}
pub fn with_min_edge_length(mut self, len: T) -> Self {
self.min_edge_length = len;
self
}
pub fn with_max_edge_length(mut self, len: T) -> Self {
self.max_edge_length = len;
self
}
}