openworld_radio_twin.simulation.scene_builder#

Functions

build_scene_assets(directory, buildings, ...)

building_columns(building, east, north[, ...])

The solid intervals of one building in the grid columns east x north.

geographic_to_local(longitude, latitude, ...)

load_environment_assets(directory)

Reconstruct the solver environment from a persisted scene asset directory.

load_scene_assets(directory)

Restore the scene metadata needed by geographic and derived-asset helpers.

localize_buildings(buildings, ...[, environment])

measurement_surface_path(assets, ...)

Return the stable shared path for one receiver-grid definition.

prepare_measurement_surface(path, assets, ...)

Reuse the measurement surface at path when its files match this grid, else write it.

rasterize_local_buildings(buildings, east, ...)

Sample buildings at the grid points east x north; rows follow north.

scene_cell_centers(radius_m, size)

East and north cell centres of a north-up size x size grid over the scene square.

terrain_elevation(assets, east_m, north_m)

Return compiled triangle elevation in the scene's local ENU frame.

transmitter_scene_position(assets, ...)

Convert a geographic TX position with AGL height to Sionna scene coordinates.

triangulate_polygon(points)

Triangulate a simple polygon while retaining the legacy public helper.

write_binary_ply(path, mesh)

write_measurement_surface(path, assets, ...)

Write the receiver surface mesh, its arrays and its JSON record next to path.

write_voxel_assets(assets, receiver_height_m)

Write the sparse solid voxels and north-up receiver-height slice.

Classes

BuildingMeshAssets(index, feature_id, ...)

LocalBuilding(feature_id, exterior, holes, ...)

MeasurementSurfaceAssets(path, cell_shape, ...)

Mesh(vertices, faces)

Triangle mesh as Python lists or as (n, 3) NumPy arrays; both serialize alike.

SceneAssets(directory, scene_xml_path, ...)

VoxelAssets(directory, voxel_path, ...)

class openworld_radio_twin.simulation.scene_builder.Mesh(vertices, faces)[source]#

Bases: object

Triangle mesh as Python lists or as (n, 3) NumPy arrays; both serialize alike.

vertices: list[tuple[float, float, float]] | ndarray#
faces: list[tuple[int, int, int]] | ndarray#
classmethod empty()[source]#
Return type:

Mesh

class openworld_radio_twin.simulation.scene_builder.LocalBuilding(feature_id, exterior, holes, minimum_height_m, vertical_extent_m, terrain_anchor_m=0.0, anchor_surface_class=SurfaceClass.GROUND, native_vertices=(), native_triangles=(), native_surface_types=(), source_lod=None, source_vertical_datum=None, source_ground_elevation_m=None, parent_reference_elevation_m=None, parent_building_id=None, placement_rule='footprint_extrusion')[source]#

Bases: object

feature_id: str#
exterior: tuple[tuple[float, float], ...]#
holes: tuple[tuple[tuple[float, float], ...], ...]#
minimum_height_m: float#
vertical_extent_m: float#
terrain_anchor_m: float = 0.0#
anchor_surface_class: SurfaceClass = 0#
native_vertices: tuple[tuple[float, float, float], ...] = ()#
native_triangles: tuple[tuple[int, int, int], ...] = ()#
native_surface_types: tuple[str, ...] = ()#
source_lod: str | None = None#
source_vertical_datum: str | None = None#
source_ground_elevation_m: float | None = None#
parent_reference_elevation_m: float | None = None#
parent_building_id: str | None = None#
placement_rule: str = 'footprint_extrusion'#
property roof_height_m: float#
property scene_minimum_height_m: float#
property scene_roof_height_m: float#
openworld_radio_twin.simulation.scene_builder.localize_buildings(buildings, origin_longitude, origin_latitude, environment=None)[source]#
Return type:

tuple[LocalBuilding, ...]

class openworld_radio_twin.simulation.scene_builder.BuildingMeshAssets(index, feature_id, rooftop_path, wall_path, rooftop_triangles, wall_triangles)[source]#

Bases: object

index: int#
feature_id: str#
rooftop_path: Path#
wall_path: Path#
rooftop_triangles: int#
wall_triangles: int#
class openworld_radio_twin.simulation.scene_builder.SceneAssets(directory, scene_xml_path, provenance_path, ground_path, terrain_paths, environment_metadata_path, height_map_path, building_assets, local_buildings, origin_longitude, origin_latitude, radius_m, height_map_pixel_size_m, triangle_count, environment, material_profile)[source]#

Bases: object

directory: Path#
scene_xml_path: Path#
provenance_path: Path#
ground_path: Path#
terrain_paths: dict[SurfaceClass, Path]#
environment_metadata_path: Path | None#
height_map_path: Path#
building_assets: tuple[BuildingMeshAssets, ...]#
local_buildings: tuple[LocalBuilding, ...]#
origin_longitude: float#
origin_latitude: float#
radius_m: float#
height_map_pixel_size_m: float#
triangle_count: int#
environment: EnvironmentData | None#
material_profile: Literal['itu', 'uniform']#
property building_count: int#
class openworld_radio_twin.simulation.scene_builder.VoxelAssets(directory, voxel_path, slice_path, scene_info_path, depth_array_path, depth_image_path, depth_preview_path, depth_info_path, pitch_m, slice_shape, grid)[source]#

