Пример #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, )))
Пример #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, )))
Пример #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)
Пример #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)
Пример #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
Пример #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