Returns the center point of each face of a mesh object.
rhinoscriptsyntax.MeshFaceCenters (mesh_id)
rhinoscript.mesh.MeshFaceCenters (mesh_id)
mesh_id |
Required. String or Guid. The identifier of a mesh object. |
List |
A list of 3-D points that define the face center points of the mesh if successful. The number of elements in the list will be equal to the value returned by MeshFaceCount. In which case, the list will identify the center points for each face return by MeshFaces. |
None |
If not successful, or on error. |
import rhinoscriptsyntax as rs
obj = rs.GetObject("Select mesh", rs.filter.mesh)
centers = rs.MeshFaceCenters(obj)
if centers:
for point in centers: rs.AddPoint(point)