HM_ExtAPI::SurfaceComposedGetPatch()
Returns individual surfaces of composed surface.
Syntax
bool SurfaceComposedGetPatch(
const HM_EntityGeometrySurface & surface,
int u_ind,
int v_ind,
HM_EntityGeometrySurface& patch,
double& u_start_param,
double& u_end_param,
double& v_start_param,
double& v_end_param,
double& patch_u_start_param,
double& patch_u_end_param,
double& patch_v_start_param,
double& patch_v_end_param
);
Type
HyperMesh Ext API Function
Description
The function expects that the type of surface object is HM_ExtAPI::COMPOSED_SURFACE. Application should call the function HM_ExtAPI::GeomSurfaceGetType() to verify the type before calling SurfaceComposedGetPatch function.
Use the function HM_ExtAPI::SurfaceComposedGetSizes() to get number of surface patches in U and V direction of the patches grid that defines the structure of the composed surface.
Subdivision of parametric space of the composed surface is defined by a set of grid parametric values for U parameter {uα} with index α taking the values in the range 0 … N and N is the number of patches in U parametric direction, and a set of grid parametric values for V parameter {vβ} with index β taking values in the range 0 … M and M is the number of patches in V parametric direction. For parametric values U and V such that
uα ≤ U ≤ uα+1 and vβ ≤ V ≤ vβ+1
the point on the composed surface is calculated as
S(U, V) = Sαβ(u, v)
where "local" patch parameters u and v are obtained by mapping from "global" parameters U and V using grid parametric values and patch parametric range values as
u = uαβ, 0 + (uαβ, 1 - uαβ, 0) (U - uα) / (uα+1 - uα)
v = vαβ, 0 + (vαβ, 1 - vαβ, 0) (V - vβ) / (vβ+1 - vβ)
Parameters returned by SurfaceComposedGetPatch | Composed surface parameters |
---|---|
u_ind | α |
v_ind | β |
patch | Sαβ |
u_start_param | uα |
u_end_param | uα+1 |
v_start_param | vβ |
v_end_param | vβ+1 |
patch_u_start_param | uαβ, 0 |
patch_u_end_param | uαβ, 1 |
patch_v_start_param | vαβ, 0 |
patch_v_end_param | vαβ, 1 |
Parameters returned by SurfaceComposedGetSizes | |
---|---|
u_cnt | N |
v_cnt | M |
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_ind
- [in] - Surface patch index in U parametric direction of surfaces grid. The value must be in the range from 0 to u_cnt - 1, where u_cnt is the the size of the grid in U direction as returned by the function HM_ExtAPI::SurfaceComposedGetSizes().
- v_ind
- [in] - Surface patch index in V parametric direction of surfaces grid. The value must be in the range from 0 to v_cnt - 1, where v_cnt is the the size of the grid in V direction as returned by the function HM_ExtAPI::SurfaceComposedGetSizes().
- patch
- [out] - Surface patch.
- u_start_param
- [in] - U parameter of composed surface that corresponds to start of U parametric range of active area of the patch, which in turn is defined by patch parameter patch_u_start_param.
- u_end_param
- [out] - U parameter of composed surface that corresponds to end of U parametric range of active area of the patch, which in turn is defined by patch parameter patch_u_end_param.
- v_start_param
- [in] - V parameter of composed surface that corresponds to start of V parametric range of active area of the patch, which in turn is defined by patch parameter patch_v_start_param.
- v_end_param
- [out] - V parameter of composed surface that corresponds to end of V parametric range of active area of the patch, which in turn is defined by patch parameter patch_v_end_param.
- patch_u_start_param
- [out] - Surface patch parameter that defines start of U parametric range of active area included into the composed surface.
- patch_u_end_param
- [out] - Surface patch parameter that defines end of U parametric range of active area included into the composed surface.
- patch_v_start_param
- [out] - Surface patch parameter that defines start of V parametric range of active area included into the composed surface.
- patch_v_end_param
- [out] - Surface patch parameter that defines end of V parametric range of active area included into the composed surface.
Errors
None.