From: Ian Jackson Date: Sun, 5 Nov 2017 15:13:54 +0000 (+0000) Subject: undo hideous subclass thing (nfc) X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=d753716b26bf94dcfab930dc54df676676b82c44;p=moebius3.git undo hideous subclass thing (nfc) Signed-off-by: Ian Jackson --- diff --git a/moebius.py b/moebius.py index 668d78c..a6d616a 100644 --- a/moebius.py +++ b/moebius.py @@ -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))