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:

enter image description here

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:

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)

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:
    prev, vert = vert, next

Browse other questions tagged or ask your own question.