Add default tolerance to Core

As per its documentation, this can be used when computing the new
uniform intermediate geometry representation. I'm working on that right
now, so it's hopefully going to see some use soon.
This commit is contained in:
Hanno Braun 2024-08-06 19:33:53 +02:00
parent cc457a85a2
commit ddd7a392ba

View File

@ -2,7 +2,9 @@
//!
//! See [`Core`].
use crate::{layers::Layers, validation::ValidationConfig};
use crate::{
algorithms::approx::Tolerance, layers::Layers, validation::ValidationConfig,
};
/// An instance of the Fornjot core
///
@ -10,6 +12,9 @@ use crate::{layers::Layers, validation::ValidationConfig};
pub struct Core {
/// The layers of data that make up the state of a core instance
pub layers: Layers,
/// Default tolerance used for intermediate geometry representation
pub default_tolerance: Tolerance,
}
impl Core {
@ -25,7 +30,13 @@ impl Core {
}
fn from_layers(layers: Layers) -> Self {
Self { layers }
let default_tolerance = Tolerance::from_scalar(0.001)
.expect("Tolerance provided is larger than zero");
Self {
layers,
default_tolerance,
}
}
}