differt.rt.consecutive_vertices_are_on_same_side_of_mirrors

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_vertices must be equal to num_mirrors + 2.

This check is needed after using image_method because 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:
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.