From c14212c89d4a403fff4fa406e02649f63185f7dd Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Tue, 28 Jun 2022 15:11:35 +0200 Subject: [PATCH] Don't rely on `Shape::faces` in 2D diff operation --- crates/fj-operations/src/difference_2d.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/crates/fj-operations/src/difference_2d.rs b/crates/fj-operations/src/difference_2d.rs index 1ed752f9f..82bd0a612 100644 --- a/crates/fj-operations/src/difference_2d.rs +++ b/crates/fj-operations/src/difference_2d.rs @@ -1,6 +1,7 @@ use fj_interop::debug::DebugInfo; use fj_kernel::{ algorithms::Tolerance, + iter::ObjectIters, objects::{Cycle, Edge, Face}, shape::{LocalForm, Shape}, validation::{validate, Validated, ValidationConfig, ValidationError}, @@ -32,13 +33,12 @@ impl ToShape for fj::Difference2d { [a, b].map(|shape| shape.to_shape(config, tolerance, debug_info)); let [a, b] = [a?, b?]; - if let Some(face) = a.faces().next() { + if let Some(face) = a.face_iter().next() { // If there's at least one face to subtract from, we can proceed. - let surface = face.get().brep().surface.clone(); + let surface = face.brep().surface.clone(); - for face in a.faces() { - let face = face.get(); + for face in a.face_iter() { let face = face.brep(); assert_eq!( @@ -57,8 +57,7 @@ impl ToShape for fj::Difference2d { } } - for face in b.faces() { - let face = face.get(); + for face in b.face_iter() { let face = face.brep(); assert_eq!(