fj_kernel/algorithms/intersect/
mod.rs1pub mod face_point;
4pub mod ray_edge;
5pub mod ray_face;
6pub mod ray_segment;
7
8mod curve_edge;
9mod curve_face;
10mod face_face;
11mod line_segment;
12mod surface_surface;
13
14use fj_math::{Point, Vector};
15
16pub use self::{
17 curve_edge::CurveEdgeIntersection,
18 curve_face::{CurveFaceIntersection, CurveFaceIntersectionInterval},
19 face_face::FaceFaceIntersection,
20 line_segment::LineSegmentIntersection,
21 surface_surface::SurfaceSurfaceIntersection,
22};
23
24pub trait Intersect {
31 type Intersection;
33
34 fn intersect(self) -> Option<Self::Intersection>;
36}
37
38#[derive(Clone, Copy, Debug, Eq, PartialEq)]
43pub struct HorizontalRayToTheRight<const D: usize> {
44 pub origin: Point<D>,
46}
47
48impl<const D: usize> HorizontalRayToTheRight<D> {
49 pub fn direction(&self) -> Vector<D> {
51 let mut components = [0.; D];
52 components[0] = 1.;
53 components.into()
54 }
55}
56
57impl<P, const D: usize> From<P> for HorizontalRayToTheRight<D>
58where
59 P: Into<Point<D>>,
60{
61 fn from(point: P) -> Self {
62 Self {
63 origin: point.into(),
64 }
65 }
66}