Exemplo n.º 1
0
def test_control_vertices(p1):
    vertices = list(p1.control_vertices())
    assert vertices == Vec3.list([(0, 0), (2, 0), (2, 1), (4, 1), (4, 0),
                                  (5, -1), (6, 0)])
    path = Path()
    assert len(list(path.control_vertices())) == 0
    path = converter.from_vertices([(0, 0), (1, 0)])
    assert len(list(path.control_vertices())) == 2
Exemplo n.º 2
0
def test_control_vertices(p1):
    vertices = list(p1.control_vertices())
    assert close_vectors(vertices, [(0, 0), (2, 0), (2, 1), (4, 1), (4, 0),
                                    (5, -1), (6, 0)])
    path = Path()
    assert len(list(path.control_vertices())) == 0
    assert list(path.control_vertices()) == list(path.approximate(2))
    path = converter.from_vertices([(0, 0), (1, 0)])
    assert len(list(path.control_vertices())) == 2
Exemplo n.º 3
0
def test_has_clockwise_orientation():
    # basic has_clockwise_orientation() function is tested in:
    # test_617_clockwise_orientation
    path = converter.from_vertices([(0, 0), (1, 0), (1, 1), (0, 1)])
    assert path.has_clockwise_orientation() is False

    path = Path()
    path.line_to((2, 0))
    path.curve4_to((4, 0), (2, 1), (4, 1))  # end, ctrl1, ctrl2
    assert path.has_clockwise_orientation() is True