Files
NODEDC_MISSION_CORE/tests/test_simulation_route_region.py
T
DCCONSTRUCTIONS 31b74e4571 Add prepared urban route guidance to Gaussian simulation planning
Introduce a content-bound scene route provider, advisory runtime graph and plan-preview-launch workflow. Preserve live sensing authority and retire blocked intermediate goals without discarding final-arrival evidence. Bound native visual context losslessly and provide verified cache relocation. Full Maroseyka route qualification remains open.
2026-10-08 23:42:26 +03:00

25 lines
1.3 KiB
Python

"""Curved visual context must retain whole original Gaussian records."""
import importlib.util
from pathlib import Path
import numpy as np
path=Path(__file__).parents[1]/'simulation/ai-polygon/route_region.py'
spec=importlib.util.spec_from_file_location('region_under_test',path)
region=importlib.util.module_from_spec(spec);spec.loader.exec_module(region)
def test_curved_region_preserves_context_and_every_attribute(tmp_path):
points=np.array([[0,7,0,10,20],[10,8,1.99,11,21],[20,9,10,12,22],
[0,10,20,13,23],[10,11,10,14,24]],dtype='<f4')
header=('ply\nformat binary_little_endian 1.0\nelement vertex 5\n'
'property float x\nproperty float y\nproperty float z\n'
'property float f_rest_0\nproperty float opacity\nend_header\n').encode()
source=tmp_path/'in.ply';source.write_bytes(header+points.tobytes());output=tmp_path/'out.ply'
receipt=region.select_region(source,output,[[0,0],[20,0],[20,20]],radius=2,chunk=2)
raw=output.read_bytes();end=raw.index(b'end_header\n')+len(b'end_header\n')
assert raw[end:]==points[:3].tobytes()
assert b'element vertex 00000000000000000003\n' in raw[:end]
assert receipt['retained_count']==3 and receipt['source_count']==5
assert receipt['all_attributes_preserved'] and not receipt['decimated']
assert source.read_bytes()==header+points.tobytes()