From 63b4304dd34eca222a25871a424fa5817703948d Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 4 Nov 2017 21:30:03 +0000 Subject: [PATCH] bugfixes Signed-off-by: Ian Jackson --- check.py | 4 ++-- moebius.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/check.py b/check.py index c03d19c..7ee4a1e 100644 --- a/check.py +++ b/check.py @@ -16,8 +16,8 @@ ts = np.linspace(0, 1, 20) thetas = np.linspace(0, tau, 20) -c0 = curve( color=color.blue, pos = [ m.edge.point(th) for th in thetas ] ) -c1 = curve( color=color.red, pos = [ m.midline.point(th) for th in thetas ] ) +c0 = curve( color=color.red, pos = [ m.edge.point(th) for th in thetas ] ) +c1 = curve( color=color.blue, pos = [ m.midline.point(th) for th in thetas ] ) for ix_u in range(0, n_u): c2 = curve( pos = [ m.point(ix_u, t) for t in ts ] ) diff --git a/moebius.py b/moebius.py index 6f7d1a6..c604124 100644 --- a/moebius.py +++ b/moebius.py @@ -48,10 +48,10 @@ class Twirler(ParametricCircle): return cos(zeta) * r + sin(zeta) * tw._axis class Moebius: - def __init__(m, n_u): # ix_u will be in [0, n_u> - m.edge = Twirler(origin, unit_z, unit_x, 2, 0) - m.midline = Twirler(-unit_z, unit_z, unit_y, 1, 0) - m._beziers = [ m._bezier(u) for u in np.linspace(0, 1, n_u) ] + def __init__(m, n_u): # ix_u will be in [0, n_u] for [0, 1] + m.edge = Twirler(origin, unit_z, unit_x, -2, tau/2) + m.midline = Twirler(-unit_z, unit_z, unit_y, -0.5, 0) + m._beziers = [ m._bezier(u) for u in np.linspace(0, 1, n_u+1) ] def _bezier(m,u): theta = u * tau cp = [None] * 4 -- 2.30.2