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
pub mod letter;
pub mod escher;
pub mod grid;
use vector::Vector;
pub enum Shape {
Line(Vector<f64>, Vector<f64>),
PolyLine(Vec<Vector<f64>>),
Polygon(Vec<Vector<f64>>),
Curve(Vector<f64>, Vector<f64>, Vector<f64>, Vector<f64>),
Path(Vector<f64>, Vec<ControlPoint>),
}
pub struct ControlPoint {
pub mid_point1: Vector<f64>,
pub mid_point2: Vector<f64>,
pub end_point: Vector<f64>,
}
impl ControlPoint {
pub fn new(mid_point1: Vector<f64>, mid_point2: Vector<f64>, end_point: Vector<f64>) -> ControlPoint {
ControlPoint { mid_point1, mid_point2, end_point }
}
}