From 1aa28cb84775b1243adb3657ae55e14af1fc1ab1 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 29 Nov 2017 17:40:01 +0000 Subject: [PATCH] helixish: better debug Signed-off-by: Ian Jackson --- helixish.py | 4 +++- moedebug.py | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/helixish.py b/helixish.py index 5978478..d0f99b6 100644 --- a/helixish.py +++ b/helixish.py @@ -45,6 +45,7 @@ class HelixishCurve(): dq = unit_v(cp[3]-cp[2]) dbg('HelixishCurve __init__', cp) + dbg(dp, dq) # the initial attempt # - solve in the plane containing dP and dQ @@ -59,6 +60,7 @@ class HelixishCurve(): dPQplane_normal = np.cross(dp, dq) if (np.linalg.norm(dPQplane_normal) < 1E6): + dbg('dPQplane_normal small') dPQplane_normal += [0, 0, 1E5] dPQplane_normal = unit_v(dPQplane_normal) @@ -68,7 +70,7 @@ class HelixishCurve(): p)); dbg(dPQplane_basis) dPQplane_basis = np.vstack((dPQplane_basis, [0,0,0,1])) - dbg(dPQplane_basis) + #dbg(dPQplane_basis) dPQplane_into = np.linalg.inv(dPQplane_basis) dp_plane = augmatmultiply(dPQplane_into, dp, augwith=0) diff --git a/moedebug.py b/moedebug.py index 4f1ea7c..00fc547 100644 --- a/moedebug.py +++ b/moedebug.py @@ -11,7 +11,9 @@ def dbg_enabled(): def dbg(*args): for f in _files: - print('// D ', *args, file=f) + s = ' '.join(map(str,args)) + for l in s.split('\n'): + print('// D ', l, file=f) f.flush() class NullVisdebug(): -- 2.30.2