diff --git a/crates/fj-kernel/src/algorithms/intersection/surface_surface.rs b/crates/fj-kernel/src/algorithms/intersection/surface_surface.rs index 430da8ea7..5b771d384 100644 --- a/crates/fj-kernel/src/algorithms/intersection/surface_surface.rs +++ b/crates/fj-kernel/src/algorithms/intersection/surface_surface.rs @@ -101,7 +101,6 @@ fn project_line_into_plane( plane: &PlaneParametric, ) -> Curve<2> { let line_origin_relative_to_plane = line.origin - plane.origin; - dbg!(&line_origin_relative_to_plane); let line_origin_in_plane = Vector::from([ plane .u diff --git a/crates/fj-kernel/src/algorithms/transform.rs b/crates/fj-kernel/src/algorithms/transform.rs index 13ea5da38..af3e6f2b3 100644 --- a/crates/fj-kernel/src/algorithms/transform.rs +++ b/crates/fj-kernel/src/algorithms/transform.rs @@ -110,16 +110,20 @@ impl TransformObject for GlobalVertex { impl TransformObject for Sketch { fn transform(self, transform: &Transform) -> Self { - let mut faces = self.into_faces(); - transform_faces(&mut faces, transform); + let faces = self + .into_faces() + .into_iter() + .map(|face| face.transform(transform)); Self::from_faces(faces) } } impl TransformObject for Solid { fn transform(self, transform: &Transform) -> Self { - let mut faces = self.into_faces(); - transform_faces(&mut faces, transform); + let faces = self + .into_faces() + .into_iter() + .map(|face| face.transform(transform)); Self::from_faces(faces) } } diff --git a/crates/fj-kernel/src/objects/sketch.rs b/crates/fj-kernel/src/objects/sketch.rs index 1cf200407..69a4f7411 100644 --- a/crates/fj-kernel/src/objects/sketch.rs +++ b/crates/fj-kernel/src/objects/sketch.rs @@ -1,3 +1,5 @@ +use std::collections::BTreeSet; + use super::Face; /// A 2-dimensional shape @@ -8,7 +10,7 @@ use super::Face; /// currently validated. #[derive(Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)] pub struct Sketch { - faces: Vec, + faces: BTreeSet, } impl Sketch { @@ -24,7 +26,7 @@ impl Sketch { } /// Convert the sketch into a list of faces - pub fn into_faces(self) -> Vec { + pub fn into_faces(self) -> BTreeSet { self.faces } } diff --git a/crates/fj-kernel/src/objects/solid.rs b/crates/fj-kernel/src/objects/solid.rs index a2ce1f0e5..65c53533c 100644 --- a/crates/fj-kernel/src/objects/solid.rs +++ b/crates/fj-kernel/src/objects/solid.rs @@ -1,3 +1,5 @@ +use std::collections::BTreeSet; + use fj_math::Scalar; use crate::algorithms::TransformObject; @@ -12,7 +14,7 @@ use super::{Face, Surface}; /// currently validated. #[derive(Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)] pub struct Solid { - faces: Vec, + faces: BTreeSet, } impl Solid { @@ -53,7 +55,7 @@ impl Solid { } /// Convert the solid into a list of faces - pub fn into_faces(self) -> Vec { + pub fn into_faces(self) -> BTreeSet { self.faces } } diff --git a/crates/fj-operations/src/lib.rs b/crates/fj-operations/src/lib.rs index be66802ee..3efb51e72 100644 --- a/crates/fj-operations/src/lib.rs +++ b/crates/fj-operations/src/lib.rs @@ -66,7 +66,9 @@ impl Shape for fj::Shape { shape .compute_brep(config, tolerance, debug_info)? .into_inner() - .into_faces(), + .into_faces() + .into_iter() + .collect(), config, ), Self::Group(shape) => { @@ -76,7 +78,9 @@ impl Shape for fj::Shape { shape .compute_brep(config, tolerance, debug_info)? .into_inner() - .into_faces(), + .into_faces() + .into_iter() + .collect(), config, ), Self::Transform(shape) => {