MeshFaces

Returns the face vertices of a mesh object.

Syntax

rhinoscriptsyntax.MeshFaces (object_id, face_type = True)

rhinoscript.mesh.MeshFaces (object_id, face_type = True)

Parameters

object_id

Required.  String or Guid.  The identifier of a mesh object.

face_type

Optional.  Boolean.  The face type to be returned.  If omitted, both triangles and quads are returned (True)

Value

Description

True

Both triangles and quads.

False

Only triangles.

Returns

list

A list 3D points that define the face vertices of the mesh if successful.  If face_type is True, then faces are returned as both quads and triangles (4 3-D points).  For triangles, the third and forth vertex will be identical.  If face_type is False, then faces are returned as only triangles (3 3-D points).  Quads will be converted to triangles.

None

If not successful, or on error.

Example

import rhinoscriptsyntax as rs

obj = rs.GetObject("Select mesh", rs.filter.mesh)

faces = rs.MeshFaces(obj, False)

if faces:

    rs.EnableRedraw(False)

    i = 0

    while( i<=len(faces) ):

        face = faces[i], faces[i+1], faces[i+2], faces[i]

        rs.AddPolyline( face )

        i += 3

rs.EnableRedraw(True)

Also See

IsMesh

MeshContourPoints

MeshFaceCount

MeshVertexCount

MeshVertices