Skip to content

Commit

Permalink
Merge pull request #562 from hannobraun/rename
Browse files Browse the repository at this point in the history
Rename `intersection::surface` to `surface_surface`
  • Loading branch information
hannobraun authored May 11, 2022
2 parents f5d7102 + 4b6ae82 commit d02bc5e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions crates/fj-kernel/src/algorithms/intersection/mod.rs
Original file line number Diff line number Diff line change
@@ -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,
};
Original file line number Diff line number Diff line change
Expand Up @@ -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<Curve> {
pub fn surface_surface(a: &Surface, b: &Surface) -> Option<Curve> {
// Algorithm from Real-Time Collision Detection by Christer Ericson. See
// section 5.4.4, Intersection of Two Planes.

Expand Down Expand Up @@ -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()));
}
}

0 comments on commit d02bc5e

Please sign in to comment.