diff --git a/crates/fj-kernel/src/algorithms/intersect/face_face.rs b/crates/fj-kernel/src/algorithms/intersect/face_face.rs index 920cd76a7..7e6a23b80 100644 --- a/crates/fj-kernel/src/algorithms/intersect/face_face.rs +++ b/crates/fj-kernel/src/algorithms/intersect/face_face.rs @@ -36,9 +36,7 @@ impl FaceFaceIntersection { let intersection_curves = match SurfaceSurfaceIntersection::compute(surfaces, objects) { - Some(intersection) => { - intersection.intersection_curves.map(|curve| curve.path()) - } + Some(intersection) => intersection.intersection_curves, None => return None, }; diff --git a/crates/fj-kernel/src/algorithms/intersect/surface_surface.rs b/crates/fj-kernel/src/algorithms/intersect/surface_surface.rs index 9406e92d4..4b71b2e1a 100644 --- a/crates/fj-kernel/src/algorithms/intersect/surface_surface.rs +++ b/crates/fj-kernel/src/algorithms/intersect/surface_surface.rs @@ -2,8 +2,7 @@ use fj_math::{Line, Plane, Point, Scalar}; use crate::{ geometry::path::{GlobalPath, SurfacePath}, - insert::Insert, - objects::{Curve, Objects, Surface}, + objects::{Objects, Surface}, services::Service, storage::Handle, }; @@ -12,14 +11,14 @@ use crate::{ #[derive(Clone, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)] pub struct SurfaceSurfaceIntersection { /// The intersection curves - pub intersection_curves: [Handle; 2], + pub intersection_curves: [SurfacePath; 2], } impl SurfaceSurfaceIntersection { /// Compute the intersection between two surfaces pub fn compute( surfaces: [Handle; 2], - objects: &mut Service, + _: &mut Service, ) -> Option { // Algorithm from Real-Time Collision Detection by Christer Ericson. See // section 5.4.4, Intersection of Two Planes. @@ -53,10 +52,8 @@ impl SurfaceSurfaceIntersection { let line = Line::from_origin_and_direction(origin, direction); - let curves = planes.map(|plane| { - let path = SurfacePath::Line(plane.project_line(&line)); - Curve::new(path).insert(objects) - }); + let curves = + planes.map(|plane| SurfacePath::Line(plane.project_line(&line))); Some(Self { intersection_curves: curves, @@ -83,10 +80,7 @@ mod tests { use pretty_assertions::assert_eq; use crate::{ - algorithms::transform::TransformObject, - builder::CurveBuilder, - insert::Insert, - partial::{PartialCurve, PartialObject}, + algorithms::transform::TransformObject, geometry::path::SurfacePath, services::Services, }; @@ -114,17 +108,8 @@ mod tests { None, ); - let mut expected_xy = PartialCurve::default(); - expected_xy.update_as_u_axis(); - let expected_xy = expected_xy - .build(&mut services.objects) - .insert(&mut services.objects); - - let mut expected_xz = PartialCurve::default(); - expected_xz.update_as_u_axis(); - let expected_xz = expected_xz - .build(&mut services.objects) - .insert(&mut services.objects); + let expected_xy = SurfacePath::u_axis(); + let expected_xz = SurfacePath::u_axis(); assert_eq!( SurfaceSurfaceIntersection::compute(