The following methods provide basic access to the mesh faces.
Returns number of faces as an integer, equivalent to using <mesh> .numfaces
Set the number of faces as specified. If the optional boolean argument is true, the existing topology remains intact. If it is false or left off, the topology is lost.
For all new faces, the following occurs:
Returns the face vertex indexes for the indexed face as a point3. Each component of the point3 value contains a vertex index.
Sets the face vertex indexes for the indexed face from a point3.
Sets the face vertex indexes for the indexed face from 3 vertex indexes.
Deletes indexed face from the mesh. Renumbers faces accordingly.
Deletes indexed face from the mesh, welding its 3 vertices together at the center of the original face. Renumbers faces accordingly.
Returns the normal of the indexed face as a point3.
Sets the indexed face's normal vector. As soon as you run update() on the mesh, this value is overwritten.
Returns the indexed face's material ID as an integer.
Returns the indexed face's smoothing groups as a 32-bit integer. There are 32 possible smoothing groups. Each bit in the returned value corresponds to a smoothing group. If a bit is turned on, the face is part of that smoothing group. You can retrieve the list of smoothing groups for a face as a BitArray using the following function:
Sets the indexed face's smoothing groups. If you have a face's desired smoothing groups as a BitArray, you could set the face's smoothing group data using the following function:
Retrieves the face selection set, or the specified named selection set if the optional name: parameter is specified, as a BitArray. See the getVertSelection() method for more information.
setFaceSelection <node> [ <modifier_or_index> ] ( <sel_bitarray> | <sel_array> ) [name:<name> ] [keep:<boolean> ] setFaceSelection <mesh> ( <sel_bitarray> | <sel_array> ) [keep:<boolean> ]
Sets the face selections in an Editable Mesh base object, Mesh Select modifier, Edit Mesh modifier, or TriMesh. This mirrors the selection getting method above. See the setVertSelection() method for more information.
Deselects the hidden faces in the mesh. This method is not applicable to TriMeshes.
extrudeFace <mesh> ( <index> | <bitarray> | <integer_array> | #selection) <amount> <scale> [dir:(<point3> | #common | #independent) ]
Provides capabilities equivalent to the Extrude Face modifier. This function works only on Editable Mesh nodes. The second argument defines which faces to extrude, either a single face index, a BitArray of face indexes, an integer array of face indexes, or the name literal #selection meaning the current face selection in the Editable Mesh. The <amount> argument specifies the extrude distance and the <scale> specifies a % amount to scale each face cluster.
If the optional dir: keyword argument is not specified, face clusters are extruded by moving their vertices independently along the average normal at each vertex, as does the Extrude Face modifier. If it is specified, it can be a point3 giving a direction vector in which all vertices are moved, or it can be the value #independent which is the same as the default direction, or it can be the value #common which extrudes face clusters along the average normal of all the face normals in each cluster. #common is equivalent to the Group Normal option in EditableMesh, and #independent is equivalent to the Local Normal option.