How can I iterate over faces that contain a vertex with a given ID? #5407
Answered
by
Grantim
PhilNamesnik8463
asked this question in
Q&A
-
|
I have a surface mesh in 3D, represented by a Mesh object. For a single vertex v_i of that mesh, I want to find all faces that contain v_i. In a next step I want to find the normals of the surrounding faces. Thanks! |
Beta Was this translation helpful? Give feedback.
Answered by
Grantim
Nov 21, 2025
Replies: 1 comment
-
|
Hello! You can do it like this: from meshlib import mrmeshpy as mm
mesh = mm.makeSphere(mm.SphereParams()) # as example
v_i = mm.VertId(0) # as example
for e in mm.orgRing(mesh.topology,v_i): # iterate over incident edges of `v_i`
f = mesh.topology.left(e) # find left face
if not f.valid():
continue # skip edges with no left face
fNorm = mesh.normal(f)
print (fNorm) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
Fedr
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello!
You can do it like this: