mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-03 17:38:27 +00:00
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:
parent
cc457a85a2
commit
ddd7a392ba
@ -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,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user