From 44aa3c064334de01e15cb1a13087556b5a2a7f34 Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Wed, 11 May 2022 11:46:06 +0200 Subject: [PATCH 1/2] Make method name a bit more clear --- crates/fj-kernel/src/algorithms/intersection/mod.rs | 2 +- .../src/algorithms/intersection/surface.rs | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/crates/fj-kernel/src/algorithms/intersection/mod.rs b/crates/fj-kernel/src/algorithms/intersection/mod.rs index ff6220a6e..6136a50f0 100644 --- a/crates/fj-kernel/src/algorithms/intersection/mod.rs +++ b/crates/fj-kernel/src/algorithms/intersection/mod.rs @@ -5,5 +5,5 @@ mod surface; pub use self::{ line_segment::{line_segment, LineSegmentIntersection}, - surface::surface, + surface::surface_surface, }; diff --git a/crates/fj-kernel/src/algorithms/intersection/surface.rs b/crates/fj-kernel/src/algorithms/intersection/surface.rs index fc008a0c5..28e3524b5 100644 --- a/crates/fj-kernel/src/algorithms/intersection/surface.rs +++ b/crates/fj-kernel/src/algorithms/intersection/surface.rs @@ -3,7 +3,7 @@ use fj_math::{Line, Point, Scalar, Vector}; use crate::geometry::{Curve, Surface}; /// Test intersection between two surfaces -pub fn surface(a: &Surface, b: &Surface) -> Option { +pub fn surface_surface(a: &Surface, b: &Surface) -> Option { // Algorithm from Real-Time Collision Detection by Christer Ericson. See // section 5.4.4, Intersection of Two Planes. @@ -62,18 +62,21 @@ mod tests { use crate::geometry::{Curve, Surface}; - use super::surface; + use super::surface_surface; #[test] fn plane_plane() { let xy = Surface::xy_plane(); let xz = Surface::xz_plane(); - assert_eq!(surface(&xy, &xy), None); + assert_eq!(surface_surface(&xy, &xy), None); assert_eq!( - surface(&xy, &xy.transform(&Transform::translation([0., 0., 1.]))), + surface_surface( + &xy, + &xy.transform(&Transform::translation([0., 0., 1.])) + ), None, ); - assert_eq!(surface(&xy, &xz), Some(Curve::x_axis())); + assert_eq!(surface_surface(&xy, &xz), Some(Curve::x_axis())); } } From 4b6ae824492be83d1fac7ebf6d106bbcc7b7a42d Mon Sep 17 00:00:00 2001 From: Hanno Braun Date: Wed, 11 May 2022 11:46:27 +0200 Subject: [PATCH 2/2] Update module name --- crates/fj-kernel/src/algorithms/intersection/mod.rs | 4 ++-- .../intersection/{surface.rs => surface_surface.rs} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename crates/fj-kernel/src/algorithms/intersection/{surface.rs => surface_surface.rs} (100%) diff --git a/crates/fj-kernel/src/algorithms/intersection/mod.rs b/crates/fj-kernel/src/algorithms/intersection/mod.rs index 6136a50f0..a5d1542da 100644 --- a/crates/fj-kernel/src/algorithms/intersection/mod.rs +++ b/crates/fj-kernel/src/algorithms/intersection/mod.rs @@ -1,9 +1,9 @@ //! Intersection algorithms mod line_segment; -mod surface; +mod surface_surface; pub use self::{ line_segment::{line_segment, LineSegmentIntersection}, - surface::surface_surface, + surface_surface::surface_surface, }; diff --git a/crates/fj-kernel/src/algorithms/intersection/surface.rs b/crates/fj-kernel/src/algorithms/intersection/surface_surface.rs similarity index 100% rename from crates/fj-kernel/src/algorithms/intersection/surface.rs rename to crates/fj-kernel/src/algorithms/intersection/surface_surface.rs