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
#[cfg(feature = "serde")]
use serde::{Deserialize, Serialize};
use crate::{Shape, Shape2d};
#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))]
#[repr(C)]
pub struct Sweep {
shape: Shape2d,
path: [f64; 3],
}
impl Sweep {
pub fn from_path(shape: Shape2d, path: [f64; 3]) -> Self {
Self { shape, path }
}
pub fn shape(&self) -> &Shape2d {
&self.shape
}
pub fn path(&self) -> [f64; 3] {
self.path
}
}
impl From<Sweep> for Shape {
fn from(shape: Sweep) -> Self {
Self::Sweep(shape)
}
}