Scene Objects
A scene is made of scene objects. Examples include cars, trees,
buildings, furniture, etc.
A scene object is characterized by its geometry and material (RadioMaterial
)
and implemented as an instance of the SceneObject
class.
Scene objects are uniquely identified by their name.
To access a scene object, the get()
method of
Scene
may be used.
For example, the following code snippet shows how to load a scene and list its scene objects:
scene = load_scene(sionna.rt.scene.munich)
print(scene.objects)
To select an object, e.g., named “Schrannenhalle-itu_metal”, you can run:
my_object = scene.get("Schrannenhalle-itu_metal")
You can then set the RadioMaterial
of my_object
as follows:
my_object.radio_material = "itu_wood"
Most scene objects names have postfixes of the form “-material_name”. These are used during loading of a scene
to assign a RadioMaterial
to each of them. This tutorial video
explains how you can assign radio materials to objects when you create your own scenes.
- class sionna.rt.SceneObject(mi_shape=None, name=None, fname=None, radio_material=None)[source]
Class implementing a scene object
Scene objects can be either created from an existing Mitsuba shape or by loading a mesh from a file. In the latter case, a name and radio material for the scene object must be provided.
- Parameters:
mi_shape (
typing.Optional
[mitsuba.Mesh
]) – Mitsuba shape. Must be provided iffname
isNone
.name (
typing.Optional
[str
]) – Object name. Must be provided iffname
is notNone
.fname (
typing.Optional
[str
]) – Filename of a valid mesh ( “.ply” | “.obj”). Must be provided ifmi_shape
isNone
.radio_material (
typing.Optional
[sionna.rt.radio_materials.radio_material_base.RadioMaterialBase
]) – Radio material of the object. Must be provided iffname
is notNone
.
- look_at(target)[source]
Sets the orientation so that the x-axis points toward an position
- Parameters:
target (
mitsuba.Point3f
|sionna.rt.radio_devices.radio_device.RadioDevice
|str
) – A position or the name or instance of an object in the scene to point toward to
- property mi_shape
Get/set the Mitsuba shape
- Type:
mi.Mesh
- property name
Name
- Type:
str
- property object_id
Identifier
- Type:
int
- property orientation
Get/set the orientation [rad] specified through three angles
corresponding to a 3D rotation as defined in (3)- Type:
mi.Point3f
- property position
Get/set the position vector [m] of the center of the object. The center is defined as the object’s axis-aligned bounding box (AABB).
- Type:
mi.Point3f
- property radio_material
Get/set the radio material of the object. Setting can be done by using either an instance of
RadioMaterialBase
or the material name (str
).- Type:
- property scaling
Get/set the scaling
- Type:
mi.Float
- property scene
Get/set the scene to which the object belongs. Note that the scene can only be set once.
- Type:
- property velocity
Get/set the velocity vector [m/s]
- Type:
mi.Vector3f