HM_OffsetParamStruct

Contains information that is used by the HM_ExtAPI::OffsetFaces() and HM_ExtAPI::OffsetShellsByFaces() functions to set offset parameters and return offset results.

Syntax

struct HM_OffsetParamStruct {
int size;
double offset_dist;
double offset_tol;
bool copy_faces;
int continuity_mode;
bool return_faces;
int num_result_faces;
HM_EntityGeomFace* result_faces;
int num_connector_faces;
HM_EntityGeomFace* connector_faces;
bool clean_degen;
};

Type

HyperMesh Ext API Function

Description

This structure contains information that is used by the HM_ExtAPI::OffsetFaces() and HM_ExtAPI::OffsetShellByFaces() functions to set offset parameters and return offset results.

The structure information is declared in hm_extapi.h.

The members are: size, offset_dist, offset_tol, copy_faces, continuity_mode, return_faces, num_result_faces, result_faces, num_connector_faces, connector_faces, and clean_degen

Inputs

size
Specifies the length, in bytes, of the structure. Use sizeof(HM_OffsetParamStruct) for this member. This is used to distinguish the current version of HM_OffsetParamStruct from possible future extended versions with additional members.
offset_dist
Specifies the offset distance. The sign defines the direction of the offset. A positive value corresponds to the offset in the direction of the faces normal. A negative value corresponds to the offset in the direction opposite to the direction of the normal.
This member is ignored if the parameter offset_dists in the functions HM_ExtAPI::OffsetFaces() and HM_ExtAPI::OffsetShellsByFaces() is not NULL.
offset_tol
Specifies the offset tolerance. A negative or zero value of this member indicates that the tolerance value is estimated automatically during the call to API functions.
copy_faces
The flag that specifies whether original faces are preserved. This member can have one of following values:
false - Original faces are replaced with offset faces.
true - Original faces are preserved and the copy of the original faces is offset.
continuity_mode
Specifies the type of continuity between offset faces and faces in the same shell that are not offset or offset a different distance.


Figure 1.
This member can have one of following values:
HM_OFFSET_MODE_DISCONNECT - Offset faces are disconnected from faces that are not offset or offset a different distance. This corresponds to the "disjoint offset" option in surface edit > offset subpanel.


Figure 2.
HM_OFFSET_MODE_FORCE_CONSISTENT - An error is returned if offset faces are connected to faces that are not offset or offset a different distance.
HM_OFFSET_MODE_CONNECT - Connector faces are created to preserve continuity between offset faces and faces that are not offset or offset a different distance. This corresponds to the "continuous offset" option in surface edit > offset subpanel with "separator lines" selected for all edges of the offset faces connected to faces that are not offset.


Figure 3.
HM_OFFSET_MODE_INF - Connected to offset faces that are not offset or offset a different distance are "morphed" continuously to preserve continuity. This is known as "infinite smooth radius" mode. Note that if faces are offset to different distances then in this mode the faces with the largest offset distance are offset last, so the faces connected to them are "morphed" and after that "morphing" are not offset exactly to the distance specified for them.


Figure 4.
return_faces
The flag that specifies whether offset faces should be returned as a result of the API offset functions call.
This member can have one of following values:
true - Result faces are returned as members num_result_faces, result_faces, num_connector_faces, and connector_faces in this structure.
false - Result faces are not returned.
num_result_faces
This member returns the number of faces that result from the faces that were offset.
result_faces
Returns the pointer to the array of faces that result from the faces that were offset. The number of entries in the array is num_result_faces.
To free the array allocated for this, use the function HM_ExtAPI::MemoryFree().
num_connector_faces
This member returns the number of connector faces that were created to preserve continuity between offset faces and faces that were not offset or offset a different distance.
connector_faces
Returns the pointer to the array of connector faces that were created to preserve continuity between offset faces and faces that were not offset or offset to different distance. The number of entries in the array is num_connector_faces.
To free the array allocated for this, use the function HM_ExtAPI::MemoryFree().
clean_degen
The flag that specifies whether additional check and cleanup should be done for possible degeneracies of the faces resulting from the offset to large distances.
This member can have one of following values:
false - No additional checking and cleanup are done.
true - Additional checking and cleanup of degeneracies are done.

Note that setting this to true can significantly slow down overall performance of the offset function. It is, therefore, recommended to set this option to false for large models with relatively small offset distance values.

Errors

None.