From: Ian Jackson Date: Tue, 12 Dec 2017 21:38:34 +0000 (+0000) Subject: more debugging X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=4c44b5f4becb0fdeff82e7892d6a68777d9ef8a6;p=moebius3.git more debugging Signed-off-by: Ian Jackson --- diff --git a/helixish.py b/helixish.py index 61d5b8b..aca4a23 100644 --- a/helixish.py +++ b/helixish.py @@ -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) diff --git a/moedebug.py b/moedebug.py index 00fc547..97e8635 100644 --- a/moedebug.py +++ b/moedebug.py @@ -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 8cf167a..90ad5c3 100755 --- 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: