HM_ExtAPI::CreateCurveEllipse()

Creates ellipse curve object.

Syntax

bool CreateCurveEllipse(
HM_EntityGeometryCurve& new_ellipse,
const HM_Point& center_point,
const HM_Vector& normal,
const HM_Vector& major_axis,
double ratio,
double phase
);

Type

HyperMesh Ext API Function

Description

The function creates the curve object of the type HM_ExtAPI::ELLIPSE.

The points on the ellipse can be calculated parametrically as

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

P = p - n (np) , n = N / | N |

where ellipse parameters correspond to the parameters used by the function CreateCurveEllipse as summarized in the table below.

Parameters used by CreateCurveEllipse Ellipse parameters
center_point C
normal N
major_axis P
ratio α
phase φ

Note that input normal vector defined by the normal parameter does not have to have unit length. The vector major_axis that defines position of the ellipse major axis does not have to be perpendicular to the normal vector but in this case it will be projected to the plane defined by the normal and the center point.

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

new_ellipse
[out] - Handle to new curve object.
center_point
[in] - Ellipse center point.
normal
[in] - Vector normal to the plane of the ellipse.
major_axis
[in] - Vector that defines the major axis of the ellipse and its length.
ratio
[in] - Ratio between the length of the minor ellipse axis and the major ellipse axis.
phase
[in] - Parameter value of the curve at the end of the major axis defined by major_axis.

Errors

None.