def test_correctness_bezier_from_arc(s, e): expected = list( cubic_bezier_from_arc( center=Vec3(1, 2), start_angle=s, end_angle=e, )) result = list( bezier.cubic_bezier_from_arc( center=Vec3(1, 2), start_angle=s, end_angle=e, )) for e, r in zip(expected, result): assert e.control_points == r.control_points
def test_reverse(curve): r = curve.reverse() assert r.control_points == Vec3.tuple(reversed(POINTS))
def test_transform(curve): m = Matrix44.translate(1, 1, 0) r = curve.transform(m) assert r.control_points == Vec3.tuple([(1, 1), (2, 1), (2, 2), (1, 2)])
def test_default_constructor(): c = Bezier4P(POINTS) assert c.control_points == Vec3.tuple(POINTS)