# MeshFace struct

Namespace: [Rhino.Geometry](https://developer.rhino3d.com/api/rhinocommon/namespace/rhino.geometry.md) · Assembly: [RhinoCommon](https://developer.rhino3d.com/api/rhinocommon/assembly/rhinocommon.md)

```cs
[StructLayout(LayoutKind.Sequential, Pack = 4, Size = 16)]
[DebuggerDisplay("{DebuggerDisplayUtil}")]
[Serializable]
public struct MeshFace : IEquatable<MeshFace>, IComparable<MeshFace>, IComparable
```

Represents the values of the four indices of a mesh face quad.

If the third and fourth values are the same, this face represents a triangle.

## Constructors

- [MeshFace](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/ctor.md): (2 overloads) Constructs a new quadrangular Mesh face.

## Properties

- [A](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/a.md): Gets or sets the first corner index of the mesh face.
- [B](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/b.md): Gets or sets the second corner index of the mesh face.
- [C](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/c.md): Gets or sets the third corner index of the mesh face.
- [D](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/d.md): Gets or sets the fourth corner index of the mesh face. If D equals C, the mesh face is considered to be a triangle rather than a quad.
- [IsQuad](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/isquad.md): Gets a value indicating whether or not this mesh face is a quad. A mesh face is considered to be a triangle when C does not equal D, thus it is possible for an Invalid mesh face to also be a quad.
- [IsTriangle](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/istriangle.md): Gets a value indicating whether or not this mesh face is a triangle. A mesh face is considered to be a triangle when C equals D, thus it is possible for an Invalid mesh face to also be a triangle.
- [Unset](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/unset.md): (static) Gets an Unset MeshFace. Unset faces have Int32.MinValue for all corner indices.

## Indexers

- [this[]](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/item.md): Gets or sets the vertex index associated with an entry in this face.

## Methods

- [CompareTo](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/compareto.md): Compares this [MeshFace](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface.md) with another [MeshFace](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface.md) and returns a value of 1, 0, or -1, referring to dictionary order. Index evaluation priority is first A, then B, then C, then D.
- [Equals](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/equals.md): (2 overloads) Returns a value indicating whether the other mesh face has precisely the same value as the current one.
- [Flip](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/flip.md): Reverses the orientation of the face by swapping corners. The first corner is always maintained.
- [GetHashCode](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/gethashcode.md): Returns a runtime-stable hash code for the current mesh face. You are not allowed to rely on persistence of this hash code in serialization, but for each version of RhinoCommon, this hash code will be the same for each mesh face.
- [IsValid](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/isvalid.md): (3 overloads) Gets a value indicating whether or not this mesh face is considered to be valid. Note that even valid mesh faces could potentially be invalid in the context of a specific Mesh, if one or more of the corner indices exceeds the number of vertices on the mesh. If you want to perform a complete validity check, use IsValid(int) instead.
- [IsValidEx](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/isvalidex.md): Gets a value indicating whether or not this mesh face is considered to be valid. Unlike the simple IsValid function, this function takes actual point locations into account.
- [Repair](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/repair.md): Attempts to repair this mesh face by taking both face indexes and actual vertex locations into account.
- [RepairEx](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/repairex.md): Attempts to repair this mesh face by taking both face indexes and actual vertex locations into account.
- [Set](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/set.md): (2 overloads) Sets all the corners for this face as a quad.
- [IComparable.CompareTo](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/system-icomparable-compareto.md)
- [ToString](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/tostring.md): Returns a string representation for this [MeshFace](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface.md). This is to provide a meaningful visualization of this structure and is subject to change in newer releases.

## Operators

- [operator ==](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/op-equality.md): (static) Determines whether two [MeshFace](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface.md) structures have equal values.
- [operator !=](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface/op-inequality.md): (static) Determines whether two [MeshFace](https://developer.rhino3d.com/api/rhinocommon/type/rhino.geometry.meshface.md) structures have different values.
