diff --git a/crates/fj-core/src/algorithms/approx/circle.rs b/crates/fj-core/src/algorithms/approx/circle.rs index 900e6a367..2202914cd 100644 --- a/crates/fj-core/src/algorithms/approx/circle.rs +++ b/crates/fj-core/src/algorithms/approx/circle.rs @@ -2,9 +2,7 @@ use std::iter; use fj_math::{Circle, Point, Scalar, Sign}; -use crate::geometry::CurveBoundary; - -use super::Tolerance; +use crate::geometry::{CurveBoundary, Tolerance}; /// # Approximate a circle /// @@ -135,7 +133,7 @@ mod tests { use fj_math::{Circle, Point, Scalar}; - use crate::{algorithms::approx::Tolerance, geometry::CurveBoundary}; + use crate::geometry::{CurveBoundary, Tolerance}; use super::PathApproxParams; diff --git a/crates/fj-core/src/algorithms/approx/curve.rs b/crates/fj-core/src/algorithms/approx/curve.rs index 5a6b127c9..b5741923b 100644 --- a/crates/fj-core/src/algorithms/approx/curve.rs +++ b/crates/fj-core/src/algorithms/approx/curve.rs @@ -3,12 +3,12 @@ use std::collections::BTreeMap; use fj_math::{Circle, Line, Point}; use crate::{ - geometry::{CurveBoundary, Geometry, Path, SurfaceGeom}, + geometry::{CurveBoundary, Geometry, Path, SurfaceGeom, Tolerance}, storage::Handle, topology::{Curve, Surface}, }; -use super::{circle::approx_circle, line::approx_line, ApproxPoint, Tolerance}; +use super::{circle::approx_circle, line::approx_line, ApproxPoint}; /// Approximate the provided curve /// diff --git a/crates/fj-core/src/algorithms/approx/cycle.rs b/crates/fj-core/src/algorithms/approx/cycle.rs index fe7113a29..85e967ad0 100644 --- a/crates/fj-core/src/algorithms/approx/cycle.rs +++ b/crates/fj-core/src/algorithms/approx/cycle.rs @@ -5,7 +5,7 @@ use fj_math::Segment; use crate::{ - geometry::{CurveBoundary, Geometry}, + geometry::{CurveBoundary, Geometry, Tolerance}, storage::Handle, topology::{Cycle, Surface}, }; @@ -13,7 +13,7 @@ use crate::{ use super::{ half_edge::{approx_half_edge, HalfEdgeApprox}, vertex::approx_vertex, - ApproxCache, ApproxPoint, Tolerance, + ApproxCache, ApproxPoint, }; /// Approximate the provided cycle diff --git a/crates/fj-core/src/algorithms/approx/face.rs b/crates/fj-core/src/algorithms/approx/face.rs index 9472972cf..d8e3e3c98 100644 --- a/crates/fj-core/src/algorithms/approx/face.rs +++ b/crates/fj-core/src/algorithms/approx/face.rs @@ -5,7 +5,7 @@ use std::{collections::BTreeSet, ops::Deref}; use crate::{ - geometry::Geometry, + geometry::{Geometry, Tolerance}, storage::Handle, topology::{Face, Handedness, ObjectSet}, validation::ValidationConfig, @@ -13,7 +13,7 @@ use crate::{ use super::{ cycle::{approx_cycle, CycleApprox}, - Approx, ApproxCache, ApproxPoint, Tolerance, + Approx, ApproxCache, ApproxPoint, }; impl Approx for &ObjectSet { diff --git a/crates/fj-core/src/algorithms/approx/half_edge.rs b/crates/fj-core/src/algorithms/approx/half_edge.rs index 270e2614c..6e36d26cc 100644 --- a/crates/fj-core/src/algorithms/approx/half_edge.rs +++ b/crates/fj-core/src/algorithms/approx/half_edge.rs @@ -7,14 +7,14 @@ use std::iter; use fj_math::Point; use crate::{ - geometry::{CurveBoundary, Geometry}, + geometry::{CurveBoundary, Geometry, Tolerance}, storage::Handle, topology::{HalfEdge, Surface}, }; use super::{ curve::{approx_curve_with_cache, CurveApproxCache}, - ApproxPoint, Tolerance, + ApproxPoint, }; /// Approximate the provided half-edge diff --git a/crates/fj-core/src/algorithms/bounding_volume/face.rs b/crates/fj-core/src/algorithms/bounding_volume/face.rs index e0f36a082..9eb21f036 100644 --- a/crates/fj-core/src/algorithms/bounding_volume/face.rs +++ b/crates/fj-core/src/algorithms/bounding_volume/face.rs @@ -3,8 +3,7 @@ use std::ops::Deref; use fj_math::{Aabb, Vector}; use crate::{ - algorithms::approx::Tolerance, - geometry::{Geometry, Path, SurfaceGeom}, + geometry::{Geometry, Path, SurfaceGeom, Tolerance}, topology::Face, }; diff --git a/crates/fj-core/src/algorithms/triangulate/mod.rs b/crates/fj-core/src/algorithms/triangulate/mod.rs index ad6d3606d..09b90a76b 100644 --- a/crates/fj-core/src/algorithms/triangulate/mod.rs +++ b/crates/fj-core/src/algorithms/triangulate/mod.rs @@ -6,11 +6,11 @@ mod polygon; use fj_interop::Mesh; use fj_math::Point; -use crate::{operations::presentation::GetColor, Core}; +use crate::{geometry::Tolerance, operations::presentation::GetColor, Core}; use self::polygon::Polygon; -use super::approx::{face::FaceApprox, Approx, Tolerance}; +use super::approx::{face::FaceApprox, Approx}; /// Triangulate a shape pub trait Triangulate: Sized { @@ -80,7 +80,8 @@ mod tests { use fj_math::{Point, Scalar}; use crate::{ - algorithms::approx::{face::approx_face, ApproxCache, Tolerance}, + algorithms::approx::{face::approx_face, ApproxCache}, + geometry::Tolerance, operations::{ build::{BuildCycle, BuildFace}, insert::Insert, diff --git a/crates/fj-core/src/core.rs b/crates/fj-core/src/core.rs index 1da8f7b79..f62fd3a63 100644 --- a/crates/fj-core/src/core.rs +++ b/crates/fj-core/src/core.rs @@ -3,7 +3,7 @@ //! See [`Core`]. use crate::{ - algorithms::approx::Tolerance, layers::Layers, validation::ValidationConfig, + geometry::Tolerance, layers::Layers, validation::ValidationConfig, }; /// An instance of the Fornjot core diff --git a/crates/fj-core/src/geometry/curve.rs b/crates/fj-core/src/geometry/curve.rs index 3d036ff68..ad3d622d2 100644 --- a/crates/fj-core/src/geometry/curve.rs +++ b/crates/fj-core/src/geometry/curve.rs @@ -3,12 +3,10 @@ use std::collections::BTreeMap; use fj_math::{Circle, Line, Point}; use crate::{ - algorithms::approx::{PathApproxParams, Tolerance}, - storage::Handle, - topology::Surface, + algorithms::approx::PathApproxParams, storage::Handle, topology::Surface, }; -use super::Path; +use super::{Path, Tolerance}; /// The geometric definition of a curve #[derive(Clone, Debug, Default)] diff --git a/crates/fj-core/src/geometry/surface.rs b/crates/fj-core/src/geometry/surface.rs index f3e229117..a3371ab59 100644 --- a/crates/fj-core/src/geometry/surface.rs +++ b/crates/fj-core/src/geometry/surface.rs @@ -2,9 +2,7 @@ use fj_math::{Point, Scalar, Transform, Triangle, Vector}; -use crate::algorithms::approx::Tolerance; - -use super::{CurveGeom2, Path}; +use super::{CurveGeom2, Path, Tolerance}; /// The geometry that defines a surface #[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)] @@ -115,10 +113,7 @@ mod tests { use fj_math::{Line, Point, Vector}; use pretty_assertions::assert_eq; - use crate::{ - algorithms::approx::Tolerance, - geometry::{Path, SurfaceGeom}, - }; + use crate::geometry::{Path, SurfaceGeom, Tolerance}; #[test] fn point_from_surface_coords() { diff --git a/crates/fj-core/src/validation/checks/coincident_half_edges_are_not_siblings.rs b/crates/fj-core/src/validation/checks/coincident_half_edges_are_not_siblings.rs index 404602260..428c7522c 100644 --- a/crates/fj-core/src/validation/checks/coincident_half_edges_are_not_siblings.rs +++ b/crates/fj-core/src/validation/checks/coincident_half_edges_are_not_siblings.rs @@ -3,8 +3,7 @@ use std::fmt; use fj_math::{Point, Scalar}; use crate::{ - algorithms::approx::Tolerance, - geometry::{CurveBoundary, Geometry}, + geometry::{CurveBoundary, Geometry, Tolerance}, queries::{ AllHalfEdgesWithSurface, BoundingVerticesOfHalfEdge, CycleOfHalfEdge, SiblingOfHalfEdge, diff --git a/crates/fj-core/src/validation/config.rs b/crates/fj-core/src/validation/config.rs index dc763c24d..5351a570f 100644 --- a/crates/fj-core/src/validation/config.rs +++ b/crates/fj-core/src/validation/config.rs @@ -1,6 +1,6 @@ use fj_math::Scalar; -use crate::algorithms::approx::Tolerance; +use crate::geometry::Tolerance; /// Configuration required for the validation process #[derive(Debug, Clone, Copy)] diff --git a/crates/fj/src/args.rs b/crates/fj/src/args.rs index 28134c6a1..88f39e022 100644 --- a/crates/fj/src/args.rs +++ b/crates/fj/src/args.rs @@ -1,6 +1,6 @@ use std::{num::ParseFloatError, path::PathBuf, str::FromStr}; -use fj_core::algorithms::approx::{InvalidTolerance, Tolerance}; +use fj_core::geometry::{InvalidTolerance, Tolerance}; use fj_math::Scalar; /// Standardized CLI for Fornjot models diff --git a/crates/fj/src/instance.rs b/crates/fj/src/instance.rs index a6f147aec..3aea54988 100644 --- a/crates/fj/src/instance.rs +++ b/crates/fj/src/instance.rs @@ -1,11 +1,8 @@ use std::{error::Error as _, fmt}; use fj_core::{ - algorithms::{ - approx::{InvalidTolerance, Tolerance}, - bounding_volume::BoundingVolume, - triangulate::Triangulate, - }, + algorithms::{bounding_volume::BoundingVolume, triangulate::Triangulate}, + geometry::{InvalidTolerance, Tolerance}, validation::{ValidationConfig, ValidationErrors}, Core, };