mirror of
https://github.com/hannobraun/Fornjot
synced 2025-02-05 14:55:55 +00:00
Remove unused argument
This commit is contained in:
parent
879e005ab9
commit
196df2cd3f
@ -30,12 +30,12 @@ impl FaceFaceIntersection {
|
|||||||
/// Compute the intersections between two faces
|
/// Compute the intersections between two faces
|
||||||
pub fn compute(
|
pub fn compute(
|
||||||
faces: [&Face; 2],
|
faces: [&Face; 2],
|
||||||
objects: &mut Service<Objects>,
|
_: &mut Service<Objects>,
|
||||||
) -> Option<Self> {
|
) -> Option<Self> {
|
||||||
let surfaces = faces.map(|face| face.surface().clone());
|
let surfaces = faces.map(|face| face.surface().clone());
|
||||||
|
|
||||||
let intersection_curves =
|
let intersection_curves =
|
||||||
match SurfaceSurfaceIntersection::compute(surfaces, objects) {
|
match SurfaceSurfaceIntersection::compute(surfaces) {
|
||||||
Some(intersection) => intersection.intersection_curves,
|
Some(intersection) => intersection.intersection_curves,
|
||||||
None => return None,
|
None => return None,
|
||||||
};
|
};
|
||||||
|
@ -2,8 +2,7 @@ use fj_math::{Line, Plane, Point, Scalar};
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
geometry::path::{GlobalPath, SurfacePath},
|
geometry::path::{GlobalPath, SurfacePath},
|
||||||
objects::{Objects, Surface},
|
objects::Surface,
|
||||||
services::Service,
|
|
||||||
storage::Handle,
|
storage::Handle,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -16,10 +15,7 @@ pub struct SurfaceSurfaceIntersection {
|
|||||||
|
|
||||||
impl SurfaceSurfaceIntersection {
|
impl SurfaceSurfaceIntersection {
|
||||||
/// Compute the intersection between two surfaces
|
/// Compute the intersection between two surfaces
|
||||||
pub fn compute(
|
pub fn compute(surfaces: [Handle<Surface>; 2]) -> Option<Self> {
|
||||||
surfaces: [Handle<Surface>; 2],
|
|
||||||
_: &mut Service<Objects>,
|
|
||||||
) -> Option<Self> {
|
|
||||||
// Algorithm from Real-Time Collision Detection by Christer Ericson. See
|
// Algorithm from Real-Time Collision Detection by Christer Ericson. See
|
||||||
// section 5.4.4, Intersection of Two Planes.
|
// section 5.4.4, Intersection of Two Planes.
|
||||||
//
|
//
|
||||||
@ -95,16 +91,13 @@ mod tests {
|
|||||||
|
|
||||||
// Coincident and parallel planes don't have an intersection curve.
|
// Coincident and parallel planes don't have an intersection curve.
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
SurfaceSurfaceIntersection::compute(
|
SurfaceSurfaceIntersection::compute([
|
||||||
[
|
xy.clone(),
|
||||||
xy.clone(),
|
xy.clone().transform(
|
||||||
xy.clone().transform(
|
&Transform::translation([0., 0., 1.],),
|
||||||
&Transform::translation([0., 0., 1.],),
|
&mut services.objects
|
||||||
&mut services.objects
|
)
|
||||||
)
|
],),
|
||||||
],
|
|
||||||
&mut services.objects
|
|
||||||
),
|
|
||||||
None,
|
None,
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -112,10 +105,7 @@ mod tests {
|
|||||||
let expected_xz = SurfacePath::u_axis();
|
let expected_xz = SurfacePath::u_axis();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
SurfaceSurfaceIntersection::compute(
|
SurfaceSurfaceIntersection::compute([xy, xz],),
|
||||||
[xy, xz],
|
|
||||||
&mut services.objects
|
|
||||||
),
|
|
||||||
Some(SurfaceSurfaceIntersection {
|
Some(SurfaceSurfaceIntersection {
|
||||||
intersection_curves: [expected_xy, expected_xz],
|
intersection_curves: [expected_xy, expected_xz],
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user