feat(viewer): unify spatial clipping, planning and observation surfaces
Share spatial clipping and height slices across live planning and recorded observations. Refine scene navigation, report serialization and viewer presentation.
This commit is contained in:
@@ -90,8 +90,8 @@ def test_height_slice_is_reversible_and_only_replaces_display_points(tmp_path):
|
||||
recording.flush(); recording.disconnect()
|
||||
digest = hashlib.sha256(source.read_bytes()).hexdigest()
|
||||
assert spatial_metadata(source) == {'height_min_m': 0, 'height_max_m': 8, 'sample_points': 3}
|
||||
for ceiling, expected in [(3, 2), (-1, 0), (None, 3)]:
|
||||
data, count, eye = render_spatial_update(source, ceiling, 'top')
|
||||
for floor, ceiling, expected in [(None, 3, 2), (None, -1, 0), (2, None, 2), (2, 4, 1), (3, 3, 1), (None, None, 3)]:
|
||||
data, count, eye = render_spatial_update(source, ceiling, 'top', floor_m=floor)
|
||||
assert count == expected and eye['eyeUp'] == [0, 1, 0]
|
||||
assert eye['position'][2] > eye['lookTarget'][2]
|
||||
out = tmp_path / f'view-{expected}.rrd'; out.write_bytes(data)
|
||||
@@ -99,6 +99,7 @@ def test_height_slice_is_reversible_and_only_replaces_display_points(tmp_path):
|
||||
points = cloud.to_record_batch().column('Points3D:positions')[0].values.values.to_numpy().reshape(-1, 3)
|
||||
assert len(points) == expected
|
||||
assert ceiling is None or np.all(points[:, 2] <= ceiling)
|
||||
assert floor is None or np.all(points[:, 2] >= floor)
|
||||
assert RrdReader(out).recordings()[0].recording_id == RrdReader(source).recordings()[0].recording_id
|
||||
assert hashlib.sha256(source.read_bytes()).hexdigest() == digest
|
||||
|
||||
|
||||
Reference in New Issue
Block a user