Пример #1
0
def test_ray_starts_in_grid_and_ends_outside_1d_neg_x():
    start = np.array([[109.7]])
    end = np.array([[-12.1]])
    shape = np.array([51])
    size = np.array([3.0])

    map_gt = rt.gridmap(shape, size)
    map_gt.misses[:37] = 1

    map = rt.gridmap(shape, size)
    rt.trace1d(start, end, map)

    assert (map_gt == map)
Пример #2
0
def test_ray_penetrates_grid_1d_pos_x():
    start = np.array([[-1.23]])
    end = np.array([[6.78]])
    shape = np.array([5])
    size = np.array([0.45])

    map_gt = rt.gridmap(shape, size)
    map_gt.misses[:5] = 1

    map = rt.gridmap(shape, size)
    rt.trace1d(start, end, map)

    assert (map_gt == map)
Пример #3
0
def test_ray_penetrates_grid_1d_neg_x():
    start = np.array([[1.98]])
    end = np.array([[-6.71]])
    shape = np.array([100])
    size = np.array([0.01])

    map_gt = rt.gridmap(shape, size)
    map_gt.misses = np.ones(100)

    map = rt.gridmap(shape, size)
    rt.trace1d(start, end, map)

    assert (map_gt == map)
Пример #4
0
def test_ray_starts_and_ends_in_grid_1d_neg_x():
    start = np.array([[0.985]])
    end = np.array([[0.671]])
    shape = np.array([100])
    size = np.array([0.01])

    map_gt = rt.gridmap(shape, size)
    map_gt.misses[98:67:-1] = 1
    map_gt.hits[67] = 1

    map = rt.gridmap(shape, size)
    rt.trace1d(start, end, map)

    assert (map_gt == map)