distance3d.distance.triangle_to_rectangle

distance3d.distance.triangle_to_rectangle(triangle_points, rectangle_center, rectangle_axes, rectangle_lengths)[source]

Compute the shortest distance between triangle and rectangle.

Parameters:
triangle_pointsarray, shape (3, 3)

Each row contains a point of the triangle.

rectangle_centerarray, shape (3,)

Center point of the rectangle.

rectangle_axesarray, shape (2, 3)

Each row is a vector of unit length, indicating the direction of one axis of the rectangle. Both vectors are orthogonal.

rectangle_lengthsarray, shape (2,)

Lengths of the two sides of the rectangle.

Returns:
distancefloat

Shortest distance.

closest_point_trianglearray, shape (3,)

Closest point on triangle.

closest_point_rectanglearray, shape (3,)

Closest point on rectangle.