From 8f57025392bad48be9e0e773a556a0defec35439 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Fri, 13 Sep 2024 20:12:33 +0200 Subject: [PATCH] Move `tolerance` to `geometry` It is starting to see use there, and I think it makes more sense for `approx` to depend on `geometry` than the other way around. `geometry` can be seen to provide low-level geometry primitives, which `approx`, which is higher-level functionality, should depend on at some point. --- crates/fj-core/src/algorithms/approx/mod.rs | 7 ++----- crates/fj-core/src/geometry/mod.rs | 2 ++ .../src/{algorithms/approx => geometry}/tolerance.rs | 0 3 files changed, 4 insertions(+), 5 deletions(-) rename crates/fj-core/src/{algorithms/approx => geometry}/tolerance.rs (100%) diff --git a/crates/fj-core/src/algorithms/approx/mod.rs b/crates/fj-core/src/algorithms/approx/mod.rs index 25e4243f3..7d306228a 100644 --- a/crates/fj-core/src/algorithms/approx/mod.rs +++ b/crates/fj-core/src/algorithms/approx/mod.rs @@ -6,7 +6,6 @@ pub mod half_edge; pub mod shell; pub mod sketch; pub mod solid; -pub mod tolerance; mod circle; mod curve; @@ -25,10 +24,8 @@ use vertex::VertexApproxCache; use crate::geometry::Geometry; -pub use self::{ - circle::PathApproxParams, - tolerance::{InvalidTolerance, Tolerance}, -}; +pub use self::circle::PathApproxParams; +pub use crate::geometry::{InvalidTolerance, Tolerance}; /// Approximate an object pub trait Approx: Sized { diff --git a/crates/fj-core/src/geometry/mod.rs b/crates/fj-core/src/geometry/mod.rs index 819b5da12..dd02a6bc9 100644 --- a/crates/fj-core/src/geometry/mod.rs +++ b/crates/fj-core/src/geometry/mod.rs @@ -5,6 +5,7 @@ mod curve; mod geometry; mod path; mod surface; +mod tolerance; mod vertex; pub use self::{ @@ -13,5 +14,6 @@ pub use self::{ geometry::Geometry, path::Path, surface::SurfaceGeom, + tolerance::{InvalidTolerance, Tolerance}, vertex::{LocalVertexGeom, VertexGeom}, }; diff --git a/crates/fj-core/src/algorithms/approx/tolerance.rs b/crates/fj-core/src/geometry/tolerance.rs similarity index 100% rename from crates/fj-core/src/algorithms/approx/tolerance.rs rename to crates/fj-core/src/geometry/tolerance.rs