HM_ExtAPI::CreateSurfaceComposed()

Creates composed surface object.

Syntax

bool CreateSurfaceComposed(
HM_EntityGeometrySurface & new_surf,
int  u_size,
int v_size,
const HM_EntityGeometrySurface* surf_patches,
const double* u_start_params,
const double* u_end_params,
const double* v_start_params,
const double* v_end_params,
const double* u_surf_params,
const double* v_surf_params
);

Type

HyperMesh Ext API Function

Description

The function creates the surface object of the type HM_ExtAPI::COMPOSED_SURFACE().

Composed surface geometry is defined by its patches. The parametric space of the composed surface is subdivided into the grid of rectangular cells with each cell corresponding to one of the patches of the composed surface. Depending on the location of the composed surface parameter in one of parametric cells corresponding patch is used to calculate the surface point for this parameter.

Figure 1.

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β)

The following table clarifies correspondence between parameters used in the equations above and parameter values used by the function CreateSurfaceComposed.

Parameters used by CreateSurfaceComposed Composed surface parameters
u_size N
v_size M
surf_patches {Sαβ}
u_start_params {uαβ, 0}
u_end_params {uαβ, 1}
v_start_params {vαβ, 0}
v_end_params {vαβ, 1}
u_surf_params {uα}
v_surf_params {vβ}

If the value of the parameter u_surf_params is NULL then internal U- parameterization of the composed surface is set automatically.

If the value of the parameter v_surf_params is NULL then internal V- parameterization of the composed surface is set automatically.

Both u_start_params and u_end_params values must be NULL or not NULL at the same time.

If both u_start_params and u_end_params values are NULL then default U-parameterization of patch surfaces is used to determine the region of the patch used in the composed surface.

Both v_start_params and v_end_params values must be NULL or not NULL at the same time.

If both v_start_params and v_end_params values are NULL then default V-parameterization of patch surfaces is used to determine the region of the patch used in the composed surface.

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_surf
[out] - Handle to new surface object.
u_size
[in] - Number of patches in U direction of the grid of input surfaces.
v_size
[in] - Number of patches in V direction of the grid of input surfaces.
surf_patches
[in] - Pointer to array of input surfaces. The number of entries in the array must equal to u_size multiplied by v_size.
u_start_params
[in] - If not NULL then points to array of U parameters that define lower bound of the rectangular region of each patch used in composed surface. The size of the array in this case must equal to u_size multiplied by v_size.
u_end_params
[in] - If not NULL then points to array of U parameters that define upper bound of the rectangular region of each patch used in composed surface. The size of the array in this case must equal to u_size multiplied by v_size.
v_start_params
[in] - If not NULL then points to array of V parameters that define lower bound of the rectangular region of each patch used in composed surface. The size of the array in this case must equal to u_size multiplied by v_size.
v_end_params
[in] - If not NULL then points to array of V parameters that define upper bound of the rectangular region of each patch used in composed surface. The size of the array in this case must equal to u_size multiplied by v_size.
u_surf_params
[in] - If not NULL then points to array of U parameters of the composed surface grid. The size of the array in this case must equal to u_size+1.
v_surf_params
[in] - If not NULL then points to array of V parameters of the composed surface grid. The size of the array in this case must equal to v_size+1.

Errors

None.