findcurve_subprocs = { }
class OptimisedCurve():
- def __init__(hc, cp, nt):
+ def __init__(oc, cp, nt):
db = DiscreteBezier(cp, nt, constructor=BezierSegment)
fc_input = map(db.point_at_it, range(0, nt+1))
for end in (False,True):
dbg('[%s] %s' % (l, commentary))
commentary = ''
- hc.findcurve_result = l[0:6]
- #hc.findcurve_result = findcurve_start
- hc.threshold = l[0]**2
- hc.total_dist = hc.threshold + l[1]**2
- #vdbg().curve( hc.point_at_t )
-
- def point_at_t(hc, normalised_parameter):
- dist = normalised_parameter * hc.total_dist
- ours = list(hc.findcurve_result)
- if dist <= hc.threshold:
- ours[0] = sqrt(dist)
- ours[1] = 0
- else:
- ours[1] = sqrt(dist - hc.threshold)
- asmat = hc.func(*ours)
- p = asmat[:,0]
- p = augmatmultiply(hc.findcurve_basis, p)
- return p
+ findcurve_result = l
+
+ oc._result = np.reshape(findcurve_result, (3,-1))
+
+ def point_at_ti(oc, ti):
+ return oc._result[ti]