chiark / gitweb /
merge into history old stuff found on chiark
[moebius.git] / moebius.hh
index f4d667f55f4d3893ed795fac96dc13b4a47377d8..f3e04390277b214c1bbe68ea3dbb2dcd2b9f4ad3 100644 (file)
@@ -11,8 +11,15 @@ public:
   virtual Point middlepoint(double t, double u) =0;
 };
 
-class Moebius : public Surface {
+class Edge {
 public:
+  // t varies from 0 to 1.0
+  virtual Point edgepoint(double t) =0;
+};
+
+class Moebius : public Surface, Edge {
+public:
+  virtual Point edgepoint(double t) =0;
   virtual Point middlepoint(double t, double u) =0;
 };
 
@@ -27,30 +34,31 @@ class MoebiusStrip : public Moebius {
   // Z ranges from -halfbreadth to +halfbreadth.
   double halfgap;     // 1/2 the width of the strip at the crossing point
   double halfbreadth; // 1/2 the width of the strip at the flat part
-  Point edgepoint(double t);
 public:
   MoebiusStrip() { halfgap= 0.15; halfbreadth= 0.15; }
   MoebiusStrip(double b) { halfgap= halfbreadth= b/2.0; }
   MoebiusStrip(double hg, double hb) { halfgap= hg/2.0; halfbreadth= hb/2.0; }
     
+  Point edgepoint(double t);
   Point middlepoint(double t, double u);
 };
 
-class MoebiusEnfoldment : public Moebius {
+class MoebiusEnfoldmentAny : public Moebius {
+public:
+  Point edgepoint(double t);
+};
+
+class MoebiusEnfoldment : public MoebiusEnfoldmentAny {
   double thickness;
   double bottomportion;
 public:
   MoebiusEnfoldment(double t=.35, double bp=.5) { thickness= t; bottomportion= bp; }
-    
-  Point edgepoint(double t);
   Point middlepoint(double t, double u);
 };
 
-class MoebiusNewEnfoldment : public Moebius {
+class MoebiusEnfoldmentNew : public MoebiusEnfoldmentAny {
 public:
-  MoebiusNewEnfoldment() { }
-    
-  Point edgepoint(double t);
+  MoebiusEnfoldmentNew() { }
   Point middlepoint(double t, double u);
 };