Properties
Gets or sets the total number of mesh triangles and quads the internal data structure can hold without resizing.
Gets or sets the number of mesh faces. When getting this can includes invalid faces.
Implements: Count
Gets the number of faces that are valid quads (4 corners).
Indexers
Methods
Appends a new quadrangular face to the end of the mesh face list.
Returns: The index of the newly added quad.
Appends a new triangular face to the end of the mesh face list.
Returns: The index of the newly added triangle.
Appends a new mesh face to the end of the mesh face list.
Returns: The index of the newly added face.
Appends a list of faces to the end of the mesh face list.
Returns: Indices of the newly created faces
Gets all faces that share a topological edge with a given face.
Returns: All indices that share an edge.
Splits non-planar quads into two triangles based on given parameters.
public int ConvertNonPlanarQuadsToTriangles()
planarTolerance,
If planarTolerance >= 0, then a quad is split if its vertices are not coplanar. If both planarTolerance = Rhino.RhinoMath.UnsetValue and angleToleranceRadians >= 0.0, then the planarity test is skipped.
angleToleranceRadians,
If angleToleranceRadians >= 0.0, then a quad is split if the angle between opposite corner normals is > angleToleranceRadians. The corner normal is the normal to the triangle formed by two adjacent edges and the diagonal connecting their endpoints. A quad has four corner normals. If both angleToleranceRadians = Rhino.RhinoMath.UnsetValue and planarTolerance >= 0.0, then the corner normal angle test is skipped.
splitMethod
0 default Currently divides along the short diagonal. This may be changed as better methods are found or preferences change. By passing zero, you let the developers of this code decide what's best for you over time. 1 divide along the short diagonal 2 divide along the long diagonal 3 minimize resulting area 4 maximize resulting area 5 minimize angle between triangle normals 6 maximize angle between triangle normals
Remarks: If both planarTolerance = Rhino.RhinoMath.UnsetValue and angleToleranceRadians = Rhino.RhinoMath.UnsetValue, then all quads are split.
Returns: Number of quads that were converted to triangles.
Splits all quads along the short diagonal.
Returns: true on success, false on failure.
Joins adjacent triangles into quads if the resulting quad is 'nice'.
public bool ConvertTrianglesToQuads()
angleToleranceRadians,
Used to compare adjacent triangles' face normals. For two triangles to be considered, the angle between their face normals has to be <= angleToleranceRadians. When in doubt use RhinoMath.PI/90.0 (2 degrees).
minimumDiagonalLengthRatio
( <= 1.0) For two triangles to be considered the ratio of the resulting quad's diagonals (length of the shortest diagonal)/(length of longest diagonal). has to be >= minimumDiagonalLengthRatio. When in doubt us .875.
Returns: true on success, false on failure.
Attempts to removes degenerate faces from the mesh.
Degenerate faces are faces that contains such a combination of indices, that their final shape collapsed in a line or point.
Before returning, this method also attempts to repair faces by juggling vertex indices.
Returns: The number of degenerate faces that were removed.
Removes a collection of faces from the mesh without affecting the remaining geometry.
public int DeleteFaces()
faceIndexes,
An array containing all the face indices to be removed.
compact
If true, removes vertices that are no longer referenced.
Returns: The number of faces deleted on success.
Removes a collection of faces from the mesh without affecting the remaining geometry.
Returns: The number of faces deleted on success.
Releases all memory allocated to store faces. The list capacity will be 0 after this call.
Subsequent calls can add new items.
public void Destroy()
Extracts, or removes, duplicate faces.
public Mesh ExtractDuplicateFaces()
Returns: A mesh containing the extracted duplicate faces if successful, null otherwise.
Extracts, or removes, faces.
Returns: A mesh containing the extracted faces if successful, null otherwise.
Gets an array of pairs of mesh faces that clash.
Returns: Array of pairs of mesh face indices.
Find all connected face indices where adjacent face normals meet the criteria of angleRadians and greaterThanAngle
Returns: list of connected face indices
Find all connected face indices
Returns: list of connected face indices
Uses startFaceIndex and finds all connected face indexes up to unwelded or naked edges. If treatNonmanifoldLikeUnwelded is true then non-manifold edges will be considered as unwelded or naked
Returns: Array of connected face indexes
Finds all of the duplicate faces.
Returns: The indexes that are duplicates of other indexes if successful. If there are no duplicate, then an empty array is returned.
Gets an enumerator that yields all faces in this collection.
Returns: The enumerator.
Returns the mesh face at the given index.
Returns: The mesh face at the given index on success or MeshFace.Unset if the index is out of range.
Returns the mesh face at the given index.
Returns: The mesh face at the given index on success or MeshFace.Unset if the index is out of range.
Gets the center point of a face.
For a triangular face, this is the centroid or barycenter.
For a quad, this is the average of four comer points.
Returns: The center point.
Gets the 3D location of the vertices forming a face.
public bool GetFaceVertices()
faceIndex,
A face index.
out Point3f
a,
A first point. This out argument is assigned during the call.
out Point3f
b,
A second point. This out argument is assigned during the call.
out Point3f
c,
A third point. This out argument is assigned during the call.
out Point3f
d
A fourth point. This out argument is assigned during the call.
Returns: true if the operation succeeded, otherwise false.
Gets the topology vertex indices of a face.
Returns: An array of integers.
Examines and adds face indexes to whollyDegenerateFaces if the face is a triangle with zero area or a quad both triangles have zero area. Face indexes are added to partiallyDegenerateFaces when a quad has one triangle with zero area.
Returns: Returns true if the mesh has wholly or partially degenerate faces, false otherwise.
Returns true if at least one of the face edges are not topologically connected to any other faces.
Returns: true if that face makes the mesh open, otherwise false.
Inserts a mesh face at a defined index in this list.
Exceptions:
| ArgumentOutOfRangeException | If index is negative or >= Count. |
Merges two triangular mesh faces that share an edge into one quadrangular face.
Returns: true if successful, false otherwise.
Deletes or fixes mesh faces that have zero area.
Returns: Number of removed wholly degenerate faces.
Sets a quadrangular face at a specific index of the mesh.
Returns: true if the operation succeeded, otherwise false.
Sets a triangular face at a specific index of the mesh.
Returns: true if the operation succeeded, otherwise false.
Sets a face at a specific index of the mesh.
Returns: true if the operation succeeded, otherwise false.
ToIntArray
#Copies all of the faces to a linear array of indices. Clean-up of vertex indices if replacedIndices is a valid List<int> ///
Returns: The int array. This method never returns null.