Exemplo n.º 1
0
def test_points_in_poly_array_one_element():

    assert np.array_equal(PinP.points_in_poly(poly1, ((0.5, 0.5, 0.0), )),
                          np.array((True, )))

    assert np.array_equal(PinP.points_in_poly(poly1, ((1.5, -0.5, 0.0), )),
                          np.array((False, )))
Exemplo n.º 2
0
def test_points_in_poly_array_one_element():

    assert np.array_equal(PinP.points_in_poly(poly1, ((0.5, 0.5, 0.0),
                          )), np.array((True, )))

    assert np.array_equal(PinP.points_in_poly(poly1, ((1.5, -0.5, 0.0),
                          )), np.array((False, )))
Exemplo n.º 3
0
def test_points_in_poly_array():
    points = np.array((
        (0.5, 0.5, 0.0),
        (1.5, 0.5, 0.0),
        (0.5, 0.5, 0.0),
        (0.5, 0.5, 0.0),
        (-0.5, 0.5, 0.0),
        (0.5, 0.5, 0.0),
    ))

    result = np.array((
        True,
        False,
        True,
        True,
        False,
        True,
    ))

    assert np.array_equal(PinP.points_in_poly(poly2, points), result)
Exemplo n.º 4
0
def test_points_in_poly_array():
    points = np.array((
        (0.5, 0.5, 0.0),
        (1.5, 0.5, 0.0),
        (0.5, 0.5, 0.0),
        (0.5, 0.5, 0.0),
        (-0.5, 0.5, 0.0),
        (0.5, 0.5, 0.0),
        ))

    result = np.array((
        True,
        False,
        True,
        True,
        False,
        True,
        ))

    assert np.array_equal(PinP.points_in_poly(poly2, points), result)
Exemplo n.º 5
0
def test_points_in_poly_scalar():

    assert PinP.points_in_poly(poly1, (0.5, 0.5, 0.0)) is True

    assert PinP.points_in_poly(poly1, (1.5, 0.5, 0.0)) is False
Exemplo n.º 6
0
def test_points_in_poly_scalar():

    assert PinP.points_in_poly(poly1, (0.5, 0.5, 0.0)) is True

    assert PinP.points_in_poly(poly1, (1.5, 0.5, 0.0)) is False