next up previous contents index
Next: Get Centroids of Polygon Up: Useful Functions for Developers Previous: Find 3D Lighting: get3_light   Contents   Index


Get Normals to Polygon Set: get3_normal

Calling Sequence
...
  
get3_normal(xyz [, nxyz])
Description
Return 3D normals for polygons with vertices XYZ. If NXYZ is specified, XYZ should be sum(nxyz)-by-3, with NXYZ being the list of numbers of vertices for each polygon (as for the plfp function; see page [*]). If NXYZ is not specified, XYZ should be a quadrilateral mesh, ni-by-nj-by-3 (as for the plf function; see page [*]). In the first case, the return value is len(NXYZ)-by-3; in the second case, the return value is (ni-1)-by-(nj-1)-by-3.

The normals are constructed from the cross product of the lines joining the midpoints of two edges which as nearly quarter the polygon as possible (the medians for a quadrilateral). No check is made that these not be parallel; the returned ``normal'' is [0, 0, 0] in that case. Also, if the polygon vertices are not coplanar, the ``normal'' has no precisely definable meaning.


next up previous contents index
Next: Get Centroids of Polygon Up: Useful Functions for Developers Previous: Find 3D Lighting: get3_light   Contents   Index
Michiel Jan Laurens de Hoon 2003-04-19