Scene

Scene, Transmitter, Receiver, and ReceiverGrid API reference

Overview#

The scene API is the entry point for all WiTwin Channel simulations. A Scene holds geometry, materials, transmitters, and receivers. All solver calls take a Scene as their first argument.

import witwin.channel as wc
 
scene = wc.Scene(
    structures=[...],
    transmitters=[...],
    receivers=[...],
    frequency=3.5e9,
    device="cuda",
)

Scene#

Constructor#

ParameterTypeDefaultDescription
structureslist[Structure][]List of geometry and material objects
transmitterslist[Transmitter][]List of transmitter endpoints
receiverslist[Receiver | ReceiverGrid][]List of receiver endpoints
frequencyfloat | NoneNoneCarrier frequency in Hz
devicestr"cuda"PyTorch device string
tx_arrayAntennaArray | NoneNoneDefault transmit antenna array
rx_arrayAntennaArray | NoneNoneDefault receive antenna array
verboseboolFalseEnable verbose build logging

Methods#

scene.add(obj) — Add a Structure, Transmitter, Receiver, or ReceiverGrid to the scene after construction.

scene.add(wc.Structure(name="wall", geometry=wc.Box(...), material=wc.Material(...)))
scene.add(wc.Transmitter("tx", (0.0, 0.0, 1.5)))

scene.structure(name) — Get a handle to a named structure for runtime mutation.

scene.structure("wall").set_material_parameters(eps_r=wc.Float(4.0))

scene.transmitter(name) — Get a named transmitter endpoint.

scene.receiver(name) — Get a named receiver endpoint.

scene.clone(**overrides) — Return a copy of the scene with selected fields replaced.

scene.sync() — Sync the RayD BVH after mesh vertex updates.

Scene.load_mitsuba(filename, **kwargs) — Load a scene from a Mitsuba XML file. See Import 3D Models.

Scene.from_sionna(sionna_scene, **kwargs) — Import a sionna.rt.Scene object.

scene.to_sionna(**kwargs) — Export the scene to Sionna RT format.

Properties#

PropertyDescription
scene.frequencyCarrier frequency in Hz. Can be set after construction
scene.transmittersList of transmitter endpoints
scene.receiversList of receiver endpoints
scene.structuresList of structures
scene.verticesMerged scene vertex positions
scene.facesMerged scene face indices
scene.n_diffraction_edgesNumber of active diffraction edges

Transmitter#

A radio source placed at a fixed position in the scene.

wc.Transmitter(
    name="tx",
    position=(0.0, 0.0, 1.5),
    polarization=(1.0, 0.0, 0.0),
    power=1.0,
)
ParameterTypeDefaultDescription
namestrrequiredUnique name used to reference this transmitter in solver calls
positiontuple[float, float, float]required3D position in world coordinates
polarizationtuple[float, float, float](1.0, 0.0, 0.0)Polarization direction vector
powerfloat1.0Transmit power. Must be > 0
orientationtuple[float, float, float] | NoneNoneOrientation vector
arrayAntennaArray | NoneNonePer-transmitter antenna array override

Receiver#

A single-point receiver that captures the signal at a fixed position.

wc.Receiver(
    name="rx",
    position=(2.0, 0.0, 1.5),
)
ParameterTypeDefaultDescription
namestrrequiredUnique name used to reference this receiver in solver calls
positiontuple[float, float, float]required3D position in world coordinates
polarizationtuple[float, float, float] | NoneNoneReceive polarization direction
orientationtuple[float, float, float] | NoneNoneOrientation vector
arrayAntennaArray | NoneNonePer-receiver antenna array override

ReceiverGrid#

An axis-aligned 2D grid of receivers for computing coverage maps.

wc.ReceiverGrid(
    name="rm",
    axis="z",
    position=1.5,
    bounds=((-5.0, 5.0), (-5.0, 5.0)),
    grid_shape=(32, 32),
)
ParameterTypeDefaultDescription
namestrrequiredUnique name used to reference this grid in solver calls
axis"x" | "y" | "z"requiredNormal axis of the receiver plane
positionfloatrequiredPosition along the normal axis
bounds((min0, max0), (min1, max1))requiredExtent of the grid in the two tangential directions
grid_shapetuple[int, int] | NoneNoneFixed grid resolution as (nx, ny)
cell_sizefloat | tuple[float, float] | NoneNoneCell size in meters. Used if grid_shape is not set
polarizationtuple[float, float, float] | NoneNoneReceive polarization direction
orientationtuple[float, float, float] | NoneNoneOrientation vector
arrayAntennaArray | NoneNonePer-grid antenna array override

Note

Either grid_shape or cell_size must be provided.

Next Steps#

  • Geometry — Box, Structure, Material reference
  • Solvers — solver configuration reference