예제 #1
0
 def get_nth_curve_function(self, n):
     return bezier(self.get_nth_curve_points(n))
예제 #2
0
 def point_from_proportion(self, alpha):
     num_cubics = self.get_num_anchor_points() - 1
     interpoint_alpha = num_cubics * (alpha % (1. / num_cubics))
     index = min(3 * int(alpha * num_cubics), 3 * num_cubics)
     cubic = bezier(self.points[index:index + 4])
     return cubic(interpoint_alpha)
예제 #3
0
 def get_nth_curve_function(self, n: int) -> Callable[[float], np.ndarray]:
     return bezier(self.get_nth_curve_points(n))
예제 #4
0
 def get_nth_curve(self, n):
     return bezier(self.points[3 * n:3 * n + 4])
예제 #5
0
def running_start(t, pull_factor=-0.5):
    return bezier([0, 0, pull_factor, pull_factor, 1, 1, 1])(t)
예제 #6
0
def running_start(t: float, pull_factor: float = -0.5) -> float:
    return bezier([0, 0, pull_factor, pull_factor, 1, 1, 1])(t)
예제 #7
0
 def get_nth_curve_function(self, n):
     return bezier(self.get_nth_curve_points(n))
예제 #8
0
def running_start(t, pull_factor=-0.5):
    return bezier([0, 0, pull_factor, pull_factor, 1, 1, 1])(t)