chiark / gitweb /
undo hideous subclass thing (nfc)
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 5 Nov 2017 15:13:54 +0000 (15:13 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 5 Nov 2017 15:14:55 +0000 (15:14 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
moebius.py

index 668d78ce8e1d6c58ed41776e524461b360ed5b9e..a6d616ad587f93a931210398cf7e977bbf5c0b79 100644 (file)
@@ -104,7 +104,7 @@ class MoebiusHalf:
       dirn =  np.cross(vec_u, vec_t)
     return p + offset * dirn / np.linalg.norm(dirn)
 
-class Moebius(MoebiusHalf):
+class Moebius():
   def __init__(m, nv, nw):
     '''
       0 <= v <= nw    along the extent,    v=0 is the flat traverse
@@ -116,7 +116,7 @@ class Moebius(MoebiusHalf):
     m.nw = nw
     m.nt = nw/2
     m._t_vals = np.linspace(0, 1, m.nt+1)
-    MoebiusHalf.__init__(m, nu=nv*2)
+    m.h = MoebiusHalf(nu=nv*2)
 
   def _vw2tiu_kw(m, v, w):
     if w <= m.nt:
@@ -130,10 +130,9 @@ class Moebius(MoebiusHalf):
     return { 't': m._t_vals[it], 'iu': iu }
 
   def point(m, v, w):
-    return MoebiusHalf.point(m, **m._vw2tiu_kw(v,w))
+    return m.h.point(**m._vw2tiu_kw(v,w))
 
   def point_offset(m, v, w, offset):
-    return MoebiusHalf.point_offset(m,
-                                    offset=
-                                    offset if w <= m.nt else -offset,
-                                    **m._vw2tiu_kw(v,w))
+    return m.h.point_offset(offset=
+                            offset if w <= m.nt else -offset,
+                            **m._vw2tiu_kw(v,w))