distance3d.distance.rectangle_to_rectangle

distance3d.distance.rectangle_to_rectangle(rectangle_center1, rectangle_axes1, rectangle_lengths1, rectangle_center2, rectangle_axes2, rectangle_lengths2, epsilon=1e-06)[source]

Compute the shortest distance between two rectangles.

Implementation adapted from 3D Game Engine Design by David H. Eberly.

Geometric Tools, Inc. http://www.geometrictools.com Copyright (c) 1998-2006. All Rights Reserved

The Wild Magic Version 4 Foundation Library source code is supplied under the terms of the license agreement (http://www.geometrictools.com/License/Wm4FoundationLicense.pdf) and may not be copied or disclosed except in accordance with the terms of that agreement.

Parameters:
rectangle_center1array, shape (3,)

Center point of the rectangle.

rectangle_axes1array, 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_lengths1array, shape (2,)

Lengths of the two sides of the rectangle.

rectangle_center2array, shape (3,)

Center point of the rectangle.

rectangle_axes2array, 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_lengths2array, 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 two rectangles.

closest_point_line_segmentarray, shape (3,)

Closest point on the line segment.

closest_point_rectanglearray, shape (3,)

Closest point on the rectangle.