distance3d.distance.line_segment_to_rectangle

distance3d.distance.line_segment_to_rectangle(segment_start, segment_end, rectangle_center, rectangle_axes, rectangle_lengths, epsilon=1e-06)[source]

Compute the shortest distance between line segment and rectangle.

Parameters:
segment_startarray, shape (3,)

Start point of segment.

segment_endarray, shape (3,)

End point of segment.

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.

epsilonfloat, optional (default: 1e-6)

Values smaller than epsilon are considered to be 0.

Returns:
distfloat

The shortest distance between line segment and rectangle.

closest_point_line_segmentarray, shape (3,)

Closest point on the line segment.

closest_point_rectanglearray, shape (3,)

Closest point on the rectangle.