Brief Index      Full Index      Events Index      I.M. Reference

Compute_Polygon_Normal

Functions

HC_BOOLEAN Compute_Polygon_Normal (int count, const HC_POINT *points, const char *hand, HC_POINT *out_vector)
HC_BOOLEAN DCompute_Polygon_Normal (int count, const HC_DPOINT *points, const char *hand, HC_DVECTOR *out_vector)

Function Documentation

HC_BOOLEAN Compute_Polygon_Normal ( int  count,
const HC_POINT *  points,
const char *  hand,
HC_POINT *  out_vector 
)
Parameters:
count- Number of xyz triplets in points
points- As in Insert_Polygon() , xyz triplets to specify the 3D vertices of the polygon. Must be coplanar.
hand- The definition order of the polygon --- "left" or "right".
out_vector- Output 3D vector returned to the caller.
Returns:
success

DETAILS

Compute_Polygon_Normal() accepts a list of points in the format of Insert_Polygon() and attempts to find a vector that is perpendicular to the polygon. If the points do not all lie in the same plane, the result is indeterminate. If no such vector can be found (the points are all co linear, for example), false is returned and out_vector is unchanged. The polygon must be defined as either "left-handed" (if the fingers of the left hand are curved around the points in the order defined, then the thumb will point in the direction of the normal) or as "right-handed".

NOTES

RESTRICTIONS

See also:
Compute_Coordinates, Compute_Polygon_Plane, Compute_Transform, Set_Modelling_Matrix, Show_Polygon, Show_Shell.
HC_BOOLEAN DCompute_Polygon_Normal ( int  count,
const HC_DPOINT *  points,
const char *  hand,
HC_DVECTOR *  out_vector 
)

Similar to Compute_Polygon_Normal, but operates on double-precision data.

Parameters:
count- Number of xyz triplets in points
points- As in Insert_Polygon() , xyz triplets to specify the 3D vertices of the polygon. Must be coplanar.
hand- The definition order of the polygon --- "left" or "right".
out_vector- Output 3D vector returned to the caller.
Returns:
success

Brief Index      Full Index      Events Index      I.M. Reference