I have a Python script in which I get the BMesh from an existing mesh. Then I want to get the outer edges of the mesh, not the inner edges, mesh could for instance look like this:
I want to get the edges as a sequence that are not in the inside.
Thx for your help.
Edit: Can get the outer edges now like that:
bm = bmesh.from_edit_mesh(obj.data)
outer_edges = [edge for edge in bm.edges if edge.is_boundary]
for edge in outer_edges:
vertices.append(edge.verts[0])
The only problem I have now is that I want to order them clockwise, any idea for this?
Edit 06.11.2020: Ok ended up with this one here:
bm = bmesh.from_edit_mesh(obj.data)
bm.verts.ensure_lookup_table()
vert = bm.verts[0]
prev = None
for i in range(len(bm.verts)):
next = None
for v in [e.other_vert(vert) for e in vert.link_edges if e.is_boundary]:
if (v != prev):
next = v
vertices.append(obj.matrix_world @ vert.co)
if next == None:
break
prev, vert = vert, next
edge.other_vert(v).linik_edges
until back to start. Sure have answered this before too. (posted other link as it walks corner to corner) $\endgroup$ – batFINGER Nov 3 '20 at 8:38