diff --git a/crates/fj-core/src/operations/holes.rs b/crates/fj-core/src/operations/holes.rs index 4c7f8abb8..d479ddc12 100644 --- a/crates/fj-core/src/operations/holes.rs +++ b/crates/fj-core/src/operations/holes.rs @@ -50,7 +50,7 @@ impl AddHole for Shell { core, ) .sweep_region( - location.face.surface(), + location.face.surface().clone(), None, path, &mut SweepCache::default(), @@ -113,7 +113,7 @@ impl AddHole for Shell { core, ) .sweep_region( - entry_location.face.surface(), + entry_location.face.surface().clone(), None, path, &mut SweepCache::default(), diff --git a/crates/fj-core/src/operations/sweep/cycle.rs b/crates/fj-core/src/operations/sweep/cycle.rs index 7a9c4b91b..30fedb345 100644 --- a/crates/fj-core/src/operations/sweep/cycle.rs +++ b/crates/fj-core/src/operations/sweep/cycle.rs @@ -2,11 +2,11 @@ use fj_interop::Color; use fj_math::Vector; use crate::{ - geometry::SurfaceGeometry, operations::{ build::BuildCycle, join::JoinCycle, sweep::half_edge::SweepHalfEdge, }, - topology::{Cycle, Face}, + storage::Handle, + topology::{Cycle, Face, Surface}, Core, }; @@ -38,7 +38,7 @@ pub trait SweepCycle { /// operation is called in, and therefore falls outside of its scope. fn sweep_cycle( &self, - surface: &SurfaceGeometry, + surface: Handle, color: Option, path: impl Into>, cache: &mut SweepCache, @@ -49,7 +49,7 @@ pub trait SweepCycle { impl SweepCycle for Cycle { fn sweep_cycle( &self, - surface: &SurfaceGeometry, + surface: Handle, color: Option, path: impl Into>, cache: &mut SweepCache, @@ -66,7 +66,7 @@ impl SweepCycle for Cycle { let (side_face, top_edge) = bottom_half_edge.sweep_half_edge( bottom_half_edge_next.start_vertex().clone(), - surface, + surface.clone(), color, path, cache, diff --git a/crates/fj-core/src/operations/sweep/face.rs b/crates/fj-core/src/operations/sweep/face.rs index d02376383..f06be7cc2 100644 --- a/crates/fj-core/src/operations/sweep/face.rs +++ b/crates/fj-core/src/operations/sweep/face.rs @@ -50,7 +50,7 @@ impl SweepFace for Handle { let other_faces = bottom_face .region() .sweep_region( - bottom_face.surface(), + bottom_face.surface().clone(), bottom_face.region().get_color(core), path, cache, diff --git a/crates/fj-core/src/operations/sweep/half_edge.rs b/crates/fj-core/src/operations/sweep/half_edge.rs index 1aa8a30af..49f657c54 100644 --- a/crates/fj-core/src/operations/sweep/half_edge.rs +++ b/crates/fj-core/src/operations/sweep/half_edge.rs @@ -2,7 +2,6 @@ use fj_interop::{ext::ArrayExt, Color}; use fj_math::{Point, Scalar, Vector}; use crate::{ - geometry::SurfaceGeometry, operations::{ build::{BuildCycle, BuildHalfEdge}, geometry::UpdateHalfEdgeGeometry, @@ -11,7 +10,7 @@ use crate::{ update::{UpdateCycle, UpdateHalfEdge}, }, storage::Handle, - topology::{Cycle, Face, HalfEdge, Region, Vertex}, + topology::{Cycle, Face, HalfEdge, Region, Surface, Vertex}, Core, }; @@ -39,7 +38,7 @@ pub trait SweepHalfEdge { fn sweep_half_edge( &self, end_vertex: Handle, - surface: &SurfaceGeometry, + surface: Handle, color: Option, path: impl Into>, cache: &mut SweepCache, @@ -51,7 +50,7 @@ impl SweepHalfEdge for Handle { fn sweep_half_edge( &self, end_vertex: Handle, - surface: &SurfaceGeometry, + surface: Handle, color: Option, path: impl Into>, cache: &mut SweepCache, @@ -60,7 +59,11 @@ impl SweepHalfEdge for Handle { let path = path.into(); let geometry = core.layers.geometry.of_half_edge(self); - let surface = geometry.path.sweep_surface_path(surface, path, core); + let surface = geometry.path.sweep_surface_path( + &core.layers.geometry.of_surface(&surface), + path, + core, + ); // Next, we need to define the boundaries of the face. Let's start with // the global vertices and edges. diff --git a/crates/fj-core/src/operations/sweep/region.rs b/crates/fj-core/src/operations/sweep/region.rs index 4112b7e1c..05af614b7 100644 --- a/crates/fj-core/src/operations/sweep/region.rs +++ b/crates/fj-core/src/operations/sweep/region.rs @@ -2,7 +2,6 @@ use fj_interop::Color; use fj_math::Vector; use crate::{ - geometry::SurfaceGeometry, operations::{ insert::Insert, reverse::Reverse, transform::TransformObject, }, @@ -32,7 +31,7 @@ pub trait SweepRegion { /// operation's scope. fn sweep_region( &self, - surface: &Handle, + surface: Handle, color: Option, path: impl Into>, cache: &mut SweepCache, @@ -43,7 +42,7 @@ pub trait SweepRegion { impl SweepRegion for Region { fn sweep_region( &self, - surface: &Handle, + surface: Handle, color: Option, path: impl Into>, cache: &mut SweepCache, @@ -55,7 +54,7 @@ impl SweepRegion for Region { let top_exterior = sweep_cycle( self.exterior(), - &core.layers.geometry.of_surface(surface), + surface.clone(), color, &mut faces, path, @@ -69,7 +68,7 @@ impl SweepRegion for Region { .map(|bottom_cycle| { sweep_cycle( bottom_cycle, - &core.layers.geometry.of_surface(surface), + surface.clone(), color, &mut faces, path, @@ -96,7 +95,7 @@ impl SweepRegion for Region { fn sweep_cycle( bottom_cycle: &Cycle, - bottom_surface: &SurfaceGeometry, + bottom_surface: Handle, color: Option, faces: &mut Vec, path: Vector<3>, diff --git a/crates/fj-core/src/operations/sweep/shell_face.rs b/crates/fj-core/src/operations/sweep/shell_face.rs index 35c3a61dc..756544936 100644 --- a/crates/fj-core/src/operations/sweep/shell_face.rs +++ b/crates/fj-core/src/operations/sweep/shell_face.rs @@ -66,7 +66,7 @@ impl SweepFaceOfShell for Shell { .derive_from(face.region().exterior(), core); let region = Region::new(exterior, []); let swept_region = region.sweep_region( - face.surface(), + face.surface().clone(), face.region().get_color(core), path, &mut cache,