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

Type

HyperMesh Tcl Query Command

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.

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

2023 - Deprecated argument panel_sensitive.