MeshFaceList

MeshFaceList

Provides access to the faces and Face related functionality of a Mesh.

Members

capacity :int

Gets or sets the total number of mesh triangles and quads the internal data structure can hold without resizing.
Type:
  • int

count :int

Gets or sets the number of mesh faces. When getting this can includes invalid faces.
Type:
  • int

quadCount :int

Gets the number of faces that are valid quads (4 corners).
Type:
  • int

triangleCount :int

Gets the number of faces that are valid triangles (3 corners).
Type:
  • int

Methods

addFace(vertex1, vertex2, vertex3) → {int}

Appends a new triangular face to the end of the mesh face list.
Parameters:
Name Type Description
vertex1 int Index of first face corner.
vertex2 int Index of second face corner.
vertex3 int Index of third face corner.
Returns:
The index of the newly added triangle.
Type
int

addFace(vertex1, vertex2, vertex3, vertex4) → {int}

Appends a new quadrangular face to the end of the mesh face list.
Parameters:
Name Type Description
vertex1 int Index of first face corner.
vertex2 int Index of second face corner.
vertex3 int Index of third face corner.
vertex4 int Index of fourth face corner.
Returns:
The index of the newly added quad.
Type
int

clear()

Clears the Face list on the mesh.

convertNonPlanarQuadsToTriangles(planarTolerance, angleToleranceRadians, splitMethod) → {int}

Splits non-planar quads into two triangles based on given parameters.
Parameters:
Name Type Description
planarTolerance double 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 double 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 int 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
Returns:
Number of quads that were converted to triangles.
Type
int

convertQuadsToTriangles() → {bool}

Splits all quads along the short diagonal.
Returns:
true on success, false on failure.
Type
bool

convertTrianglesToQuads(angleToleranceRadians, minimumDiagonalLengthRatio) → {bool}

Joins adjacent triangles into quads if the resulting quad is 'nice'.
Parameters:
Name Type Description
angleToleranceRadians double 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 double ( <= 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.
Type
bool

cullDegenerateFaces() → {int}

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.
Type
int

destroy()

Releases all memory allocated to store faces. The list capacity will be 0 after this call. Subsequent calls can add new items.

get()

...

hasNakedEdges(faceIndex) → {bool}

Returns true if at least one of the face edges are not topologically connected to any other faces.
Parameters:
Name Type Description
faceIndex int A face index.
Returns:
true if that face makes the mesh open, otherwise false.
Type
bool

isHidden(faceIndex) → {bool}

Gets a value indicating whether a face is hidden. A face is hidden if, and only if, at least one of its vertices is hidden.
Parameters:
Name Type Description
faceIndex int A face index.
Returns:
true if hidden, false if fully visible.
Type
bool

setFace(index, vertex1, vertex2, vertex3) → {bool}

Sets a triangular face at a specific index of the mesh.
Parameters:
Name Type Description
index int A position in the list.
vertex1 int The first vertex index.
vertex2 int The second vertex index.
vertex3 int The third vertex index.
Returns:
true if the operation succeeded, otherwise false.
Type
bool

setFace(index, vertex1, vertex2, vertex3, vertex4) → {bool}

Sets a quadrangular face at a specific index of the mesh.
Parameters:
Name Type Description
index int A position in the list.
vertex1 int The first vertex index.
vertex2 int The second vertex index.
vertex3 int The third vertex index.
vertex4 int The fourth vertex index.
Returns:
true if the operation succeeded, otherwise false.
Type
bool