distance3d.distance.triangle_to_triangle

distance3d.distance.triangle_to_triangle(triangle_points1, triangle_points2, epsilon=1e-06)[source]

Compute the shortest distance between two triangles.

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:
triangle_points1array, shape (3, 3)

Each row contains a point of the first triangle.

triangle_points2array, shape (3, 3)

Each row contains a point of the second triangle.

epsilonfloat, optional (default: 1e-6)

Values smaller than epsilon are considered to be 0.

Returns:
distancefloat

Shortest distance.

closest_point_triangle1array, shape (3,)

Closest point on triangle 1.

closest_point_triangle2array, shape (3,)

Closest point on triangle 2.