triangle_udf#
- iskra.geometry.distances.triangle_udf(x: Tensor, triangles: Tensor) Tensor[SOURCE]#
Unsigned distance function of a 2D point to the boundary of a triangle.
- !!! tip
Internally broadcasts
x,trianglestogether, meaning it can be used with many points and a single triangle, one point and many triangles or many points and 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:
- Raises:
ValueError – The point and triangle must be in 2D.
- Returns:
(
Tensor[Float, [Bs3]]) – Unsigned distance of point to triangle boundary.