Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ PEXGeoNormFillArea(3) — Open3D 4.96

Media Vault

Software Library

Restoration Projects

Artifacts Sought

PEXGeoNormFillArea(3)  —  Subroutines

Name

PEXGeoNormFillArea

Synopsis

int PEXGeoNormFillArea(unsigned int facet_attributes, unsigned int vertex_attributes, int color_type, PEXFacetData ∗facet_data, unsigned int count, PEXArrayOfVertex vertices)

Arguments

facet_attributes
A mask indicating the facet attributes provided.  It should contain the bit PEXGANormal.

vertex_attributes
A mask indicating the vertex attributes provided.

color_typeThe type of color data provided. 

facet_dataA pointer to facet data.  This function adds the geometric normal to this data. 

countThe number of vertices. 

verticesAn array of vertices defining the fill area. 

Returns

Zero if successful; otherwise, one of the following:

PEXBadPrimitive - A normal cannot be computed because the fill area is degenerate or because all vertices are colinear. 

Description

This function computes the geometric normal of a fill area and stores it in the specified facet data. 

The normal is computed by finding the first three non-colinear points in the specified vertices, forming two vectors from those points, one from the first point to the second point and one from the first point to the third point, and computing the cross product of those two vectors.  The geometric normal is the normalized cross product. 

The three points, A, B, and C are selected as follows.  Point A is the first point in the list of vertices.  Point B is the next point in the list that is not coincident with A.  Point C is the next point in the list that is not colinear with A and B.  If it is not possible to find three such points, the functions returns unsuccessfully. 

If the facet attributes does not contain the bit PEXGANormal, the geometric normal is not computed.  However, the function still returns successfully.

Errors

None

See Also

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026