Ray Tracing at City Scale#
Important
This tutorial is still TODO, but you can find premise of it below.
import differt.plotting as dplt
import jax.numpy as jnp
from differt.geometry import TriangleMesh
from differt.scene import TriangleScene
from tqdm.notebook import trange
%%time
mesh_file = "bruxelles.obj"
mesh = TriangleMesh.load_obj(mesh_file)
dplt.set_backend("plotly") # Let's use the Plotly backend
tx = jnp.array([-40.0, 75, 30.0])
rx = jnp.array([+20.0, 108.034, 1.50])
scene = TriangleScene(transmitters=tx, receivers=rx, mesh=mesh)
with dplt.reuse() as fig:
scene.plot()
for order in trange(
0,
2,
leave=False,
): # You probably don't want to try order > 1 (too slow if testing all paths)
# Prepare input arrays
for paths in scene.compute_paths(order, chunk_size=2_000_000):
paths.plot()
fig
CPU times: user 6.37 s, sys: 403 ms, total: 6.77 s
Wall time: 3.95 s