Bases: object

directory: Path#
voxel_path: Path#
slice_path: Path#
scene_info_path: Path#
depth_array_path: Path#
depth_image_path: Path#
depth_preview_path: Path#
depth_info_path: Path#
pitch_m: float#
slice_shape: tuple[int, int]#
grid: dict#
class openworld_radio_twin.simulation.scene_builder.MeasurementSurfaceAssets(path, cell_shape, triangle_areas_m2, cell_centers)[source]#

Bases: object

path: Path#
cell_shape: tuple[int, int]#
triangle_areas_m2: ndarray#
cell_centers: ndarray#
openworld_radio_twin.simulation.scene_builder.geographic_to_local(longitude, latitude, origin_longitude, origin_latitude)[source]#
Return type:

tuple[float, float]

openworld_radio_twin.simulation.scene_builder.triangulate_polygon(points)[source]#

Triangulate a simple polygon while retaining the legacy public helper.

Return type:

tuple[list[tuple[float, float]], list[tuple[int, int, int]]]

openworld_radio_twin.simulation.scene_builder.write_binary_ply(path, mesh)[source]#
Return type:

None

openworld_radio_twin.simulation.scene_builder.write_measurement_surface(path, assets, resolution_m, receiver_height_m)[source]#

Write the receiver surface mesh, its arrays and its JSON record next to path.

Each file goes through a temporary sibling and the JSON record is replaced last, so an interrupted run never leaves a partial file under a final name.

Return type:

MeasurementSurfaceAssets

openworld_radio_twin.simulation.scene_builder.prepare_measurement_surface(path, assets, resolution_m, receiver_height_m)[source]#

Reuse the measurement surface at path when its files match this grid, else write it.

The files match when the record has the current schema, the axes equal the requested grid, the stored cell-centre heights equal those of the scene terrain at this receiver height, and the mesh has this grid’s header and every vertex height of the grid.

Return type:

MeasurementSurfaceAssets

openworld_radio_twin.simulation.scene_builder.terrain_elevation(assets, east_m, north_m)[source]#

Return compiled triangle elevation in the scene’s local ENU frame.

Return type:

float

openworld_radio_twin.simulation.scene_builder.transmitter_scene_position(assets, longitude, latitude, height_agl_m)[source]#

Convert a geographic TX position with AGL height to Sionna scene coordinates.

Return type:

tuple[float, float, float]

openworld_radio_twin.simulation.scene_builder.measurement_surface_path(assets, resolution_m, receiver_height_m)[source]#

Return the stable shared path for one receiver-grid definition.

Return type:

Path

openworld_radio_twin.simulation.scene_builder.load_environment_assets(directory)[source]#

Reconstruct the solver environment from a persisted scene asset directory.

Return type:

EnvironmentData

openworld_radio_twin.simulation.scene_builder.scene_cell_centers(radius_m, size)[source]#

East and north cell centres of a north-up size x size grid over the scene square.

The cells have side 2 * radius_m / size; columns run west to east and rows north to south. Every scene raster and voxel product samples buildings at these centres.

Return type:

tuple[ndarray, ndarray]

openworld_radio_twin.simulation.scene_builder.building_columns(building, east, north, environment=None)[source]#

The solid intervals of one building in the grid columns east x north.

Returns rows, columns, lower, upper with one entry per interval. A native shell gives the intervals sampled from its triangles, placed at the building’s terrain anchor and measured above the ground under the column. An extruded footprint gives its nominal minimum_height_m to roof_height_m in each column whose centre lies inside it.

Return type:

tuple[ndarray, ndarray, ndarray, ndarray]

openworld_radio_twin.simulation.scene_builder.rasterize_local_buildings(buildings, east, north, slice_height_agl_m, environment=None)[source]#

Sample buildings at the grid points east x north; rows follow north.

Returns the occupancy mask and the roof height above ground (NaN where there is no building). With slice_height_agl_m only columns whose solid contains that height count; without it every building column counts (the vertical projection).

Return type:

tuple[ndarray, ndarray]

openworld_radio_twin.simulation.scene_builder.build_scene_assets(directory, buildings, origin_longitude, origin_latitude, radius_m, environment=None, include_ground=True, material_profile='itu')[source]#
Return type:

SceneAssets

openworld_radio_twin.simulation.scene_builder.load_scene_assets(directory)[source]#

Restore the scene metadata needed by geographic and derived-asset helpers.

Return type:

SceneAssets

openworld_radio_twin.simulation.scene_builder.write_voxel_assets(assets, receiver_height_m, pitch_m=3.0)[source]#

Write the sparse solid voxels and north-up receiver-height slice.

Return type:

VoxelAssets