reverse get y

This commit is contained in:
Frank DeMarco 2014-02-06 15:44:43 +09:00
parent ab5b5aa6f0
commit b99f66019a
1 changed files with 4 additions and 2 deletions

View File

@ -124,8 +124,10 @@ class Nodeset(list):
self.splines = [CubicSpline(self[ii].x, a[ii], b[ii], c[ii],
d[ii]) for ii in xrange(n)]
def get_y(self, t, loop=False, natural=False):
if loop:
def get_y(self, t, loop=False, reverse=False, natural=False):
if loop or reverse:
if reverse and int(t) / int(self[-1].x) % 2:
t = self[-1].x - t
t %= self[-1].x
elif not natural:
if t < self[0].x: