Extract Mesh Faces with Naked Edges

@stevebaer could you help me with this:

#python to extract mesh faces with naked edges
import rhinoscriptsyntax as rs
import os.path
from os import path
import Rhino

mesh = rs.GetObject(“Select mesh”, rs.filter.mesh)
vertices = rs.MeshVertices(mesh)
meshfaces = rs.MeshFaceVertices(mesh)
naked = rs.MeshNakedEdgePoints(mesh)
for i, vertex in enumerate(vertices):
if naked[i]:
rs.AddPoint(vertices[i])
vertex_faces = rs.MeshVertexFaces(mesh, i )
if vertex_faces:
for face_index in vertex_faces:
face = meshfaces[face_index]
Rhino.Geometry.Collections.MeshFaceList.ExtractFaces(something,face)

same problem, I can’t run the ExtractFaces Method, what shoud I change/add? Thanks in advance!

Hello - to get a mesh face list you need to have Rhino mesh - the rs.GetObject() returns a guid and not a mesh object- rs.meshFaces returns a list but not in the form that can be used directly as a MeshFaceList .

Put a break point at the ‘pass’ in the code below and look at the various items and what they are:


import Rhino
import rhinoscriptsyntax as rs


meshId = rs.GetObject("Select mesh", rs.filter.mesh)
fList = rs.MeshFaces(meshId)
mesh = rs.coercemesh(meshId)

meshfaces = mesh.Faces
pass

-Pascal