chiark / gitweb /
bugfixes
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 4 Nov 2017 21:30:03 +0000 (21:30 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 4 Nov 2017 21:30:03 +0000 (21:30 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
check.py
moebius.py

index c03d19ca5fdfd0aa1f56af61620d85fa469d1341..7ee4a1e70c36434dfece9801ee9406162dc24725 100644 (file)
--- a/check.py
+++ b/check.py
@@ -16,8 +16,8 @@ ts = np.linspace(0, 1, 20)
 
 thetas = np.linspace(0, tau, 20)
 
-c0 = curve( color=color.blue, pos = [ m.edge.point(th) for th in thetas ] )
-c1 = curve( color=color.red, pos = [ m.midline.point(th) for th in thetas ] )
+c0 = curve( color=color.red, pos = [ m.edge.point(th) for th in thetas ] )
+c1 = curve( color=color.blue, pos = [ m.midline.point(th) for th in thetas ] )
 
 for ix_u in range(0, n_u):
   c2 = curve( pos = [ m.point(ix_u, t) for t in ts ] )
index 6f7d1a6150a070facf512e47f38baa14284cd277..c6041244c3985b0342aa155e6117d763addd4463 100644 (file)
@@ -48,10 +48,10 @@ class Twirler(ParametricCircle):
     return cos(zeta) * r + sin(zeta) * tw._axis
 
 class Moebius:
-  def __init__(m, n_u): # ix_u will be in [0, n_u>
-    m.edge    = Twirler(origin,  unit_z, unit_x, 2, 0)
-    m.midline = Twirler(-unit_z, unit_z, unit_y, 1, 0)
-    m._beziers = [ m._bezier(u) for u in np.linspace(0, 1, n_u) ]
+  def __init__(m, n_u): # ix_u will be in [0, n_u] for [0, 1]
+    m.edge    = Twirler(origin,  unit_z, unit_x, -2, tau/2)
+    m.midline = Twirler(-unit_z, unit_z, unit_y, -0.5, 0)
+    m._beziers = [ m._bezier(u) for u in np.linspace(0, 1, n_u+1) ]
   def _bezier(m,u):
     theta = u * tau
     cp = [None] * 4