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, )))
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)
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