differt.rt.consecutive_vertices_are_on_same_side_of_mirrors#
- consecutive_vertices_are_on_same_side_of_mirrors(vertices, mirror_vertices, mirror_normals, *, smoothing_factor=None)[source]#
Check if consecutive vertices, but skipping one every other vertex, are on the same side of a given mirror. The number of vertices
num_verticesmust be equal tonum_mirrors + 2.This check is needed after using
image_methodbecause it can return vertices that are behind a mirror, which causes the path to go through this mirror, and is something we want to avoid.- Parameters:
vertices (
Float[ArrayLike, '*#batch num_vertices 3']) – An array of vertices, usually describing ray paths.mirror_vertices (
Float[ArrayLike, '*#batch num_mirrors 3']) – An array of mirror vertices. For each mirror, any vertex on the infinite plane that describes the mirror is considered to be a valid vertex.mirror_normals (
Float[ArrayLike, '*#batch num_mirrors 3']) – An array of mirror normals, where each normal has a unit length and is perpendicular to the corresponding mirror.smoothing_factor (
Float[ArrayLike, '']|None) –If set, hard conditions are replaced with smoothed ones, as described in [2], and this argument parameters the slope of the smoothing function. The output value is now a real value between 0 (
False) and 1 (True).For more details, refer to Smoothing Discontinuities for Fully Differentiable Ray Tracing.
- Return type:
Bool[Array, '*#batch num_mirrors']|Float[Array, '*#batch num_mirrors']- Returns:
A boolean array indicating whether pairs of consecutive vertices are on the same side of the corresponding mirror.