Solver#

solve_ray_bboxes_intersections(ray_origin, ray_direction, bboxes: List[Tuple] | Tuple) Tuple[ndarray, ndarray, ndarray][source]#

for each set of bbox plane, solve the intersection with the ray [t1,t2] then the intersection point should be intersection of [t1x,t2x], [t1y,t2y], [t1z,t2z] return [t1, t2], if no intersection return [0, inf]

solve_ray_ray_intersection(ray1_origin, ray1_direction, ray2_origin, ray2_direction)[source]#

Computes ray-ray intersection/closest point with hard clamping for t > 0.

Returns:

Parameters for the closest points. P (np.array): intersection_point. n (np.array): The surface normal that reflects beam1 to beam2.

Return type:

t1, t2 (float)

solve_normal_to_normal_rotation(n1, n2) Tuple[ndarray, float][source]#

Solve the rotation axis and angle to rotate n1 to n2

Parameters:
  • n1 (np.ndarray) – normal vector 1

  • n2 (np.ndarray) – normal vector 2

Returns:

rotation axis, rotation angle in radian

Return type:

Tuple[np.ndarray,float]