diff --git a/crates/fj-kernel/src/algorithms/transform.rs b/crates/fj-kernel/src/algorithms/transform.rs index 4d48ba39a..31e08dd27 100644 --- a/crates/fj-kernel/src/algorithms/transform.rs +++ b/crates/fj-kernel/src/algorithms/transform.rs @@ -1,16 +1,15 @@ use fj_math::Transform; use crate::{ - iter::ObjectIters, objects::{Cycle, CyclesInFace, Edge, Face, FaceBRep, Vertex}, shape::{LocalForm, Shape}, }; /// Transform a shape -pub fn transform(shape: &Shape, transform: &Transform) -> Vec { +pub fn transform(shape: &[Face], transform: &Transform) -> Vec { let mut target = Vec::new(); - for face in shape.face_iter() { + for face in shape { let face = match face { Face::Face(face) => { let mut tmp = Shape::new(); @@ -32,7 +31,7 @@ pub fn transform(shape: &Shape, transform: &Transform) -> Vec { Face::Triangles(triangles) => { let mut target = Vec::new(); - for (triangle, color) in triangles { + for &(triangle, color) in triangles { let triangle = transform.transform_triangle(&triangle); target.push((triangle, color)); } diff --git a/crates/fj-operations/src/transform.rs b/crates/fj-operations/src/transform.rs index b44acb58b..39eb98380 100644 --- a/crates/fj-operations/src/transform.rs +++ b/crates/fj-operations/src/transform.rs @@ -1,6 +1,7 @@ use fj_interop::debug::DebugInfo; use fj_kernel::{ algorithms::{transform, Tolerance}, + iter::ObjectIters, shape::Shape, validation::{validate, Validated, ValidationConfig, ValidationError}, }; @@ -18,6 +19,7 @@ impl ToShape for fj::Transform { let shape = self.shape.to_shape(config, tolerance, debug_info)?; let shape = shape.into_inner(); + let shape = shape.face_iter().collect::>(); let faces = transform(&shape, &make_transform(self)); let mut target = Shape::new();