autopdex.geometry.sdf_triangle_2d

autopdex.geometry.sdf_triangle_2d(x, x_p1, x_p2, x_p3)[source]

Normalized signed smooth distance function to a triangle (2D) or infinite triprism (3D), positive in the interior.

Parameters:
  • x (jnp.ndarray) – The point where the distance is evaluated.

  • x_p1 (jnp.ndarray) – First vertex of the triangle.

  • x_p2 (jnp.ndarray) – Second vertex of the triangle.

  • x_p3 (jnp.ndarray) – Third vertex of the triangle.

Returns:

The signed distance from the point x to the triangle or triprism.

Return type:

float