Exemplo n.º 1
0
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
Exemplo n.º 2
0
def test_reverse(curve):
    r = curve.reverse()
    assert r.control_points == Vec3.tuple(reversed(POINTS))
Exemplo n.º 3
0
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)])
Exemplo n.º 4
0
def test_default_constructor():
    c = Bezier4P(POINTS)
    assert c.control_points == Vec3.tuple(POINTS)