from moebius import *
-n_u = 40
+nu = 40
-m = MoebiusHalf(n_u)
+m = MoebiusHalf(nu)
ts = np.linspace(0, 1, 40)
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 ] )
+for iu in range(0, nu):
+ c2 = curve( pos = [ m.point(iu, t) for t in ts ] )
for t in ts:
- c3 = curve( color=color.yellow, pos = [ m.point(ix_u, t)
- for ix_u in range(0, n_u/2+1) ] )
+ c3 = curve( color=color.yellow, pos = [ m.point(iu, t)
+ for iu in range(0, nu/2+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.nu = nu
m._beziers = [ m._bezier(u) for u in np.linspace(0, 1, nu+1) ]
def _bezier(m,u):
theta = u * tau
cp[3] = m.midline.point(theta*2)
cp[2] = cp[3] + np.linalg.norm(cp[3]) * m.midline.dirn (theta*2)
return BezierSegment(cp)
- def point(m, ix_u, t):
+ def point(m, iu, t):
'''
- 0 <= ix_u <= nu meaning 0 <= u <= 1
+ 0 <= iu <= nu meaning 0 <= u <= 1
along the extent
0 and 1 are both the top half of the flat traverse
0.5 is the bottom half of the flat traverse
0 <= t <= 1 across the half-traverse
0 is the edge, 1 is the midline
'''
- return m._beziers[ix_u].point_at_t(t)
+ return m._beziers[iu].point_at_t(t)