differt.scene.triangle_scene module#
Mesh geometry made of triangles and utilities.
- class TriangleScene(transmitters=<factory>, receivers=<factory>, mesh=<factory>, mesh_ids=<factory>)[source]#
Bases:
object
A simple scene made of one triangle mesh, some transmitters and some receivers.
The triangle mesh can be the result of multiple triangle meshes being concatenated.
- Parameters:
transmitters (
Float[Array, 'num_transmitters 3']
) – The array of transmitter vertices.receivers (
Float[Array, 'num_receivers 3']
) – The array of receiver vertices.mesh (
TriangleMesh
) – The triangle mesh.mesh_ids (
dict
[str
,slice
]) – A mapping between mesh IDs and the corresponding slice inmesh.triangles
.
- classmethod load_xml(file)[source]#
Load a triangle scene from a XML file.
This method uses
SionnaScene.load_xml
internally.- Parameters:
file (
str
) – The path to the XML file.- Return type:
- Returns:
The corresponding scene containing only triangle meshes.
-
mesh:
TriangleMesh
# The triangle mesh.
-
mesh_ids:
dict
[str
,slice
]# A mapping between mesh IDs and the corresponding slice in
mesh.triangles
.
- plot(tx_kwargs=None, rx_kwargs=None, mesh_kwargs=None, **kwargs)[source]#
Plot this scene on a 3D scene.
- Parameters:
tx_kwargs (
Optional
[Mapping
[str
,Any
]]) – A mutable mapping of keyword arguments passed todraw_markers
.rx_kwargs (
Optional
[Mapping
[str
,Any
]]) – A mutable mapping of keyword arguments passed todraw_markers
.mesh_kwargs (
Optional
[Mapping
[str
,Any
]]) – A mutable mapping of keyword arguments passed toTriangleMesh.plot
.kwargs (
Any
) – Keyword arguments passed to bothdraw_markers
andTriangleMesh.plot
.
- Return type:
- Returns:
The resulting plot output.
-
receivers:
Float[Array, 'num_receivers 3']
# The array of receiver vertices.
-
transmitters:
Float[Array, 'num_transmitters 3']
# The array of transmitter vertices.