From 91810361da298d6503ce8a915a0b3227bda963d9 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sun, 5 Nov 2017 01:10:43 +0000 Subject: [PATCH] tuning Signed-off-by: Ian Jackson --- genscad | 4 ++-- moebius.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/genscad b/genscad index 26a21e7..bb9f7fe 100755 --- a/genscad +++ b/genscad @@ -10,8 +10,8 @@ from moebius import * nomsize = 20 thick = 2.5 -nv = 40 -nw = 40 +nv = 80 +nw = 80 m = Moebius(nv, nw) diff --git a/moebius.py b/moebius.py index f2a29da..668d78c 100644 --- a/moebius.py +++ b/moebius.py @@ -62,6 +62,7 @@ class MoebiusHalf: m.midline = Twirler(-unit_z, unit_z, unit_y, -0.5, 0) 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 ] def _bezier(m, theta): cp = [None] * 4 @@ -69,7 +70,7 @@ class MoebiusHalf: cp[3] = m.midline.point(theta*2) ncp3 = np.linalg.norm(cp[3]) cpt = ncp3 * ncp3 / 4 - cp2scale = 1.50 * cpt + 0.33 * (1-cpt) + cp2scale = m._cp2b.point_at_t(ncp3/2) cp1scale = 0.75 * cpt + 0.33 * (1-cpt) #print('u=%d ncp3=%f cp2scale=%f' % (u, ncp3, cp2scale), # file=sys.stderr) -- 2.30.2