closest_triangle#

iskra.geometry.distances.closest_triangle(x: Tensor, triangles: Tensor) tuple[Tensor, Tensor, Tensor][SOURCE]#

Finds the closest triangles to a set of points.

Bs3 is the shape that results from broadcasting Bs1 and Bs2.

Parameters:
  • x (Tensor[Float, [Bs1, Dim]]) – Set of points.

  • triangles (Tensor[Float, [Bs2, 3, Dim]]) – Set of triangles.

Returns:
  • (Tensor[Float, [Bs3, Dim]]) – Closest projection of x onto the set of triangles.

  • ​​ (Tensor[Float, [Bs3]]) – Distance of x to the closest projection.

  • ​​​ (Tensor[Float, [Bs3]]) – Index of the triangle that was projected on.