-
Hello, I'm using Sionna ray tracing to deploy RIS in optimized locations. One issue I'm facing is extracting the maximum height of specific buildings or objects. I know how to get object IDs using the paths.objects function in Sionna, but I'm struggling to find a way to determine the maximum height of those objects. Could you please help me figure out how to extract this information? Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi @Sina7474, It is currently difficult to do this programmatically. I would recommend loading the scene in Blender, where you can get the heights very easily. |
Beta Was this translation helpful? Give feedback.
-
Hello @Sina7474, Does the following snippet do what you are looking for? Please double-check the results since I didn't verify correctness myself. import mitsuba as mi
import sionna as sn
def get_max_height_per_shape(scene: mi.Scene, axis: int = 2) -> dict[str, float]:
heights = {}
for shape in scene.shapes():
key = shape.id()
assert key not in heights
heights[shape.id()] = shape.bbox().extents()[axis]
return heights
def main():
scene = sn.rt.load_scene(sn.rt.scene.etoile)
heights = get_max_height_per_shape(scene.mi_scene)
print(heights)
if __name__ == "__main__":
main() This assumes that the buildings are parallel to "the ground" and that the up axis is z. Edit: this also assumes that one building is one |
Beta Was this translation helpful? Give feedback.
Hello @Sina7474,
Does the following snippet do what you are looking for? Please double-check the results since I didn't verify correctness myself.
This assumes that the buildings are parallel to "the ground" …