From: Ian Jackson Date: Sat, 30 Dec 2017 13:01:01 +0000 (+0000) Subject: visdebug: make circle of variable size X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=1277a32dbfbdda6183fe7556ef7f5fb6a2609f53;p=moebius3.git visdebug: make circle of variable size Existing arrows have their circle sizes adjusted according to the lengths of the arrows. Signed-off-by: Ian Jackson --- diff --git a/visual b/visual index 490a4b9..f0b9b49 100755 --- a/visual +++ b/visual @@ -27,14 +27,14 @@ class Visdebug(BaseVisdebug): #dbg('Visdebug', ps) curve(pos = ps, color=color) def circle(vd, c, axis, **kw): - ring(pos=c, axis=axis, radius=0.25, thickness=0.005, **kw) + ring(pos=c, axis=axis, radius=np.linalg.norm(axis), thickness=0.005, **kw) def arrow(vd, p, d, **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) - vd.circle(p, d, color=bodge_color, **kw) + vd.circle(p, np.asarray(d) * 0.25, color=bodge_color, **kw) def crashing(vd, msg): print("CRASHING - VISDEBUG", msg, file=sys.stderr) rate(1E-8)