tetrahedron_project#

iskra.geometry.distances.tetrahedron_project(x: Tensor, tetrahedra: Tensor) Tensor[SOURCE]#

Projects a 3D point onto the closest point in a tetrahedron.

!!! tip

Internally broadcasts x, tetrahedra together, meaning it can be used to project many points onto a single tetrahedron, one point onto many tetrahedra or many points to many tetrahedra, 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.

  • tetrahedra (Tensor[Float, [Bs2, 4, Dim]]) – Set of tetrahedra.

Raises:

ValueError – We only support 3D tetrahedra. Feel free to raise an issue if you have a valid use case for 4D ones!

Returns:

(Tensor[Float, [Bs3, Dim]]) – Closest projection of x onto its corresponding tetrahedron.