From b17b3b0d961302d0b1c108076050c4812daefd3f Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 25 Jun 2024 20:21:22 +0200 Subject: [PATCH] Rename `HalfEdgeApproxCache` to `ApproxCache` --- crates/fj-core/src/algorithms/approx/cycle.rs | 4 ++-- crates/fj-core/src/algorithms/approx/face.rs | 6 +++--- crates/fj-core/src/algorithms/approx/half_edge.rs | 4 ++-- crates/fj-core/src/algorithms/approx/shell.rs | 6 ++---- crates/fj-core/src/algorithms/approx/sketch.rs | 6 ++---- crates/fj-core/src/algorithms/approx/solid.rs | 4 ++-- crates/fj-core/src/algorithms/triangulate/mod.rs | 4 ++-- 7 files changed, 15 insertions(+), 19 deletions(-) diff --git a/crates/fj-core/src/algorithms/approx/cycle.rs b/crates/fj-core/src/algorithms/approx/cycle.rs index c5d1051c7..e57bb829b 100644 --- a/crates/fj-core/src/algorithms/approx/cycle.rs +++ b/crates/fj-core/src/algorithms/approx/cycle.rs @@ -11,7 +11,7 @@ use crate::{ }; use super::{ - half_edge::{approx_half_edge, HalfEdgeApprox, HalfEdgeApproxCache}, + half_edge::{approx_half_edge, HalfEdgeApprox, ApproxCache}, ApproxPoint, Tolerance, }; @@ -20,7 +20,7 @@ pub fn approx_cycle( cycle: &Cycle, surface: &Handle, tolerance: impl Into, - cache: &mut HalfEdgeApproxCache, + cache: &mut ApproxCache, geometry: &Geometry, ) -> CycleApprox { let tolerance = tolerance.into(); diff --git a/crates/fj-core/src/algorithms/approx/face.rs b/crates/fj-core/src/algorithms/approx/face.rs index 1fba8682e..0ad8960f2 100644 --- a/crates/fj-core/src/algorithms/approx/face.rs +++ b/crates/fj-core/src/algorithms/approx/face.rs @@ -13,13 +13,13 @@ use crate::{ use super::{ cycle::{approx_cycle, CycleApprox}, - half_edge::HalfEdgeApproxCache, + half_edge::ApproxCache, Approx, ApproxPoint, Tolerance, }; impl Approx for &ObjectSet { type Approximation = BTreeSet; - type Cache = HalfEdgeApproxCache; + type Cache = ApproxCache; fn approx_with_cache( self, @@ -68,7 +68,7 @@ impl Approx for &ObjectSet { pub fn approx_face( face: Handle, tolerance: impl Into, - cache: &mut HalfEdgeApproxCache, + cache: &mut ApproxCache, geometry: &Geometry, ) -> FaceApprox { let tolerance = tolerance.into(); diff --git a/crates/fj-core/src/algorithms/approx/half_edge.rs b/crates/fj-core/src/algorithms/approx/half_edge.rs index d2b3f6931..dd3d7a616 100644 --- a/crates/fj-core/src/algorithms/approx/half_edge.rs +++ b/crates/fj-core/src/algorithms/approx/half_edge.rs @@ -24,7 +24,7 @@ pub fn approx_half_edge( surface: &Handle, boundary: CurveBoundary>, tolerance: impl Into, - cache: &mut HalfEdgeApproxCache, + cache: &mut ApproxCache, geometry: &Geometry, ) -> HalfEdgeApprox { let tolerance = tolerance.into(); @@ -81,7 +81,7 @@ pub struct HalfEdgeApprox { /// Cache for half-edge approximations #[derive(Default)] -pub struct HalfEdgeApproxCache { +pub struct ApproxCache { /// Cache for vertex approximations pub vertex: VertexApproxCache, diff --git a/crates/fj-core/src/algorithms/approx/shell.rs b/crates/fj-core/src/algorithms/approx/shell.rs index 2bdde91b6..602a76181 100644 --- a/crates/fj-core/src/algorithms/approx/shell.rs +++ b/crates/fj-core/src/algorithms/approx/shell.rs @@ -4,13 +4,11 @@ use std::collections::BTreeSet; use crate::{geometry::Geometry, topology::Shell}; -use super::{ - face::FaceApprox, half_edge::HalfEdgeApproxCache, Approx, Tolerance, -}; +use super::{face::FaceApprox, half_edge::ApproxCache, Approx, Tolerance}; impl Approx for &Shell { type Approximation = BTreeSet; - type Cache = HalfEdgeApproxCache; + type Cache = ApproxCache; fn approx_with_cache( self, diff --git a/crates/fj-core/src/algorithms/approx/sketch.rs b/crates/fj-core/src/algorithms/approx/sketch.rs index 192d5ac56..c5b8d081d 100644 --- a/crates/fj-core/src/algorithms/approx/sketch.rs +++ b/crates/fj-core/src/algorithms/approx/sketch.rs @@ -4,13 +4,11 @@ use std::collections::BTreeSet; use crate::{geometry::Geometry, topology::Sketch}; -use super::{ - face::FaceApprox, half_edge::HalfEdgeApproxCache, Approx, Tolerance, -}; +use super::{face::FaceApprox, half_edge::ApproxCache, Approx, Tolerance}; impl Approx for &Sketch { type Approximation = BTreeSet; - type Cache = HalfEdgeApproxCache; + type Cache = ApproxCache; fn approx_with_cache( self, diff --git a/crates/fj-core/src/algorithms/approx/solid.rs b/crates/fj-core/src/algorithms/approx/solid.rs index 3592100c2..d8234fa1f 100644 --- a/crates/fj-core/src/algorithms/approx/solid.rs +++ b/crates/fj-core/src/algorithms/approx/solid.rs @@ -5,12 +5,12 @@ use std::collections::BTreeSet; use crate::{geometry::Geometry, topology::Solid}; use super::{ - face::FaceApprox, half_edge::HalfEdgeApproxCache, Approx, Tolerance, + face::FaceApprox, half_edge::ApproxCache, Approx, Tolerance, }; impl Approx for &Solid { type Approximation = BTreeSet; - type Cache = HalfEdgeApproxCache; + type Cache = ApproxCache; fn approx_with_cache( self, diff --git a/crates/fj-core/src/algorithms/triangulate/mod.rs b/crates/fj-core/src/algorithms/triangulate/mod.rs index 916511c24..46ad49977 100644 --- a/crates/fj-core/src/algorithms/triangulate/mod.rs +++ b/crates/fj-core/src/algorithms/triangulate/mod.rs @@ -81,7 +81,7 @@ mod tests { use crate::{ algorithms::approx::{ - face::approx_face, half_edge::HalfEdgeApproxCache, Tolerance, + face::approx_face, half_edge::ApproxCache, Tolerance, }, operations::{ build::{BuildCycle, BuildFace}, @@ -314,7 +314,7 @@ mod tests { Ok(approx_face( face, tolerance, - &mut HalfEdgeApproxCache::default(), + &mut ApproxCache::default(), &core.layers.geometry, ) .triangulate(core))