src/cube.rs

changeset 37
d7cd14b8ccc0
parent 34
aa6129697116
child 46
90cc221eb52b
equal deleted inserted replaced
34:aa6129697116 37:d7cd14b8ccc0
4 4
5 use serde_repr::*; 5 use serde_repr::*;
6 use serde::Serialize; 6 use serde::Serialize;
7 use alg_tools::loc::Loc; 7 use alg_tools::loc::Loc;
8 use alg_tools::norms::{Norm, L2}; 8 use alg_tools::norms::{Norm, L2};
9 use crate::manifold::{ManifoldPoint, EmbeddedManifoldPoint}; 9 use crate::manifold::{EmbeddedManifoldPoint, FacedManifoldPoint, ManifoldPoint};
10 10
11 /// All the difference faces of a [`OnCube`]. 11 /// All the difference faces of a [`OnCube`].
12 #[derive(Copy, Clone, Debug, Eq, PartialEq, Serialize_repr, Deserialize_repr)] 12 #[derive(Copy, Clone, Debug, Eq, PartialEq, Serialize_repr, Deserialize_repr)]
13 #[repr(u8)] 13 #[repr(u8)]
14 pub enum Face {F1 = 1, F2 = 2, F3 = 3, F4 = 4, F5 = 5, F6 = 6} 14 pub enum Face {F1 = 1, F2 = 2, F3 = 3, F4 = 4, F5 = 5, F6 = 6}
290 best_len = len; 290 best_len = len;
291 } 291 }
292 } 292 }
293 (best_tan, best_len) 293 (best_tan, best_len)
294 } 294 }
295 295 }
296
297 impl FacedManifoldPoint for OnCube {
298 type Face = Face;
296 /// Returns the face of this point. 299 /// Returns the face of this point.
297 pub fn face(&self) -> Face { 300 fn face(&self) -> Face {
298 self.face 301 self.face
299 } 302 }
300 } 303 }
301 304
302 305

mercurial