From c3373c7ca4081993a13267874cfcd3eed1d78d4d Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 8 Feb 2024 12:25:05 +0100 Subject: [PATCH 1/5] Expect `Instance` in other reverse trait --- crates/fj-core/src/operations/build/shell.rs | 36 +++++++------------ .../fj-core/src/operations/reverse/cycle.rs | 10 ++---- crates/fj-core/src/operations/reverse/edge.rs | 4 +-- crates/fj-core/src/operations/reverse/face.rs | 29 +++++---------- crates/fj-core/src/operations/reverse/mod.rs | 5 ++- .../fj-core/src/operations/reverse/region.rs | 17 ++++----- 6 files changed, 33 insertions(+), 68 deletions(-) diff --git a/crates/fj-core/src/operations/build/shell.rs b/crates/fj-core/src/operations/build/shell.rs index 430d7b7aa..e111964ee 100644 --- a/crates/fj-core/src/operations/build/shell.rs +++ b/crates/fj-core/src/operations/build/shell.rs @@ -152,10 +152,8 @@ pub trait BuildShell { .update_half_edge( cycle.half_edges().nth_circular(0), |edge| { - edge.reverse_curve_coordinate_systems( - &mut core.services, - ) - .insert(&mut core.services) + edge.reverse_curve_coordinate_systems(core) + .insert(&mut core.services) }, ) .join_to( @@ -175,10 +173,8 @@ pub trait BuildShell { .update_half_edge( cycle.half_edges().nth_circular(1), |edge| { - edge.reverse_curve_coordinate_systems( - &mut core.services, - ) - .insert(&mut core.services) + edge.reverse_curve_coordinate_systems(core) + .insert(&mut core.services) }, ) .join_to( @@ -190,10 +186,8 @@ pub trait BuildShell { .update_half_edge( cycle.half_edges().nth_circular(0), |edge| { - edge.reverse_curve_coordinate_systems( - &mut core.services, - ) - .insert(&mut core.services) + edge.reverse_curve_coordinate_systems(core) + .insert(&mut core.services) }, ) .join_to( @@ -213,28 +207,22 @@ pub trait BuildShell { .update_half_edge( cycle.half_edges().nth_circular(0), |edge| { - edge.reverse_curve_coordinate_systems( - &mut core.services, - ) - .insert(&mut core.services) + edge.reverse_curve_coordinate_systems(core) + .insert(&mut core.services) }, ) .update_half_edge( cycle.half_edges().nth_circular(1), |edge| { - edge.reverse_curve_coordinate_systems( - &mut core.services, - ) - .insert(&mut core.services) + edge.reverse_curve_coordinate_systems(core) + .insert(&mut core.services) }, ) .update_half_edge( cycle.half_edges().nth_circular(2), |edge| { - edge.reverse_curve_coordinate_systems( - &mut core.services, - ) - .insert(&mut core.services) + edge.reverse_curve_coordinate_systems(core) + .insert(&mut core.services) }, ) .join_to( diff --git a/crates/fj-core/src/operations/reverse/cycle.rs b/crates/fj-core/src/operations/reverse/cycle.rs index 04a6566d1..53ec902bd 100644 --- a/crates/fj-core/src/operations/reverse/cycle.rs +++ b/crates/fj-core/src/operations/reverse/cycle.rs @@ -1,7 +1,6 @@ use crate::{ objects::{Cycle, HalfEdge}, operations::insert::Insert, - services::Services, Instance, }; @@ -30,13 +29,10 @@ impl Reverse for Cycle { } impl ReverseCurveCoordinateSystems for Cycle { - fn reverse_curve_coordinate_systems( - &self, - services: &mut Services, - ) -> Self { + fn reverse_curve_coordinate_systems(&self, core: &mut Instance) -> Self { let edges = self.half_edges().iter().map(|edge| { - edge.reverse_curve_coordinate_systems(services) - .insert(services) + edge.reverse_curve_coordinate_systems(core) + .insert(&mut core.services) }); Cycle::new(edges) diff --git a/crates/fj-core/src/operations/reverse/edge.rs b/crates/fj-core/src/operations/reverse/edge.rs index 3820d0422..95c1a35c5 100644 --- a/crates/fj-core/src/operations/reverse/edge.rs +++ b/crates/fj-core/src/operations/reverse/edge.rs @@ -1,9 +1,9 @@ -use crate::{objects::HalfEdge, services::Services}; +use crate::{objects::HalfEdge, Instance}; use super::ReverseCurveCoordinateSystems; impl ReverseCurveCoordinateSystems for HalfEdge { - fn reverse_curve_coordinate_systems(&self, _: &mut Services) -> Self { + fn reverse_curve_coordinate_systems(&self, _: &mut Instance) -> Self { let path = self.path().reverse(); let boundary = self.boundary().reverse(); diff --git a/crates/fj-core/src/operations/reverse/face.rs b/crates/fj-core/src/operations/reverse/face.rs index d3f7f3afe..bf8dd0e56 100644 --- a/crates/fj-core/src/operations/reverse/face.rs +++ b/crates/fj-core/src/operations/reverse/face.rs @@ -6,7 +6,6 @@ use crate::{ build::Polygon, insert::{Insert, IsInsertedNo, IsInsertedYes}, }, - services::Services, Instance, }; @@ -36,14 +35,11 @@ impl Reverse for Polygon { } impl ReverseCurveCoordinateSystems for Face { - fn reverse_curve_coordinate_systems( - &self, - services: &mut Services, - ) -> Self { + fn reverse_curve_coordinate_systems(&self, core: &mut Instance) -> Self { let region = self .region() - .reverse_curve_coordinate_systems(services) - .insert(services); + .reverse_curve_coordinate_systems(core) + .insert(&mut core.services); Face::new(self.surface().clone(), region) } } @@ -51,14 +47,8 @@ impl ReverseCurveCoordinateSystems for Face { impl ReverseCurveCoordinateSystems for Polygon { - fn reverse_curve_coordinate_systems( - &self, - services: &mut Services, - ) -> Self { - let face = self - .face - .borrow() - .reverse_curve_coordinate_systems(services); + fn reverse_curve_coordinate_systems(&self, core: &mut Instance) -> Self { + let face = self.face.borrow().reverse_curve_coordinate_systems(core); self.replace_face(face) } } @@ -66,14 +56,11 @@ impl ReverseCurveCoordinateSystems impl ReverseCurveCoordinateSystems for Polygon { - fn reverse_curve_coordinate_systems( - &self, - services: &mut Services, - ) -> Self { + fn reverse_curve_coordinate_systems(&self, core: &mut Instance) -> Self { let face: &Face = self.face.borrow(); let face = face - .reverse_curve_coordinate_systems(services) - .insert(services); + .reverse_curve_coordinate_systems(core) + .insert(&mut core.services); self.replace_face(face) } diff --git a/crates/fj-core/src/operations/reverse/mod.rs b/crates/fj-core/src/operations/reverse/mod.rs index 86b9b88ce..3ebad8284 100644 --- a/crates/fj-core/src/operations/reverse/mod.rs +++ b/crates/fj-core/src/operations/reverse/mod.rs @@ -1,6 +1,6 @@ //! Reverse the direction/orientation of objects -use crate::{services::Services, Instance}; +use crate::Instance; mod cycle; mod edge; @@ -20,6 +20,5 @@ pub trait ReverseCurveCoordinateSystems { /// /// This will not have any effect on object positions in global coordinates. #[must_use] - fn reverse_curve_coordinate_systems(&self, services: &mut Services) - -> Self; + fn reverse_curve_coordinate_systems(&self, core: &mut Instance) -> Self; } diff --git a/crates/fj-core/src/operations/reverse/region.rs b/crates/fj-core/src/operations/reverse/region.rs index 638ca675e..624719a02 100644 --- a/crates/fj-core/src/operations/reverse/region.rs +++ b/crates/fj-core/src/operations/reverse/region.rs @@ -1,6 +1,4 @@ -use crate::{ - objects::Region, operations::insert::Insert, services::Services, Instance, -}; +use crate::{objects::Region, operations::insert::Insert, Instance}; use super::{Reverse, ReverseCurveCoordinateSystems}; @@ -17,18 +15,15 @@ impl Reverse for Region { } impl ReverseCurveCoordinateSystems for Region { - fn reverse_curve_coordinate_systems( - &self, - services: &mut Services, - ) -> Self { + fn reverse_curve_coordinate_systems(&self, core: &mut Instance) -> Self { let exterior = self .exterior() - .reverse_curve_coordinate_systems(services) - .insert(services); + .reverse_curve_coordinate_systems(core) + .insert(&mut core.services); let interiors = self.interiors().iter().map(|cycle| { cycle - .reverse_curve_coordinate_systems(services) - .insert(services) + .reverse_curve_coordinate_systems(core) + .insert(&mut core.services) }); Region::new(exterior, interiors, self.color()) From a362ae3980af85eb0e0727190b60d54afeb480cb Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 8 Feb 2024 12:29:11 +0100 Subject: [PATCH 2/5] Require `Instance` in `TransformObject::translate` --- crates/fj-core/src/algorithms/intersect/ray_face.rs | 12 ++++++------ crates/fj-core/src/operations/sweep/region.rs | 5 ++--- crates/fj-core/src/operations/transform/mod.rs | 5 +++-- models/all/src/lib.rs | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/crates/fj-core/src/algorithms/intersect/ray_face.rs b/crates/fj-core/src/algorithms/intersect/ray_face.rs index 81226b09f..e5cf63e17 100644 --- a/crates/fj-core/src/algorithms/intersect/ray_face.rs +++ b/crates/fj-core/src/algorithms/intersect/ray_face.rs @@ -177,7 +177,7 @@ mod tests { }) .insert(&mut core.services) }); - let face = face.translate([-1., 0., 0.], &mut core.services); + let face = face.translate([-1., 0., 0.], &mut core); assert_eq!((&ray, &face).intersect(), None); } @@ -201,7 +201,7 @@ mod tests { }) .insert(&mut core.services) }); - let face = face.translate([1., 0., 0.], &mut core.services); + let face = face.translate([1., 0., 0.], &mut core); assert_eq!( (&ray, &face).intersect(), @@ -228,7 +228,7 @@ mod tests { }) .insert(&mut core.services) }); - let face = face.translate([0., 0., 2.], &mut core.services); + let face = face.translate([0., 0., 2.], &mut core); assert_eq!((&ray, &face).intersect(), None); } @@ -252,7 +252,7 @@ mod tests { }) .insert(&mut core.services) }); - let face = face.translate([1., 1., 0.], &mut core.services); + let face = face.translate([1., 1., 0.], &mut core); let edge = face .region() @@ -286,7 +286,7 @@ mod tests { }) .insert(&mut core.services) }); - let face = face.translate([1., 1., 1.], &mut core.services); + let face = face.translate([1., 1., 1.], &mut core); let vertex = face .region() @@ -347,7 +347,7 @@ mod tests { }) .insert(&mut core.services) }); - let face = face.translate([0., 0., 1.], &mut core.services); + let face = face.translate([0., 0., 1.], &mut core); assert_eq!((&ray, &face).intersect(), None); } diff --git a/crates/fj-core/src/operations/sweep/region.rs b/crates/fj-core/src/operations/sweep/region.rs index bc54c7148..2388c421a 100644 --- a/crates/fj-core/src/operations/sweep/region.rs +++ b/crates/fj-core/src/operations/sweep/region.rs @@ -77,9 +77,8 @@ impl SweepRegion for Region { .collect::>(); let top_face = { - let top_surface = surface - .translate(path, &mut core.services) - .insert(&mut core.services); + let top_surface = + surface.translate(path, core).insert(&mut core.services); let top_region = Region::new(top_exterior, top_interiors, self.color()) .insert(&mut core.services); diff --git a/crates/fj-core/src/operations/transform/mod.rs b/crates/fj-core/src/operations/transform/mod.rs index e37de3d59..1a45e9cb8 100644 --- a/crates/fj-core/src/operations/transform/mod.rs +++ b/crates/fj-core/src/operations/transform/mod.rs @@ -19,6 +19,7 @@ use crate::{ operations::insert::Insert, services::Services, storage::{Handle, ObjectId}, + Instance, }; /// Transform an object @@ -55,9 +56,9 @@ pub trait TransformObject: Sized { fn translate( &self, offset: impl Into>, - services: &mut Services, + core: &mut Instance, ) -> Self { - self.transform(&Transform::translation(offset), services) + self.transform(&Transform::translation(offset), &mut core.services) } /// Rotate the object diff --git a/models/all/src/lib.rs b/models/all/src/lib.rs index 736b39820..5bc88efd5 100644 --- a/models/all/src/lib.rs +++ b/models/all/src/lib.rs @@ -33,7 +33,7 @@ pub fn model(core: &mut fj::core::Instance) -> Solid { let f = i as f64; let model = model - .translate(offset * f, &mut core.services) + .translate(offset * f, core) .rotate(axis * angle_rad * f, &mut core.services); all = all.merge(&model); From 33c4ab17583cc14d3028c76f05f0a12321bb6c39 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 8 Feb 2024 12:30:30 +0100 Subject: [PATCH 3/5] Require `Instance` in `TransformObject::rotate` --- crates/fj-core/src/operations/transform/mod.rs | 4 ++-- models/all/src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/fj-core/src/operations/transform/mod.rs b/crates/fj-core/src/operations/transform/mod.rs index 1a45e9cb8..b8d5c732e 100644 --- a/crates/fj-core/src/operations/transform/mod.rs +++ b/crates/fj-core/src/operations/transform/mod.rs @@ -67,9 +67,9 @@ pub trait TransformObject: Sized { fn rotate( &self, axis_angle: impl Into>, - services: &mut Services, + core: &mut Instance, ) -> Self { - self.transform(&Transform::rotation(axis_angle), services) + self.transform(&Transform::rotation(axis_angle), &mut core.services) } } diff --git a/models/all/src/lib.rs b/models/all/src/lib.rs index 5bc88efd5..d4f8e0c9e 100644 --- a/models/all/src/lib.rs +++ b/models/all/src/lib.rs @@ -34,7 +34,7 @@ pub fn model(core: &mut fj::core::Instance) -> Solid { let model = model .translate(offset * f, core) - .rotate(axis * angle_rad * f, &mut core.services); + .rotate(axis * angle_rad * f, core); all = all.merge(&model); } From e8f9c659ab591ed9fde8b2ba70e0403b078aa0a3 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 8 Feb 2024 12:31:41 +0100 Subject: [PATCH 4/5] Expect `Instance` in `TransformObject::transform` --- .../src/algorithms/intersect/surface_surface.rs | 2 +- crates/fj-core/src/operations/transform/mod.rs | 12 ++++-------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/crates/fj-core/src/algorithms/intersect/surface_surface.rs b/crates/fj-core/src/algorithms/intersect/surface_surface.rs index 6938c77c2..2b77545ac 100644 --- a/crates/fj-core/src/algorithms/intersect/surface_surface.rs +++ b/crates/fj-core/src/algorithms/intersect/surface_surface.rs @@ -94,7 +94,7 @@ mod tests { xy.clone(), xy.clone().transform( &Transform::translation([0., 0., 1.],), - &mut core.services + &mut core ) ],), None, diff --git a/crates/fj-core/src/operations/transform/mod.rs b/crates/fj-core/src/operations/transform/mod.rs index b8d5c732e..9b1f08cc3 100644 --- a/crates/fj-core/src/operations/transform/mod.rs +++ b/crates/fj-core/src/operations/transform/mod.rs @@ -33,13 +33,9 @@ use crate::{ /// hasn't been done so far, is that no one has put in the work yet. pub trait TransformObject: Sized { /// Transform the object - fn transform( - &self, - transform: &Transform, - services: &mut Services, - ) -> Self { + fn transform(&self, transform: &Transform, core: &mut Instance) -> Self { let mut cache = TransformCache::default(); - self.transform_with_cache(transform, services, &mut cache) + self.transform_with_cache(transform, &mut core.services, &mut cache) } /// Transform the object using the provided cache @@ -58,7 +54,7 @@ pub trait TransformObject: Sized { offset: impl Into>, core: &mut Instance, ) -> Self { - self.transform(&Transform::translation(offset), &mut core.services) + self.transform(&Transform::translation(offset), core) } /// Rotate the object @@ -69,7 +65,7 @@ pub trait TransformObject: Sized { axis_angle: impl Into>, core: &mut Instance, ) -> Self { - self.transform(&Transform::rotation(axis_angle), &mut core.services) + self.transform(&Transform::rotation(axis_angle), core) } } From 1ecf33795206f85b035e9117df1ae9dce722932d Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Thu, 8 Feb 2024 12:34:49 +0100 Subject: [PATCH 5/5] Require `&mut Instance` in `transform_with_cache` --- crates/fj-core/src/operations/transform/curve.rs | 4 ++-- crates/fj-core/src/operations/transform/cycle.rs | 7 +++---- crates/fj-core/src/operations/transform/edge.rs | 8 ++++---- crates/fj-core/src/operations/transform/face.rs | 8 ++++---- crates/fj-core/src/operations/transform/mod.rs | 11 +++++------ crates/fj-core/src/operations/transform/region.rs | 8 ++++---- crates/fj-core/src/operations/transform/shell.rs | 13 +++++++------ crates/fj-core/src/operations/transform/solid.rs | 11 ++++++----- crates/fj-core/src/operations/transform/surface.rs | 4 ++-- crates/fj-core/src/operations/transform/vertex.rs | 4 ++-- 10 files changed, 39 insertions(+), 39 deletions(-) diff --git a/crates/fj-core/src/operations/transform/curve.rs b/crates/fj-core/src/operations/transform/curve.rs index 0651e69dd..5b17aed34 100644 --- a/crates/fj-core/src/operations/transform/curve.rs +++ b/crates/fj-core/src/operations/transform/curve.rs @@ -1,6 +1,6 @@ use fj_math::Transform; -use crate::{objects::Curve, services::Services}; +use crate::{objects::Curve, Instance}; use super::{TransformCache, TransformObject}; @@ -8,7 +8,7 @@ impl TransformObject for Curve { fn transform_with_cache( &self, _: &Transform, - _: &mut Services, + _: &mut Instance, _: &mut TransformCache, ) -> Self { // There's nothing to actually transform here, as `Curve` holds no data. diff --git a/crates/fj-core/src/operations/transform/cycle.rs b/crates/fj-core/src/operations/transform/cycle.rs index 66e2938ef..6f64536da 100644 --- a/crates/fj-core/src/operations/transform/cycle.rs +++ b/crates/fj-core/src/operations/transform/cycle.rs @@ -1,6 +1,6 @@ use fj_math::Transform; -use crate::{objects::Cycle, services::Services}; +use crate::{objects::Cycle, Instance}; use super::{TransformCache, TransformObject}; @@ -8,12 +8,11 @@ impl TransformObject for Cycle { fn transform_with_cache( &self, transform: &Transform, - services: &mut Services, + core: &mut Instance, cache: &mut TransformCache, ) -> Self { let edges = self.half_edges().iter().map(|edge| { - edge.clone() - .transform_with_cache(transform, services, cache) + edge.clone().transform_with_cache(transform, core, cache) }); Self::new(edges) diff --git a/crates/fj-core/src/operations/transform/edge.rs b/crates/fj-core/src/operations/transform/edge.rs index 3ccba88cc..78781bf1e 100644 --- a/crates/fj-core/src/operations/transform/edge.rs +++ b/crates/fj-core/src/operations/transform/edge.rs @@ -1,6 +1,6 @@ use fj_math::Transform; -use crate::{objects::HalfEdge, services::Services}; +use crate::{objects::HalfEdge, Instance}; use super::{TransformCache, TransformObject}; @@ -8,7 +8,7 @@ impl TransformObject for HalfEdge { fn transform_with_cache( &self, transform: &Transform, - services: &mut Services, + core: &mut Instance, cache: &mut TransformCache, ) -> Self { // Don't need to transform the path, as that's defined in surface @@ -18,11 +18,11 @@ impl TransformObject for HalfEdge { let curve = self .curve() .clone() - .transform_with_cache(transform, services, cache); + .transform_with_cache(transform, core, cache); let start_vertex = self .start_vertex() .clone() - .transform_with_cache(transform, services, cache); + .transform_with_cache(transform, core, cache); Self::new(path, boundary, curve, start_vertex) } diff --git a/crates/fj-core/src/operations/transform/face.rs b/crates/fj-core/src/operations/transform/face.rs index 684271bb5..f217a1c18 100644 --- a/crates/fj-core/src/operations/transform/face.rs +++ b/crates/fj-core/src/operations/transform/face.rs @@ -1,6 +1,6 @@ use fj_math::Transform; -use crate::{objects::Face, services::Services}; +use crate::{objects::Face, Instance}; use super::{TransformCache, TransformObject}; @@ -8,17 +8,17 @@ impl TransformObject for Face { fn transform_with_cache( &self, transform: &Transform, - services: &mut Services, + core: &mut Instance, cache: &mut TransformCache, ) -> Self { let surface = self .surface() .clone() - .transform_with_cache(transform, services, cache); + .transform_with_cache(transform, core, cache); let region = self .region() .clone() - .transform_with_cache(transform, services, cache); + .transform_with_cache(transform, core, cache); Self::new(surface, region) } diff --git a/crates/fj-core/src/operations/transform/mod.rs b/crates/fj-core/src/operations/transform/mod.rs index 9b1f08cc3..f31e65de0 100644 --- a/crates/fj-core/src/operations/transform/mod.rs +++ b/crates/fj-core/src/operations/transform/mod.rs @@ -17,7 +17,6 @@ use type_map::TypeMap; use crate::{ operations::insert::Insert, - services::Services, storage::{Handle, ObjectId}, Instance, }; @@ -35,14 +34,14 @@ pub trait TransformObject: Sized { /// Transform the object fn transform(&self, transform: &Transform, core: &mut Instance) -> Self { let mut cache = TransformCache::default(); - self.transform_with_cache(transform, &mut core.services, &mut cache) + self.transform_with_cache(transform, core, &mut cache) } /// Transform the object using the provided cache fn transform_with_cache( &self, transform: &Transform, - services: &mut Services, + core: &mut Instance, cache: &mut TransformCache, ) -> Self; @@ -76,7 +75,7 @@ where fn transform_with_cache( &self, transform: &Transform, - services: &mut Services, + core: &mut Instance, cache: &mut TransformCache, ) -> Self { if let Some(object) = cache.get(self) { @@ -85,8 +84,8 @@ where let transformed = self .clone_object() - .transform_with_cache(transform, services, cache) - .insert(services); + .transform_with_cache(transform, core, cache) + .insert(&mut core.services); cache.insert(self.clone(), transformed.clone()); diff --git a/crates/fj-core/src/operations/transform/region.rs b/crates/fj-core/src/operations/transform/region.rs index 3cef63d47..48e79e2bf 100644 --- a/crates/fj-core/src/operations/transform/region.rs +++ b/crates/fj-core/src/operations/transform/region.rs @@ -1,4 +1,4 @@ -use crate::objects::Region; +use crate::{objects::Region, Instance}; use super::TransformObject; @@ -6,7 +6,7 @@ impl TransformObject for Region { fn transform_with_cache( &self, transform: &fj_math::Transform, - services: &mut crate::services::Services, + core: &mut Instance, cache: &mut super::TransformCache, ) -> Self { // Color does not need to be transformed. @@ -15,9 +15,9 @@ impl TransformObject for Region { let exterior = self .exterior() .clone() - .transform_with_cache(transform, services, cache); + .transform_with_cache(transform, core, cache); let interiors = self.interiors().iter().cloned().map(|interior| { - interior.transform_with_cache(transform, services, cache) + interior.transform_with_cache(transform, core, cache) }); Region::new(exterior, interiors, color) diff --git a/crates/fj-core/src/operations/transform/shell.rs b/crates/fj-core/src/operations/transform/shell.rs index bb7cfba46..4132b6af1 100644 --- a/crates/fj-core/src/operations/transform/shell.rs +++ b/crates/fj-core/src/operations/transform/shell.rs @@ -1,6 +1,6 @@ use fj_math::Transform; -use crate::{objects::Shell, services::Services}; +use crate::{objects::Shell, Instance}; use super::{TransformCache, TransformObject}; @@ -8,13 +8,14 @@ impl TransformObject for Shell { fn transform_with_cache( &self, transform: &Transform, - services: &mut Services, + core: &mut Instance, cache: &mut TransformCache, ) -> Self { - let faces = - self.faces().iter().cloned().map(|face| { - face.transform_with_cache(transform, services, cache) - }); + let faces = self + .faces() + .iter() + .cloned() + .map(|face| face.transform_with_cache(transform, core, cache)); Self::new(faces) } diff --git a/crates/fj-core/src/operations/transform/solid.rs b/crates/fj-core/src/operations/transform/solid.rs index b0a77e2a8..a1c3ddb66 100644 --- a/crates/fj-core/src/operations/transform/solid.rs +++ b/crates/fj-core/src/operations/transform/solid.rs @@ -1,6 +1,6 @@ use fj_math::Transform; -use crate::{objects::Solid, services::Services}; +use crate::{objects::Solid, Instance}; use super::{TransformCache, TransformObject}; @@ -8,12 +8,13 @@ impl TransformObject for Solid { fn transform_with_cache( &self, transform: &Transform, - services: &mut Services, + core: &mut Instance, cache: &mut TransformCache, ) -> Self { - let shells = self.shells().iter().cloned().map(|shell| { - shell.transform_with_cache(transform, services, cache) - }); + let shells = + self.shells().iter().cloned().map(|shell| { + shell.transform_with_cache(transform, core, cache) + }); Self::new(shells) } diff --git a/crates/fj-core/src/operations/transform/surface.rs b/crates/fj-core/src/operations/transform/surface.rs index 5ae5fa21d..eb21e06d0 100644 --- a/crates/fj-core/src/operations/transform/surface.rs +++ b/crates/fj-core/src/operations/transform/surface.rs @@ -1,6 +1,6 @@ use fj_math::Transform; -use crate::{objects::Surface, services::Services}; +use crate::{objects::Surface, Instance}; use super::{TransformCache, TransformObject}; @@ -8,7 +8,7 @@ impl TransformObject for Surface { fn transform_with_cache( &self, transform: &Transform, - _: &mut Services, + _: &mut Instance, _: &mut TransformCache, ) -> Self { let geometry = self.geometry().transform(transform); diff --git a/crates/fj-core/src/operations/transform/vertex.rs b/crates/fj-core/src/operations/transform/vertex.rs index 02854d44f..c89bbe38a 100644 --- a/crates/fj-core/src/operations/transform/vertex.rs +++ b/crates/fj-core/src/operations/transform/vertex.rs @@ -1,6 +1,6 @@ use fj_math::Transform; -use crate::{objects::Vertex, services::Services}; +use crate::{objects::Vertex, Instance}; use super::{TransformCache, TransformObject}; @@ -8,7 +8,7 @@ impl TransformObject for Vertex { fn transform_with_cache( &self, _: &Transform, - _: &mut Services, + _: &mut Instance, _: &mut TransformCache, ) -> Self { // There's nothing to actually transform here, as `Vertex` holds no