#!/usr/bin/python from __future__ import print_function import signal signal.signal(signal.SIGINT, signal.SIG_DFL) from visual import * from bezier import BezierSegment import numpy as np import sys from moebius import * from moedebug import * nv = 40 nw = 40 class Visdebug(): def curve(vd, fn): # fn(t) => 3-tuple, 3-list, or similar, for t \elem [0,1] curve(pos = [ list(fn(t)) for t in np.linspace(0,1,11) ]) def crashing(vd, msg): print("CRASHING - VISDEBUG", msg, file=sys.stderr) rate(1E-8) dbg_file(sys.stderr) vdbg_enable(Visdebug()) m = Moebius(nv, nw) vs = range(0, nv+1) ws = range(0, nw+1) #ts = np.linspace(0, 1, 40) #thetas = np.linspace(0, tau, 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 v in vs: c2 = curve( pos = [ m.point(v,w) for w in ws ] ) 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 w in ws: c3 = curve( color=(1,0,1), pos = [ m.point_offset(v,w, -0.1) for v in vs ] )