HM_ExtAPI::SurfaceNURBSGetData()

Returns parameters that define NURBS surface.

Syntax

bool SurfaceNURBSGetData(
const HM_EntityGeometrySurface & surface,
int& u_deg,
int& v_deg,
bool& u_rational,
bool& v_rational,
int& uknots_size,
int& vknots_size,
int& poles_usize,
int& poles_vsize,
double** uknots,
double** vknots,
HM_Point** poles,
double** weights
);

Type

HyperMesh Ext API Function

Description

The function expects that the type of surface object is HM_ExtAPI::NURBS_SURFACE(). Application should call the function HM_ExtAPI::GeomSurfaceGetType() to verify the type before calling SurfaceNURBSGetData function.

To free arrays allocated for poles, weights and knots during the function call use the function HM_ExtAPI::MemoryFree().

The NURBS surface is defined in a standard way as generalization of NURBS curve for two parameter values. See CurveNURBSGetData for details.

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

surface
[in] - Handle to surface object that was returned by previous calls to API functions.
u_deg
[out] - NURBS degree on U parameter.
v_deg
[out] - NURBS degree on V parameter.
u_rational
[out] - Returns true if surface NURBS is rational on U parameter. Returns false if surface is non-rational B-spline.
v_rational
[out] - Returns true if surface NURBS is rational on V parameter. Returns false if surface is non-rational B-spline.
uknots_size
[out] - Number of U parametric knots.
vknots_size
[out] - Number of V parametric knots.
poles_usize
[out] - Number of poles in U parametric direction.
poles_vsize
[out] - Number of poles in V parametric direction.
uknots
[out] - If not NULL on input then returns pointer to array of U parameter knot values. The number of values in the array is uknots_size.
vknots
[out] - If not NULL on input then returns pointer to array of V parameter knot values. The number of values in the array is vknots_size.
poles
[out] - If not NULL on input then returns pointer to array of NURBS poles. The number of values in the array is poles_usize multiplied by poles_vsize. Poles are arranged in rows of faster changing U parameter.
weights
[out] - If not NULL on input and u_rational and/or v_rational is true then returns pointer to array of NURBS weights.
If both u_rational and v_rational are true then the number of values in the array is poles_usize multiplied by poles_vsize and weight values are arranged in rows of faster changing U parameter.
If u_rational is true and v_rational is false then the size of the array is poles_usize.
If v_rational is true and u_rational is false then the size of the array is poles_vsize.

Errors

None.