hm_getclosestpointsbetweenlinesurface

Find the shortest distance between a line and a surface, and return line and surface points corresponding to this distance.

Syntax

hm_getclosestpointsbetweenlinesurface lineID surfID

Type

HyperMesh Tcl Query

Description

Find the shortest distance between a line and a surface, and return line and surface points corresponding to this distance.

Inputs

lineID
ID of the line.
surfID
ID of the surface.

Example

The result depends on whether the line and surface intersect. If they do not, then the return value is a list of 7 values:

{ xs ys zs xc yc zc dist}

Where "xs", "ys", "zs" are coordinates of the closest point on the surface, "xc", "yc", "zc" are coordinates of the closest point on the line and "dist" is the distance between those points.

If the line does intersect the surface, all intersection points are returned as a list of values:

{xs1 ys1 zs1 xc1 yc1 zc1 xs2 ys2 zs2 xc2 yc2 zc2 … } 

This case returns 6 values for each intersection point, but no distance is appended at the end of the list.

To find the closest points between a line with ID 1 and a surface with ID 2:

hm_getclosestpointsbetweenlinesurface 1 2

This example returns the following:

2.682E+003 -7.365E+002 6.050E+002 2.685E+003 -7.350E+002 6.040E+002 6.910E+000

In this case the line and surface do not intersect, and the closest distance between them equals 6.91.

Errors

None.