From 906edec3ef60cf3e0567c713b2a68688edb634d4 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 31 Dec 2017 16:47:55 +0000 Subject: [PATCH] helixish: attempt at the whole thing This does not really work. Should revert and try bits of it one at a time, etc. Signed-off-by: Ian Jackson --- findcurve.c | 2 +- helixish.py | 2 +- moebius.py | 6 +++--- visual | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/findcurve.c b/findcurve.c index 3c886f6..c038182 100644 --- a/findcurve.c +++ b/findcurve.c @@ -122,7 +122,7 @@ int main(void) { 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); diff --git a/helixish.py b/helixish.py index 77c311b..2c6043e 100644 --- a/helixish.py +++ b/helixish.py @@ -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 - s = delta * railway_r + s = delta * abs(railway_r) dbg('railway_ST delta', delta, 'r', railway_r, 's', s) return s diff --git a/moebius.py b/moebius.py index f228bce..e5a81ac 100644 --- a/moebius.py +++ b/moebius.py @@ -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._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) diff --git a/visual b/visual index 64d4b6c..d623bfb 100755 --- a/visual +++ b/visual @@ -18,7 +18,7 @@ from moebius import * from moedebug import * nv = 20 -nw = 40 +nw = 80 class Visdebug(BaseVisdebug): def curve(vd, fn, color=color.yellow): @@ -40,7 +40,7 @@ class Visdebug(BaseVisdebug): rate(1E-8) dbg_file(sys.stderr) -vdbg_enable(Visdebug()) +#vdbg_enable(Visdebug()) m = Moebius(nv, nw) -- 2.30.2