chiark / gitweb /
mesh: fix non-manifold (join extents to their mates)
[moebius3.git] / meshscad
index 3372b0a5692c0ea2ac283e3ea4f168744fef23ae..bccd0b682679dc9eeb77621da03192e0005965cf 100755 (executable)
--- a/meshscad
+++ b/meshscad
@@ -65,11 +65,16 @@ def make_moebius(objname):
 
   for v in range(0, nv):
     for w in range(0, nw+1):
+      extw = w
+      if extw > nw/2: extw = nw-w
+      # each extent wire has to go round twice to meet itself
+      # (except the middle one, if there is one, where nw/2 = nw - nw/2
+      # and it gets to be by itself
       for s in range(0, ns):
         sigmas = calc_sigmas([s + sx for sx in (0,1)])
         #print('VWS',v,w,s, sigmas, file=sys.stderr)
         if not w % each_w:
-          extents[w % nw].quad([ cnr for cnr in qc(v,w,sigmas,False) ])
+          extents[extw].quad([ cnr for cnr in qc(v,w,sigmas,False) ])
         if False and not v % each_v and w < nw:
           travers[v].rquad([ cnr for cnr in qc(v,w,sigmas,True) ])
     if False and not v % each_v: