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"
- class sionna.rt.SceneObject(mi_mesh: mitsuba.Mesh | None = None, name: str | None = None, fname: str | None = None, radio_material: sionna.rt.radio_materials.radio_material_base.RadioMaterialBase | None = None, remove_duplicate_vertices: bool = False)[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.
To create a scene object from a mesh file, use the following approach:
obj = SceneObject(fname=sionna.rt.scene.sphere, name="sphere", radio_material=ITURadioMaterial(name="sphere-material", itu_type="metal", thickness=0.01))
To instantiate a scene object using a Mitsuba shape, follow these steps:
mesh = load_mesh(sionna.rt.scene.sphere) obj = SceneObject(mi_mesh=mesh, name="sphere", radio_material=ITURadioMaterial(name="sphere-material", itu_type="metal", thickness=0.01))
- Parameters:
mi_mesh (mi.Mesh | None) – Mitsuba shape. Must be provided if
fnameisNone.name (str | None) – Object name. Must be provided if
fnameis notNone.fname (str | None) – Filename of a valid mesh ( “.ply” | “.obj”). Must be provided if
mi_meshisNone.radio_material (RadioMaterialBase | None) – Radio material of the object. Must be provided if
fnameis notNone.remove_duplicate_vertices (bool)
Methods
- clone(name: str | None = None, as_mesh=False, props: mitsuba.Properties | None = None) sionna.rt.scene_object.SceneObject | mitsuba.Mesh[source]#
Creates a clone of the current scene object
The clone will have the same geometry and material properties as the original object but will be assigned a new name.
- Parameters:
name (str | None) – Name (id) of the cloned object. If
None, the clone will be named as<original_name>-clone.as_mesh – If set to True, the clone will be returned as a
mitsuba.Meshobject. Otherwise, asionna.rt.SceneObjectwill be returned.props (mitsuba.Properties | None) – Pre-populated properties to be used in the new Mitsuba shape. Allows overriding the BSDF, emitter, etc.
- Returns:
A clone of the current object
- look_at(target: mitsuba.Point3f | sionna.rt.radio_devices.radio_device.RadioDevice | str)[source]#
Sets the orientation so that the x-axis points toward a 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
Attributes
- property orientation#
Get/set the orientation [rad] specified through three angles \((\alpha, \beta, \gamma)\) corresponding to a 3D rotation as defined in (3)
- Type:
- 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:
- property radio_material#
Get/set the radio material of the object. Setting can be done by using either an instance of
RadioMaterialBaseor the material name (str).- Type:
- property scaling#
Get the scaling in the coordinate system of the object. If a scalar value is provided, the object is uniformly scaled across all dimensions by that value. Alternatively, if a vector is provided, the object is scaled independently along the x, y, and z axes according to the respective components of the vector, within the object’s coordinate system.
- Type:
- 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]
The velocity must to be set at least once before it can be differentiated.
- Type: