I have a script that returns the 4 vertices of a polygon. How can i delete this polygon?
I've tried using bmesh
but need the face index and not vertices.
This is a follow up to this question. See it for more details.
I have a script that returns the 4 vertices of a polygon. How can i delete this polygon?
I've tried using bmesh
but need the face index and not vertices.
This is a follow up to this question. See it for more details.
v.link_faces
gives you all the polys v
is used in. So you just need the face common to all the verts.
fs = set(v0.link_faces)
fs.intersection_update(v1.link_faces)
fs.intersection_update(v2.link_faces)
fs.intersection_update(v3.link_faces)
for f in fs:
bm.faces.remove(f)
index
argument; replace the try
block with the first four lines of this code and use f
as the argument to the call to to_delete
$\endgroup$
Commented
Jan 6, 2022 at 19:39
vN
in the above with bm.verts[N]
. You also need to put bm.verts.ensure_lookup_table()
as a line at the start of the code.
$\endgroup$
Commented
Jan 7, 2022 at 0:46