HM_ExtAPI::SurfaceSphereGetData()

Returns parameters that define spherical surface.

Syntax

bool SurfaceSphereGetData(
const HM_EntityGeometrySurface & surface,
HM_Point&  center,
HM_Vector& unit_north_pole,
HM_Vector& unit_origin_dir,
double& radius,
bool& reverse_u
);

Type

HyperMesh Ext API

Description

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

The points on the sphere surface can be calculated parametrically as

S(U, V) = C + R n sin V + R cos V ( p cos U + η [n X p ] sin U )

The following table summarizes correspondence of the parameters used in the equation to parameters returned by the function SurfaceSphereGetData.

Parameters returned by SurfaceSphereGetData Sphere parameters
center C
unit_north_pole n
unit_origin_dir P
radius R
reverse_u If false then η = 1

If true then η = -1

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.
center
[out] - Sphere center point.
unit_north_pole
[out] - Unit length vector that defines direction from center point to sphere’s “north pole”.
unit_origin_dir
[out] - Unit length vector that defines direction from center point to sphere’s “equator” point with parameters U=0, V=0.
radius
[out] - Sphere radius.
reverse_u
[out] - Flag that defines direction of constant V parametric lines along the axis of the sphere. The value of false indicates counter clockwise direction of constant V parametric lines with respect to the “north pole” direction unit_north_pole. The value of true indicates clockwise direction of constant V parametric lines.

Errors

None.