Class Face
A face is composed of a set of triangles, and a material.
Triangle indices may point to the same vertex index as long as the vertices are unique to the face. That is, every vertex that a face references should only be used by that face's indices. To associate vertices that share common attributes (usually position), use the sharedIndexes property.
ProBuilder automatically manages condensing common vertices in the UnityEditor.ProBuilder.EditorMeshUtility.Optimize function.
Inherited Members
Namespace: UnityEngine.ProBuilder
Assembly: Unity.ProBuilder.dll
Syntax
[Serializable]
public sealed class Face
Constructors
Name | Description |
---|---|
Face() | Creates a Face with an empty triangles array. |
Face(IEnumerable<int>) | Creates a face with default values and the specified set of triangles. |
Face(Face) | Creates a new Face as a copy of another face. |
Properties
Name | Description |
---|---|
this[int] | Gets the index for the specified triangle in this face's array of triangle indices. |
distinctIndexes | Gets a collection of the vertex indexes that the indexes array references, made distinct. |
edges | Gets the perimeter edges that compose this face. |
indexes | Gets the triangle indices that compose this face. |
manualUV | Gets or sets whether to map this face's UV coordinates manually or automatically. See Mapping Textures with UVs for an overview of the differences. |
smoothingGroup | Gets or sets which smoothing group this face belongs to, if any. This is used to calculate vertex normals. |
submeshIndex | Gets or sets the index of the submesh that this face belongs to. |
textureGroup | Gets or sets which texture group this face belongs to. ProBuilder uses texture groups when projecting Auto UVs. See Continuous tiling. |
uv | Gets or sets a reference to the Auto UV mapping parameters. |
Methods
Name | Description |
---|---|
Contains(int, int, int) | Tests whether a triangle matches one of the triangles of this face. |
CopyFrom(Face) | Copies properties and triangles from the specified face to this face. |
IsQuad() | Returns whether this face can be converted to a quad (a polygon with four sides). |
Reverse() | Reverses the order of the triangle array. This has the effect of reversing the direction that this face renders. |
SetIndexes(IEnumerable<int>) | Sets the triangles that compose this face. |
ShiftIndexes(int) | Adds an offset to each value in the indices array. |
ShiftIndexesToZero() | Finds the smallest value in the indices array, then offsets by subtracting that value from each index. |
ToQuad() | Converts a two-triangle face to a quad representation. |
ToString() | Returns a string representation of the face. |