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

index 21c33d1643cc956866633b75d5fbefb51cd93358..b0374dcb1d45f79f314764af43755531302bfbea 100644 (file)
--- a/check.py
+++ b/check.py
@@ -1,13 +1,23 @@
+
+import signal
+signal.signal(signal.SIGINT, signal.SIG_DFL)
+
 from visual import *
 from bezier import BezierSegment
-from moebius import Moebius
 import numpy as np
 
+from moebius import *
+
 n_u = 10
 
 m = Moebius(10)
 
 ts = arange(0, 1, 0.1)
 
-for ix_u in range(0, n_u+1):
-  curve( pos = [ m.point(ix_u, t) for t in ts ] )
+thetas = arange(0, tau, 20)
+
+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 7240248e82684d517944de2d3bbc375d6ffd4e16..ea762a958af0af9beb2529c42e394e6ec93dfc07 100644 (file)
@@ -1,9 +1,13 @@
 
+from __future__ import print_function
+
 import numpy as np
 from numpy import cos, sin
 
 from bezier import BezierSegment
 
+import sys
+
 tau = np.pi * 2
 
 origin = np.array((0,0,0))
@@ -22,6 +26,7 @@ class ParametricCircle:
   def radius(pc, theta):
     return pc._r0 * cos(theta) + pc._r1 * sin(theta)
   def point(pc, theta):
+    print('point %s %f' % (pc, theta), file=sys.stderr)
     return pc._c + pc.radius(theta)
 
 class Twirler(ParametricCircle):