3 from __future__ import print_function
6 signal.signal(signal.SIGINT, signal.SIG_DFL)
9 from bezier import BezierSegment
14 from moedebug import *
19 class Visdebug(BaseVisdebug):
20 def curve(vd, fn, colour=color.yellow):
21 # fn(t) => 3-tuple, 3-list, or similar, for t \elem [0,1]
22 ps = [ fn(t) for t in np.linspace(0,1,11) ]
24 curve(pos = ps, color=colour)
25 def crashing(vd, msg):
26 print("CRASHING - VISDEBUG", msg, file=sys.stderr)
30 vdbg_enable(Visdebug())
37 #ts = np.linspace(0, 1, 40)
39 #thetas = np.linspace(0, tau, 40)
40 #c0 = curve( color=color.red, pos = [ m.edge.point(th) for th in thetas ] )
41 #c1 = curve( color=color.blue, pos = [ m.midline.point(th) for th in thetas ] )
44 c2 = curve( color=color.blue, pos = [ m.point(v,w) for w in ws ] )
47 # c3 = curve( color=color.blue, pos = [ m.point(v,w) for v in vs ] )
51 # c4 = curve( color=color.blue,
52 # pos = [ m.point_offset(v,w, 0.1) for w in ws ] )
55 # c3 = curve( color=(1,0,1), pos = [ m.point_offset(v,w, -0.1) for v in vs ] )