diff --git a/crates/fj-kernel/src/algorithms/sweep.rs b/crates/fj-kernel/src/algorithms/sweep.rs index 0f6cf3f50..d4ad4efcf 100644 --- a/crates/fj-kernel/src/algorithms/sweep.rs +++ b/crates/fj-kernel/src/algorithms/sweep.rs @@ -12,7 +12,7 @@ use super::{CycleApprox, Tolerance}; /// Create a solid by sweeping a sketch pub fn sweep( - source: Shape, + source: Vec, path: impl Into>, tolerance: Tolerance, color: [u8; 4], @@ -455,11 +455,13 @@ mod tests { let mut shape = Shape::new(); - let _sketch = Face::builder(Surface::xy_plane(), &mut shape) + let sketch = Face::builder(Surface::xy_plane(), &mut shape) .with_exterior_polygon([[0., 0.], [1., 0.], [0., 1.]]) - .build(); + .build() + .get(); - let solid = super::sweep(shape, direction, tolerance, [255, 0, 0, 255]); + let solid = + super::sweep(vec![sketch], direction, tolerance, [255, 0, 0, 255]); let expected_vertices: Vec<_> = expected_vertices .into_iter() diff --git a/crates/fj-operations/src/sweep.rs b/crates/fj-operations/src/sweep.rs index b06b2e7b9..af541b2a7 100644 --- a/crates/fj-operations/src/sweep.rs +++ b/crates/fj-operations/src/sweep.rs @@ -1,6 +1,7 @@ use fj_interop::debug::DebugInfo; use fj_kernel::{ algorithms::{sweep, Tolerance}, + iter::ObjectIters, shape::Shape, validation::{validate, Validated, ValidationConfig, ValidationError}, }; @@ -19,7 +20,8 @@ impl ToShape for fj::Sweep { let path = Vector::from(self.path()); let color = self.shape().color(); - let swept = sweep(shape.into_inner(), path, tolerance, color); + let shape = shape.face_iter().collect::>(); + let swept = sweep(shape, path, tolerance, color); let swept = validate(swept, config)?; Ok(swept)