HM_ExtAPI::CurveEllipseGetData()

Returns parameters that define ellipse.

Syntax

bool CurveEllipseGetData(
const HM_EntityGeometryCurve& curve,
HM_Point& center_point,
HM_Vector& unit_normal,
HM_Vector& major_axis,
double& ratio,
double& phase
);

Type

HyperMesh Ext API Function

Description

The function expects that the type of curve object is HM_ExtAPI::ELLIPSE(). Application should call the function HM_ExtAPI::GeomCurveGetType() to verify the type before calling CurveEllipseGetData function.

The points on the curve of the ellipse can be calculated parametrically as

C(t) = C + P cos (t - φ) + α [n X P] sin (t - φ)

using parameters returned by the CurveEllipseGetData function as summarized in the table below.

Parameters used by CurveEllipseGetData Ellipse parameters
center_point C
unit_normal n
major_axis P
ratio α
phase φ

If the function succeeds, the return value is true. If the function fails, the return value is false. To get extended value information, call HM_ExtAPI::GetLastErrorCode().

Requires including hm_extapi.h.

Inputs

curve
[in] - Handle to curve object that was returned by previous calls to API functions.
center_point
[out] - Ellipse center point.
unit_normal
[out] - Unit length vector normal to the plane of the ellipse.
major_axis
[out] - Vector that defines direction of the major axis of the ellipse and has a length equal to major axis half length. This vector is normal to the vector unit_normal.
ratio
[out] - Ratio between the length of the minor ellipse axis and the major ellipse axis.
phase
[out] - Parameter value of the curve at the end of the major axis defined by major_axis.

Errors

None.