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 theSceneObject class.
Scene objects are uniquely identified by their name.To access a scene object, theget() method ofScene 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 theRadioMaterialofmy_object as follows:
my_object.radio_material="itu_wood"
- classsionna.rt.SceneObject(mi_mesh=None,name=None,fname=None,radio_material=None,remove_duplicate_vertices=False)[source]
Class implementing a scene object
Scene objects can be either created from an existing Mitsuba shapeor by loading a mesh from a file. In the latter case, a nameand 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 (
typing.Optional[mitsuba.Mesh]) – Mitsuba shape.Must be provided iffnameisNone.name (
typing.Optional[str]) – Object name.Must be provided iffnameis notNone.fname (
typing.Optional[str]) – Filename of a valid mesh ( “.ply” | “.obj”).Must be provided ifmi_meshisNone.radio_material (
typing.Optional[sionna.rt.radio_materials.radio_material_base.RadioMaterialBase]) – Radio material of the object.Must be provided iffnameis notNone.remove_duplicate_vertices (bool)
- clone(name=None,as_mesh=False,props=None)[source]
Creates a clone of the current scene object
The clone will have the same geometry and material properties as theoriginal object but will be assigned a new name.
- Parameters:
name (
typing.Optional[str]) – Name (id) of the cloned object.IfNone, the clone will be named as<original_name>-clone.as_mesh – If set toTrue, the clone will be returned as a
mitsuba.Meshobject. Otherwise, asionna.rt.SceneObjectwill be returned.props (
typing.Optional[mitsuba.Properties]) – Pre-populated properties to be used in the new Mitsubashape. Allows overriding the BSDF, emitter, etc.
- Return type:
sionna.rt.scene_object.SceneObject|mitsuba.Mesh- Returns:
A clone of the current object
- look_at(target)[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 anobject in the scene to point toward to
- propertymi_mesh
Get/set the Mitsuba shape
- Type:
mi.Mesh
- propertyname
Name
- Type:
str
- propertyobject_id
Identifier
- Type:
int
- propertyorientation
Get/set the orientation [rad] specified through three angles\((\alpha, \beta, \gamma)\) corresponding to a 3D rotation asdefined in(3)
- Type:
mi.Point3f
- propertyposition
Get/set the position vector [m] of the center of the object. Thecenter is defined as the object’s axis-aligned bounding box (AABB).
- Type:
mi.Point3f
- propertyradio_material
Get/set the radio material of the object. Setting can be done byusing either an instance of
RadioMaterialBaseorthe material name (str).- Type:
- propertyscaling
Get the scaling in the coordinate system of the object.If a scalar value is provided, the object is uniformly scaledacross all dimensions by that value. Alternatively, if a vectoris 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:
mi.Float|mi.Vector3f
- propertyscene
Get/set the scene to which the object belongs. Note that the scene canonly be set once.
- Type:
- propertyvelocity
Get/set the velocity vector [m/s]
The velocity must to be set at least once before it can bedifferentiated.
- Type:
mi.Vector3f