differt.scene.SBRPathLauncher#
- class SBRPathLauncher(num_rays=1000000, epsilon=None, hit_tol=None, max_dist=0.001)[source]#
Bases:
AbstractPathLauncherShooting-and-bouncing ray (SBR) path launcher.
A fixed number of rays are launched from each transmitter and are allowed to perform a fixed number of bounces. Only ray paths passing in the vicinity of a receiver are considered valid.
Important
This SBR method is currently unstable and not yet optimized, and it is likely to change in future releases. Use with caution.
Attributes
Tolerance for checking ray / object intersections.
Tolerance for blockage checks.
Maximal (squared) distance between a receiver and a ray for the receiver to be considered in the vicinity of the ray path.
The number of rays launched.
Methods
bounce_rays(scene, ray_origins, ...)Apply ray bouncing strategies to update ray states.
filter_rays(scene, ray_origins, ...)Filter rays by some criteria around receiver positions.
launch_paths(scene, order)Launch paths for the given scene and order.
launch_rays(scene)Launch rays from transmitters.
Detailed documentation
- bounce_rays(scene, ray_origins, ray_directions, triangles, t_hit, valid_rays)[source]#
Apply ray bouncing strategies to update ray states.
- Parameters:
scene (
TriangleScene) – The scene.ray_origins (
Float[Array, 'num_tx num_rays 3']) – The current ray origins.ray_directions (
Float[Array, 'num_tx num_rays 3']) – The current ray directions.triangles (
Int[Array, 'num_tx num_rays']) – The hit triangles.t_hit (
Float[Array, 'num_tx num_rays']) – The distance to hit.valid_rays (
Bool[Array, 'num_tx num_rays']) – The boolean mask indicating valid rays.
- Return type:
tuple[Float[Array, 'num_tx num_rays 3'],Float[Array, 'num_tx num_rays 3'],Bool[Array, 'num_tx num_rays']]- Returns:
A tuple of updated ray origins, updated ray directions, and updated valid mask.
-
epsilon:
Float[ArrayLike, '']|None= None# Tolerance for checking ray / object intersections.
- filter_rays(scene, ray_origins, ray_directions, rx_vertices, t_hit, valid_rays)[source]#
Filter rays by some criteria around receiver positions.
- Parameters:
scene (
TriangleScene) – The scene.ray_origins (
Float[Array, 'num_tx num_rays 3']) – The ray origins at start of bounce segment.ray_directions (
Float[Array, 'num_tx num_rays 3']) – The ray directions.rx_vertices (
Float[Array, 'num_rx 3']) – The receiver positions.t_hit (
Float[Array, 'num_tx num_rays']) – The distance to hit (end of bounce segment).valid_rays (
Bool[Array, 'num_tx num_rays']) – The boolean mask indicating valid rays.
- Return type:
- Returns:
A boolean mask indicating which rays pass near which receivers.
-
hit_tol:
Float[ArrayLike, '']|None= None# Tolerance for blockage checks.
- launch_paths(scene, order)[source]#
Launch paths for the given scene and order.
Orchestrates
launch_rays,bounce_rays, andfilter_raysinto a completeLaunchedPathsresult.- Parameters:
scene (
TriangleScene) – The scene.order (
int) – The maximum path order (number of bounces).
- Return type:
- Returns:
The launched paths.
- launch_rays(scene)[source]#
Launch rays from transmitters.
- Parameters:
scene (
TriangleScene) – The scene.- Return type:
tuple[Float[Array, 'num_tx num_rays 3'],Float[Array, 'num_tx num_rays 3']]- Returns:
A tuple of ray origins and ray directions.
-
max_dist:
Float[ArrayLike, '']= 0.001# Maximal (squared) distance between a receiver and a ray for the receiver to be considered in the vicinity of the ray path.