Skip to content

Commit

Permalink
Add default tolerance to Core
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hannobraun committed Aug 6, 2024
1 parent cc457a8 commit ddd7a39
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions crates/fj-core/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@
//!
//! See [`Core`].
use crate::{layers::Layers, validation::ValidationConfig};
use crate::{
algorithms::approx::Tolerance, layers::Layers, validation::ValidationConfig,
};

/// An instance of the Fornjot core
///
/// This is the main entry point to `fj-core`'s API.
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 {
Expand All @@ -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,
}
}
}

Expand Down

0 comments on commit ddd7a39

Please sign in to comment.