differt.scene.SBRPathLauncher#

class SBRPathLauncher(num_rays=1000000, epsilon=None, hit_tol=None, max_dist=0.001)[source]#

Bases: AbstractPathLauncher

Shooting-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

epsilon

Tolerance for checking ray / object intersections.

hit_tol

Tolerance for blockage checks.

max_dist

Maximal (squared) distance between a receiver and a ray for the receiver to be considered in the vicinity of the ray path.

num_rays

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:
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:
Return type:

Bool[Array, 'num_tx num_rx num_rays']

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, and filter_rays into a complete LaunchedPaths result.

Parameters:
  • scene (TriangleScene) – The scene.

  • order (int) – The maximum path order (number of bounces).

Return type:

LaunchedPaths

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.

num_rays: int = 1000000#

The number of rays launched.