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
mod edge;
mod face;
mod sketch;
use fj_interop::mesh::Color;
use fj_math::{Scalar, Vector};
use super::approx::Tolerance;
pub trait Sweep {
type Swept;
fn sweep(
self,
path: impl Into<Path>,
tolerance: impl Into<Tolerance>,
color: Color,
) -> Self::Swept;
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash, Ord, PartialOrd)]
pub struct Path(Vector<3>);
impl Path {
pub fn inner(&self) -> Vector<3> {
self.0
}
pub fn is_negative_direction(&self) -> bool {
self.0.dot(&Vector::from([0., 0., 1.])) < Scalar::ZERO
}
}
impl<T> From<T> for Path
where
T: Into<Vector<3>>,
{
fn from(value: T) -> Self {
Self(value.into())
}
}