Remove unused argument

This commit is contained in:
Hanno Braun 2023-02-24 14:03:13 +01:00
parent 879e005ab9
commit 196df2cd3f
2 changed files with 12 additions and 22 deletions

View File

@ -30,12 +30,12 @@ impl FaceFaceIntersection {
/// Compute the intersections between two faces
pub fn compute(
faces: [&Face; 2],
objects: &mut Service<Objects>,
_: &mut Service<Objects>,
) -> Option<Self> {
let surfaces = faces.map(|face| face.surface().clone());
let intersection_curves =
match SurfaceSurfaceIntersection::compute(surfaces, objects) {
match SurfaceSurfaceIntersection::compute(surfaces) {
Some(intersection) => intersection.intersection_curves,
None => return None,
};

View File

@ -2,8 +2,7 @@ use fj_math::{Line, Plane, Point, Scalar};
use crate::{
geometry::path::{GlobalPath, SurfacePath},
objects::{Objects, Surface},
services::Service,
objects::Surface,
storage::Handle,
};
@ -16,10 +15,7 @@ pub struct SurfaceSurfaceIntersection {
impl SurfaceSurfaceIntersection {
/// Compute the intersection between two surfaces
pub fn compute(
surfaces: [Handle<Surface>; 2],
_: &mut Service<Objects>,
) -> Option<Self> {
pub fn compute(surfaces: [Handle<Surface>; 2]) -> Option<Self> {
// Algorithm from Real-Time Collision Detection by Christer Ericson. See
// section 5.4.4, Intersection of Two Planes.
//
@ -95,16 +91,13 @@ mod tests {
// Coincident and parallel planes don't have an intersection curve.
assert_eq!(
SurfaceSurfaceIntersection::compute(
[
xy.clone(),
xy.clone().transform(
&Transform::translation([0., 0., 1.],),
&mut services.objects
)
],
&mut services.objects
),
SurfaceSurfaceIntersection::compute([
xy.clone(),
xy.clone().transform(
&Transform::translation([0., 0., 1.],),
&mut services.objects
)
],),
None,
);
@ -112,10 +105,7 @@ mod tests {
let expected_xz = SurfacePath::u_axis();
assert_eq!(
SurfaceSurfaceIntersection::compute(
[xy, xz],
&mut services.objects
),
SurfaceSurfaceIntersection::compute([xy, xz],),
Some(SurfaceSurfaceIntersection {
intersection_curves: [expected_xy, expected_xz],
})