hm_findclosestpointonline

For a given point on a line, returns the closest other point on that same line.

Syntax

hm_findclosestpointonline x y z line_id ?return_type?

Type

HyperMesh Tcl Query

Description

For a given point on a line, returns the closest other point on that same line:

xc yc zc dist

where xc, yc and zc are the coordinates of the point on the line closest to input point, and dist is the distance between the original and projected points.

Inputs

x y z
The coordinates of the known point.
line_id
ID of the line.
return_type
0 - Returns xc, yc, xc and dist as described above. This is the default if not specified.
1 - Returns xc, yc, xc and arclen, where arclen is the arc length parameter, normalized between 0 and 1, that indicates the position of the found point along the length of the line.

Example

To find the point closest to a point with coordinates (2676, -737, 605) and located on line 7:

hm_findclosestpointonline 2676 -737 605 7
2.6777E+003 -7.3989E+002 6.0481E+002 3.3889E+000

Errors

Incorrect usage results in a Tcl error. To detect errors, you can use the catch command:
if { [ catch {command_name...} ] } {
   # Handle error
}