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