HM_ExtAPI::OffsetShellsByFaces()

Offsets faces connected into manifold shell in the direction of the shell normal.

Syntax

bool OffsetShellsByFaces(
int num_shells,
const HM_EntityGeomFace* shell_faces,
const double* offset_dists,
bool filter_by_comp,
HM_OffsetParamStruct& offset_params
)

Type

HyperMesh Ext API Function

Description

The "shell" in the context of the function OffsetShellsByFaces is defined as all faces that can be recursively connected via manifold edges to one of the input faces shell_faces, which thus serves as the reference face for the shell.

The normal of the face in shell_faces defines the direction of the normals used for the offset for all faces of the shell.



Figure 1.


Figure 2.

The offset distance and the direction of the normal offset with respect to the normal of each face of the shell inferred by the normal of the face from the array shell_faces is defined by the value of offset_dist member of HM_OffsetParamStruct structure offset_params. However, if the pointer to the array offset_dists is not NULL, the corresponding entry of this array is used instead.

The positive offset value of means that the faces are offset in the direction of their normals. The negative value means that the faces are offset in the direction opposite to the direction of their normals.


Figure 3.


Figure 4.
Setting the parameter filter_by_comp to true results in offsetting only those faces of the shell that are in the same component as the corresponding reference face from the array shell_faces.


Figure 5.

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

num_shells
[in] - Number of shells.
shell_faces
[in] - Array of faces that specify shells to offset. The number of entries in the array must be num_shells.
offset_dists
[in] - If not NULL then points to the array of offset distances for each shell. The number of entries in the array in this case must be num_shells. If the value in the array is positive, then all faces of the shell are offset in the direction defined by the normal of corresponding face from the array shell_faces. If the value is negative, then all faces of the shell are offset in the direction opposite to the direction defined by the normal of corresponding face from the array shell_faces.
If the value is NULL, the offset distance specified in the structure offset_params is used for all shells.
filter_by_comp
[in] - The flag that specifies whether additional filtering of shell faces has to be applied. This flag can have one of following values.
true - Only faces that are in the same component as corresponding face from the array shell_faces are offset.
false - All faces from the shell specified by corresponding face from the array shell_faces are offset.
offset_params
[in/out] - Offset parameters. See HM_OffsetParamStruct() for details.

Errors

None.