diff --git a/crates/fj-kernel/src/algorithms/sweep.rs b/crates/fj-kernel/src/algorithms/sweep.rs index f1295ee24c..ab8839bb57 100644 --- a/crates/fj-kernel/src/algorithms/sweep.rs +++ b/crates/fj-kernel/src/algorithms/sweep.rs @@ -266,8 +266,7 @@ impl Relation { }; exteriors - .0 - .iter() + .as_handle() .map(|cycle| self.cycles.get(cycle).unwrap().clone()) .collect() } @@ -283,8 +282,7 @@ impl Relation { }; interiors - .0 - .iter() + .as_handle() .map(|cycle| self.cycles.get(cycle).unwrap().clone()) .collect() } diff --git a/crates/fj-kernel/src/shape/validate.rs b/crates/fj-kernel/src/shape/validate.rs index deca757adb..823d335a97 100644 --- a/crates/fj-kernel/src/shape/validate.rs +++ b/crates/fj-kernel/src/shape/validate.rs @@ -149,7 +149,7 @@ impl Validate for Face { if !stores.surfaces.contains(surface) { missing_surface = Some(surface.clone()); } - for cycle in exteriors.0.iter().chain(&interiors.0) { + for cycle in exteriors.as_handle().chain(interiors.as_handle()) { if !stores.cycles.contains(cycle) { missing_cycles.insert(cycle.clone()); } diff --git a/crates/fj-kernel/src/topology/faces.rs b/crates/fj-kernel/src/topology/faces.rs index cff40c993d..c66231928a 100644 --- a/crates/fj-kernel/src/topology/faces.rs +++ b/crates/fj-kernel/src/topology/faces.rs @@ -171,6 +171,11 @@ impl CyclesInFace { } fn as_canonical(&self) -> impl Iterator> + '_ { - self.0.iter().map(|edge| edge.get()) + self.as_handle().map(|edge| edge.get()) + } + + /// Access an iterator over handles to the cycles + pub fn as_handle(&self) -> impl Iterator>> + '_ { + self.0.iter() } } diff --git a/crates/fj-operations/src/group.rs b/crates/fj-operations/src/group.rs index a18f0d9229..5b4c21ba63 100644 --- a/crates/fj-operations/src/group.rs +++ b/crates/fj-operations/src/group.rs @@ -96,8 +96,12 @@ fn copy_shape(orig: Shape, target: &mut Shape) { target .insert(Face::new( surfaces[&surface].clone(), - exteriors.0.iter().map(|cycle| cycles[cycle].clone()), - interiors.0.iter().map(|cycle| cycles[cycle].clone()), + exteriors + .as_handle() + .map(|cycle| cycles[cycle].clone()), + interiors + .as_handle() + .map(|cycle| cycles[cycle].clone()), color, )) .unwrap();