.\" @(#)PEXGeoNormFillAreaSet.3 1.5 95/03/24 SMI; .so man3/pex.macs .TH PEXGeoNormFillAreaSet 3 "May 1995" "Solaris PEXlib Reference Manual" "" .SH NAME PEXGeoNormFillAreaSet - utility function .SH SYNTAX .HP int PEXGeoNormFillAreaSet\^(\^unsigned int \fIfacet_attributes\fP, unsigned int \fIvertex_attributes\fP, int \fIcolor_type\fP, unsigned int \fIcount\fP, PEXFacetData *\fIfacet_data\fP, PEXListOfVertex *\fIvertex_lists\fP) .SH PARAMETERS .IP \fIfacet_attributes\fP 1i A mask indicating the facet attributes provided. It should contain the bit .B PEXGANormal. .IP \fIvertex_attributes\fP 1i A mask indicating the vertex attributes provided. .IP \fIcolor_type\fP 1i The type of color data provided. .IP \fIcount\fP 1i The number of fill areas in the set. .IP \fIfacet_data\fP 1i An array of facet data. This function adds the geometric normal to this data. .IP \fIvertex_lists\fP 1i A pointer to the list of vertex arrays defining each contour of the fill area set. .SH RETURNS Zero if successful; otherwise, one of the following: .TP .B PEXBadPrimitive A normal cannot be computed because all fill areas in the set are degenerate or because the vertices of all the fill areas are colinear. .SH DESCRIPTION .\" indexing .IX PEXGeoNormFillAreaSet .IX "Utility Functions" PEXGeoNormFillAreaSet .IX "Fill Area" PEXGeoNormFillAreaSet .LP This function computes the geometric normal of a fill area set and stores it in the specified facet data. .LP The normal is computed by finding the first three non-colinear points in a fill area of the set, beginning with the first fill area and searching until three such points are found in a single fill area. Two vectors are formed from these points: one vector from the first point to the second point, and one vector from the first point to the third point. The geometric normal returned is the normalized cross product of those two vectors. .LP The three points, A, B, and C are selected as follows. Point A is the first point in the first list of vertices. Point B is the next point in that same list that is not coincident with A. Point C is the next point in that same list that is not colinear with A and B. If it is not possible to find three such points in the first list, then the rest of the lists are searched in order to select three appropriate points from a single list. If it is still not possible to find three such points in any list, the functions returns unsuccessfully. .LP If the facet attributes does not contain the bit .B PEXGANormal, the geometric normal is not computed. However, the function still returns successfully. .SH ERRORS None