src/manifold.rs

changeset 37
d7cd14b8ccc0
parent 13
f67949050a32
child 56
34f8ec636368
--- a/src/manifold.rs	Thu Nov 07 16:52:05 2024 -0500
+++ b/src/manifold.rs	Wed Dec 04 23:19:46 2024 -0500
@@ -2,12 +2,13 @@
 Abstract traits for manifolds.
 */
 
+use serde::Serialize;
 use alg_tools::euclidean::Euclidean;
 
 /// A point on a manifold
 pub trait ManifoldPoint : Clone + PartialEq {
     // Type of tangent factors
-    type Tangent : Euclidean<f64, Output=Self::Tangent> + std::fmt::Debug;
+    type Tangent : Euclidean<f64, Output=Self::Tangent> + std::fmt::Debug + Serialize;
 
     /// Exponential map
     fn exp(self, tangent : &Self::Tangent) -> Self;
@@ -24,8 +25,16 @@
 
 /// Point on a manifold that possesses displayable embedded coordinates.
 pub trait EmbeddedManifoldPoint : ManifoldPoint + std::fmt::Debug {
-    type EmbeddedCoords : std::fmt::Display;
+    type EmbeddedCoords : std::fmt::Display + Serialize;
 
     /// Convert a point on a manifold into embedded coordinates
     fn embedded_coords(&self) -> Self::EmbeddedCoords;
 }
+
+/// Point on a manifold that possesses faces
+pub trait FacedManifoldPoint : ManifoldPoint + std::fmt::Debug {
+    type Face : std::fmt::Display + Serialize;
+
+    /// Convert a point on a manifold into embedded coordinates
+    fn face(&self) -> Self::Face;
+}

mercurial