MeshFace
References[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
Constructs a new quadrangular Mesh face.
Properties
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.
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.
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.
Indexers
Methods
Returns a value indicating whether the other mesh face has precisely the same value as the current one.
Parameters:
| other (MeshFace) | The other mesh face for comparison. |
Returns: true if the other face is, also orderly, equal to the present one; otherwise false.
Equals
#Returns a value indicating whether the other object obj has precisely the same value as the current one.
Parameters:
| obj (object) | Any object the represents the other mesh face for comparison. |
Returns: true if obj is a mesh face that, also orderly, equals to the present one; otherwise false.
Overrides: ValueType.Equals
Reverses the orientation of the face by swapping corners. The first corner is always maintained.
GetHashCode
#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.
Returns: A non-unique integer that represents this mesh face.
Overrides: ValueType.GetHashCode
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.
Gets a value indicating whether or not this mesh face is considered to be valid. Unlike the simple IsValid function, this function takes upper bound indices into account.
Parameters:
| vertexCount (int) | Number of vertices in the mesh that this face is a part of. |
Returns: true if the face is considered valid, false if not.
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.
Parameters:
| points (Point3d[]) | Array of vertices with which to validate the face. |
Returns: true if the face is considered valid, false if not.
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.
Parameters:
| points (ref Point3d[]) | Array of vertices with which to validate the face. |
Returns: true if the face is considered valid, false if not.
Attempts to repair this mesh face by taking both face indexes and actual vertex locations into account.
Remarks: This function assumes the face is invalid and attempts to repair unconditionally. It is only worthwhile to call Repair on faces where IsValid returns false.
Parameters:
| points (Point3d[]) | Array of vertices with which to consider when repairing the face. |
Returns: true if the face was repaired, false if not.
Attempts to repair this mesh face by taking both face indexes and actual vertex locations into account.
Remarks: This function assumes the face is invalid and attempts to repair unconditionally. It is only worthwhile to call Repair on faces where IsValid returns false. This function is the analog of UnsafeNativeMethods.ON_MeshFace_Repair done completely here to avoid copying the point array.
Parameters:
| points (ref Point3d[]) | Array of vertices with which to consider when repairing the face. |
Returns: true if the face was repaired, false if not.
Sets all the corners for this face as a quad.
Sets all the corners for this face as a triangle.
ToString
#Returns a string representation for this MeshFace. This is to provide a meaningful visualization of this structure and is subject to change in newer releases.
Returns: The string representation.
Overrides: ValueType.ToString