3 from __future__ import print_function
6 signal.signal(signal.SIGINT, signal.SIG_DFL)
31 def round_wire(p, vec_surfacenormal, vec_acrosswire, sigma):
33 wire * (vec_surfacenormal * sin(sigma) +
34 vec_acrosswire * cos*(sigma)))
36 def make_moebius(objname):
37 print('module %s(){' % objname)
38 extents = ScadObject() # wires along extents
39 travers = ScadObject(): # wires along traverses
40 for v in range(0, nv):
41 for w in range(0, nw):
42 for s in range(0, ns):
43 sigmas = [ (s + sx)/ns * tau for sigma in 0,1 ]
46 extents[w].quad([ round_wire(p, norm, trav, sigmas[sx])
47 for p, norm, extt, trav in m.details(v+a, w)
51 travers[v].quad([ round_wire(p, norm, extt, sigmas[sx])
52 for p, norm, extt, trav in m.details(v, w+b)
55 for v in range(0, nv):
56 travers[v].writeout_core()
57 for w in range(0, nw):
58 travers[w].writeout_core()
61 make_moebius('MoebiusMesh')
62 print('moebiuscore_nomsize=%s;' % repr(nomsize))