1 |
1 |
2 use core::f64; |
2 use serde_repr::*; |
3 |
3 use serde::Serialize; |
4 use alg_tools::loc::Loc; |
4 use alg_tools::loc::Loc; |
5 use alg_tools::norms::{Norm, L2}; |
5 use alg_tools::norms::{Norm, L2}; |
6 use crate::manifold::{ManifoldPoint, EmbeddedManifoldPoint}; |
6 use crate::manifold::{ManifoldPoint, EmbeddedManifoldPoint}; |
7 |
7 |
8 #[derive(Copy, Clone, Debug, Eq, PartialEq)] |
8 #[derive(Copy, Clone, Debug, Eq, PartialEq, Serialize_repr, Deserialize_repr)] |
9 pub enum Face {F1, F2, F3, F4, F5, F6} |
9 #[repr(u8)] |
|
10 pub enum Face {F1 = 1, F2 = 2, F3 = 3, F4 = 4, F5 = 5, F6 = 6} |
10 use Face::*; |
11 use Face::*; |
11 |
12 |
12 pub type Point = Loc<f64, 2>; |
13 pub type Point = Loc<f64, 2>; |
13 |
14 |
14 pub type AdjacentFaces = [Face; 4]; |
15 pub type AdjacentFaces = [Face; 4]; |
15 |
16 |
16 #[derive(Clone, Debug)] |
17 #[derive(Clone, Debug, Serialize)] |
17 pub enum Path { |
18 pub enum Path { |
18 Direct { destination : Face }, |
19 Direct { destination : Face }, |
19 Indirect { destination : Face, intermediate : Face }, |
20 Indirect { destination : Face, intermediate : Face }, |
20 } |
21 } |
21 |
22 |