chiark / gitweb /
more debugging
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 12 Dec 2017 21:38:34 +0000 (21:38 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 12 Dec 2017 21:38:34 +0000 (21:38 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
helixish.py
moedebug.py
visual

index 61d5b8b5d3a47c52924b60aa361c7e4029c1c5b8..aca4a237ae2d6cb273aa66dcf3537f607db01e93 100644 (file)
@@ -25,6 +25,9 @@ class HelixishCurve():
     dp = unit_v(cp[1]-cp[0])
     dq = unit_v(cp[3]-cp[2])
 
+    vdbg().arrow(p,dp)
+    vdbg().arrow(q,dq)
+
     dbg('HelixishCurve __init__', cp)
     dbg(dp, dq)
 
index 00fc547653d6adcc3c991f5cf7bba117067d344e..97e8635f16d90e9f02d780b5bbec52fc1d998a6e 100644 (file)
@@ -18,6 +18,8 @@ def dbg(*args):
 
 class NullVisdebug():
   def curve(*a, **kw): pass
+  def line(*a, **kw): pass
+  def arrow(*a, **kw): pass
   def crashing(*a, **kw): pass
 
 _nullvis = NullVisdebug()
diff --git a/visual b/visual
index 8cf167af9421e716081a8d37730a6d9d4e57e3bb..90ad5c3bdbfe99281bf69f94553eaab142701c95 100755 (executable)
--- a/visual
+++ b/visual
@@ -21,7 +21,11 @@ class Visdebug():
     # 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)
+    curve(pos = ps, color=color.yellow)
+  def line(vd, p0, p1):
+    vd.curve(lambda t: p0 + t * (p1-p0))
+  def arrow(vd, p, d):
+    vd.line(p, p+d)
   def crashing(vd, msg):
     print("CRASHING - VISDEBUG", msg, file=sys.stderr)
     rate(1E-8)
@@ -41,10 +45,10 @@ ws = range(0, nw+1)
 #c1 = curve( color=color.blue, pos = [ m.midline.point(th) for th in thetas ] )
 
 for v in vs:
-  c2 = curve( pos = [ m.point(v,w) for w in ws ] )
+  c2 = curve( color=color.blue, pos = [ m.point(v,w) for w in ws ] )
 
-for w in ws:
-  c3 = curve( color=color.yellow, pos = [ m.point(v,w) for v in vs ] )
+#for w in ws:
+#  c3 = curve( color=color.blue, pos = [ m.point(v,w) for v in vs ] )
 
 
 #for v in vs: