print(s, file=subproc.stdin)
subproc.stdin.flush()
+ oc.subproc = subproc
+ oc.nt = nt
+
+ def _await_subproc(oc):
+ subproc = oc.subproc
+ if subproc is None: return
+
+ dbg('(awaiting)')
commentary = ''
while True:
subproc.stdin.close()
subproc.wait()
assert(subproc.returncode == 0)
+ oc.subproc = None
- oc.nt = nt
oc._result = np.reshape(findcurve_result, (-1,3), 'C')
dbg(repr(oc._result))
vdbg().curve( oc.point_at_t )
def point_at_it(oc, it):
+ oc._await_subproc()
dbg(repr((it,)))
return oc._result[it]
m._cp2b = BezierSegment([ (c,) for c in [0.33,0.33, 1.50]])
m._dbeziers = [ m._dbezier(theta) for theta in m._thetas ]
check = int(nu/3)-1
- m._dbezier(m._thetas[check], OptimisedCurve)
- m._dbezier(m._thetas[check+1], OptimisedCurve)
- m._dbezier(m._thetas[check+2], OptimisedCurve)
+ checks = (
+ m._dbezier(m._thetas[check], OptimisedCurve),
+ m._dbezier(m._thetas[check+1], OptimisedCurve),
+ m._dbezier(m._thetas[check+2], OptimisedCurve),
+ )
+ for c in checks: c.point_at_it(0)
def _dbezier(m, theta, dconstructor=DiscreteBezier):
cp = [None] * 4
cp[0] = m.edge .point(theta)