polyop.getFaceCenter <Poly poly> <int face> \
node:<node=unsupplied>
Returns the center of the face by taking the average of all its vertices.
If <poly>
is a node, or if <poly>
is an Editable Poly and <node>
is specified, the position returned is in the current coordinate system context.
If <poly>
is an Editable Poly and <node>
is not specified, the return value is in the poly's local coordinate system.
polyop.getSafeFaceCenter <Poly poly> <int face> \
node:<node=unsupplied>
Returns the "safe" center of the face, if possible.
For non-convex faces, the average point found using getFaceCenter
is unsuitable for some applications because it can lie outside the face completely, or in a region where it cannot see all the face's vertices (line segments from the center to the corner pass outside of the face).
If a safe center cannot be found, a value of undefined
is returned.
This routine provides a better solution in some cases by finding the center of the convex hull of the face. The convex hull is defined as the region in a face with a clear line-of-sight to all the corners. Some faces such as, the top face in an extruded letter M have an empty convex hull, in which case this routine fails and merely provides the regular center given by ComputeCenter
.
If <poly>
is a node, or if <poly>
is an Editable Poly and <node>
is specified, the position returned is in the current coordinate system context.
If <poly>
is an Editable Poly and <node>
is not specified, the return value is in the poly's local coordinate system.
polyop.getFaceNormal <Poly poly> <int face> \
node:<node=unsupplied>
Returns the face normal of the face.
If <poly>
is a node, or if <poly>
is an Editable Poly and <node>
is specified, the direction vector returned is in the current coordinate system context.
If <poly>
is an Editable Poly and <node>
is not specified, the return value is in the poly's local coordinate system.
polyop.getFaceArea <Poly poly> <int face>
Returns the area of the specified face.