triangle_project#

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

Projects a point onto the closest point on an triangle.

!!! tip

Internally broadcasts x, triangles together, meaning it can be used to project many points onto a single triangle, one point onto many triangles or many points to many triangles, all by adding singleton dimensions to the batches before calling the function. Bs3 are the output batch dimensions obtained by broadcasting Bs1 and Bs2 together.

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 its corresponding triangle.