hm_getbestcirclecenter

Returns the center and radius of the best fit circle from the input nodes, points or lines.

Syntax

hm_getbestcirclecenter entity_type mark_id any_tol ?panel_sensitive?

Type

HyperMesh Tcl Query

Description

This command calculates and returns the center point coordinates and radius of the circle that approximates the input set of lines, nodes or points. If the input entities are found to be on a straight line then an error is returned. The calculated information is returned as a list of four values, that specify x, y, z coordinates of the calculated circle center, and the radius of the circle.

Inputs

entity_type
Type of input entities. Valid values are nodes, points, or lines.
ent_mark
The mark of input entities.
any_tol
Parameter specifying whether the best fit is verified against the currently set geometry cleanup tolerance. Valid values are:
0 – Error is returned if input entities are not on the circle within geometry cleanup tolerance.
1 – Tolerance is ignored and best fit circle is always calculated.
panel_sensitive (optional)
Can be used when multiple panel levels have been pushed, either using the shortcut function keys, or the hm_pushpanel command. This option determines whether to use the current panel or the previous panel for the operation. This option is relevant only when the mark has been created from a panel entity selector under the above conditions. Valid panel_sensitive options are:
0 – Use the previous panel (default).
1 – Use the current panel.

Examples

To get the center and radius of the circle passing through nodes 11, 12 and 14:

*createmark nodes 1 11 12 14
hm_getbestcirclecenter nodes 1

To get the center and radius of the circle that approximates line 21:

*createmark lines 1 21
hm_getbestcirclecenter lines 1

Errors

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

Version History

10.0