HM_ExtAPI::CreateSurfaceSphere()
Creates sphere surface object.
Syntax
bool CreateSurfaceSphere(
HM_EntityGeometrySurface& new_sphere,
const HM_Point& center,
const HM_Vector& north_pole,
const HM_Vector& origin_dir,
double radius,
bool reverse_u
);
Type
HyperMesh Ext API Function
Description
The function creates the surface object of the type HM_ExtAPI::SPHERE().
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 )
p = P - n (nP) , n = N / | N |
The following table summarizes correspondence of the parameters used in the equation to parameters used by the function CreateSurfaceSphere.
Parameters used by CreateSurfaceSphere | Sphere parameters |
---|---|
center | C |
north_pole | N |
origin_dir | P |
radius | R |
reverse_u | If false then η = 1 If true then η = -1 |
Note that the axis vector defined by the north_pole parameter does not have to have unit length. The vector origin_dir that defines position of the equator point with parameters U=0, V=0 does not have to be perpendicular to the axis vector but in this case it will be projected to the plane defined by the axis 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_sphere
- [out] - Handle to new surface object.
- center
- [in] - Sphere center point.
- north_pole
- [in] - Vector that defines direction from center point to sphere’s "north pole".
- origin_dir
- [in] - Vector that defines direction from center point to sphere’s "equator" point with parameters U=0, V=0.
- radius
- [in] - Sphere radius
- reverse_u
- [in] - 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 north_pole. The value of true indicates clockwise direction of constant V parametric lines.
Errors
None.