chiark / gitweb /
helixish: debugging output, some bodges re color handling weirdness
[moebius3.git] / visual
diff --git a/visual b/visual
index 9f98ad72d86593af8270806e17558119f27db9ef..27c22eb234d7392fa972045b74d86b5902224616 100755 (executable)
--- a/visual
+++ b/visual
@@ -21,14 +21,18 @@ nv = 40
 nw = 40
 
 class Visdebug(BaseVisdebug):
-  def curve(vd, fn, colour=color.yellow):
+  def curve(vd, fn, color=color.yellow):
     # fn(t) => 3-tuple, 3-list, or similar, for t \elem [0,1]
     ps = [ fn(t) for t in np.linspace(0,1,11) ]
     #dbg('Visdebug', ps)
-    curve(pos = ps, color=colour)
+    curve(pos = ps, color=color)
   def arrow(vd, p, d, **kw):
-    vd.line(p, p+d, **kw)
-    ring(pos=p, axis=d, radius=0.25, thickness=0.005, **kw)
+    print('arrow %s' % repr(kw), file=sys.stderr)
+    bodge_color = kw.get('color', (1,0,0))
+    try: del kw['color']
+    except KeyError: pass
+    vd.line(p, p+d, color=bodge_color, **kw)
+    ring(pos=p, axis=d, radius=0.25, thickness=0.005, color=bodge_color, **kw)
   def crashing(vd, msg):
     print("CRASHING - VISDEBUG", msg, file=sys.stderr)
     rate(1E-8)