chiark / gitweb /
debugging arrangements for helixish
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 12 Dec 2017 21:00:45 +0000 (21:00 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 12 Dec 2017 21:00:45 +0000 (21:00 +0000)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
moebius.py
visual

index 081f428332e74f52e9cb614937798b6989a3fdd6..f228bce4bdb34171c19b414b5e470e6a32cb52e2 100644 (file)
@@ -82,7 +82,9 @@ class MoebiusHalf:
     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):
+    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)
     cp[3] =               m.midline.point(theta*2)
@@ -94,7 +96,7 @@ class MoebiusHalf:
     #      file=sys.stderr)
     cp[1] = cp[0] + cp1scale * m.edge   .dirn (theta)
     cp[2] = cp[3] + cp2scale * m.midline.dirn (theta*2)
-    return HelixishCurve(cp)
+    return constructor(cp)
   def point(m, iu, t):
     '''
     0 <= iu <= nu     meaning 0 <= u <= 1
diff --git a/visual b/visual
index a6f78c47da4132c912cec8eb9bb53561c6b1cb7e..8cf167af9421e716081a8d37730a6d9d4e57e3bb 100755 (executable)
--- a/visual
+++ b/visual
@@ -47,10 +47,10 @@ for w in ws:
   c3 = curve( color=color.yellow, pos = [ m.point(v,w) for v in vs ] )
 
 
-for v in vs:
-  c4 = curve( color=color.blue,
-              pos = [ m.point_offset(v,w, 0.1) for w in ws ] )
+#for v in vs:
+#  c4 = curve( color=color.blue,
+#              pos = [ m.point_offset(v,w, 0.1) for w in ws ] )
 
-for w in ws:
-  c3 = curve( color=(1,0,1), pos = [ m.point_offset(v,w, -0.1) for v in vs ] )
+#for w in ws:
+#  c3 = curve( color=(1,0,1), pos = [ m.point_offset(v,w, -0.1) for v in vs ] )