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
use crate::{Shape, Shape2d};
#[derive(Clone, Debug)]
#[repr(C)]
pub enum Shape3d {
Sweep(Sweep),
}
impl From<Shape3d> for Shape {
fn from(shape: Shape3d) -> Self {
Self::Shape3d(shape.into())
}
}
#[derive(Clone, Debug)]
#[repr(C)]
pub struct Sweep {
pub shape: Shape2d,
pub length: f64,
}
impl From<Sweep> for Shape {
fn from(shape: Sweep) -> Self {
Self::Shape3d(Shape3d::Sweep(shape))
}
}
impl From<Sweep> for Shape3d {
fn from(shape: Sweep) -> Self {
Self::Sweep(shape)
}
}