def __getitem__(self, Key): if Key < 0: Key = self.__len__() + Key # There is a horribly subtle distinction between an NSValue and # an NSPoint. SpeedPunk expects to see an NSValue here and dies # if it doesn't have one. return NSValue.valueWithPoint_(self._seg[Key].position)
def lerp(t,a,b): return NSValue.valueWithPoint_(NSPoint(int((1-t)*a.x + t*b.x), int((1-t)*a.y + t*b.y)))