chiark / gitweb /
helixish: attempt at the whole thing
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 31 Dec 2017 16:47:55 +0000 (16:47 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 31 Dec 2017 16:47:55 +0000 (16:47 +0000)
This does not really work.  Should revert and try bits of it
one at a time, etc.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
findcurve.c
helixish.py
moebius.py
visual

index 3c886f6fbab4c14998a9740b64996d883d1e58a4..c038182e685ca954002d0e0473338077c01f5af4 100644 (file)
@@ -122,7 +122,7 @@ int main(void) {
     gsl_siman_solve(rng,
                    startpoint,
                    cb_Efunc, cb_step, cb_metric,
     gsl_siman_solve(rng,
                    startpoint,
                    cb_Efunc, cb_step, cb_metric,
-                   cb_print,
+                   0, //cb_print,
                    0,0,0, sizeof(startpoint), siman_params);
 
     printcore(startpoint);
                    0,0,0, sizeof(startpoint), siman_params);
 
     printcore(startpoint);
index 77c311b34097692d8558208b243baa438ba46e0c..2c6043eefc306590146f1a05275dcbd4f47f2f19 100644 (file)
@@ -163,7 +163,7 @@ class HelixishCurve():
           delta = atan2(*(end - C)[0:2]) - atan2(*(start - C)[0:2])
           dbg('railway_ST C', C, 'start', start, 'end', end, 'delta', delta)
           if delta < 0: delta += tau
           delta = atan2(*(end - C)[0:2]) - atan2(*(start - C)[0:2])
           dbg('railway_ST C', C, 'start', start, 'end', end, 'delta', delta)
           if delta < 0: delta += tau
-          s = delta * railway_r
+          s = delta * abs(railway_r)
           dbg('railway_ST delta', delta, 'r', railway_r, 's', s)
           return s
 
           dbg('railway_ST delta', delta, 'r', railway_r, 's', s)
           return s
 
index f228bce4bdb34171c19b414b5e470e6a32cb52e2..e5a81acad9d0d458bbc823769b5cea55176e0801 100644 (file)
@@ -81,9 +81,9 @@ class MoebiusHalf:
     m.nu      = nu
     m._thetas = [ u * tau for u in np.linspace(0, 1, nu+1) ]
     m._cp2b = BezierSegment([ (c,) for c in [0.33,0.33, 1.50]])
     m.nu      = nu
     m._thetas = [ u * tau for u in np.linspace(0, 1, nu+1) ]
     m._cp2b = BezierSegment([ (c,) for c in [0.33,0.33, 1.50]])
-    m._beziers = [ m._bezier(theta) for theta in m._thetas ]
-    check = int(nu/3)
-    m._beziers[check] = m._bezier(m._thetas[check], HelixishCurve)
+    m._beziers = [ m._bezier(theta, HelixishCurve) for theta in m._thetas ]
+    #check = int(nu/3)
+    #m._beziers[check] = m._bezier(m._thetas[check], HelixishCurve)
   def _bezier(m, theta, constructor=DoubleCubicBezier):
     cp = [None] * 4
     cp[0] =               m.edge   .point(theta)
   def _bezier(m, theta, constructor=DoubleCubicBezier):
     cp = [None] * 4
     cp[0] =               m.edge   .point(theta)
diff --git a/visual b/visual
index 64d4b6cb41c603ca762eb77d40cf93ccda71bdd7..d623bfb6c14f42f5ea9c2f6097ebd22a9927610e 100755 (executable)
--- a/visual
+++ b/visual
@@ -18,7 +18,7 @@ from moebius import *
 from moedebug import *
 
 nv = 20
 from moedebug import *
 
 nv = 20
-nw = 40
+nw = 80
 
 class Visdebug(BaseVisdebug):
   def curve(vd, fn, color=color.yellow):
 
 class Visdebug(BaseVisdebug):
   def curve(vd, fn, color=color.yellow):
@@ -40,7 +40,7 @@ class Visdebug(BaseVisdebug):
     rate(1E-8)
 
 dbg_file(sys.stderr)
     rate(1E-8)
 
 dbg_file(sys.stderr)
-vdbg_enable(Visdebug())
+#vdbg_enable(Visdebug())
 
 m = Moebius(nv, nw)
 
 
 m = Moebius(nv, nw)