chiark / gitweb /
helixish: better debug
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 29 Nov 2017 17:40:01 +0000 (17:40 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 29 Nov 2017 17:40:01 +0000 (17:40 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
helixish.py
moedebug.py

index 5978478cfdd49f880eaf0017f47c0e05c484dda5..d0f99b61c352c5d98581ec882b3278d604857c9c 100644 (file)
@@ -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)
index 4f1ea7c15f60a82109c8eda9b895ea978322dc5c..00fc547653d6adcc3c991f5cf7bba117067d344e 100644 (file)
@@ -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():