tetrahedron_udf#

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

Unsigned distance function of a 3D point to the boundary of a tetrahedron.

!!! tip

Internally broadcasts x, tetrahedra together, meaning it can be used with many points and a single tetrahedron, one point and many tetrahedra or many points and 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 – The point and tetrahedron must be in 3D.

Returns:

(Tensor[Float, [Bs3]]) – Unsigned distance of point to tetrahedron boundary.