# BMesh get edge loop

I'm trying to get edge loop, starting from one edge and continuing as far as the loop goes.

This atrocity (below) doesn't work, because vertex index order is disrupted. So I have no apparent way of telling which edge of link_edges is continuing the loop.

v = bm.verts[0] # vertex at the start of edge loop
ov = edge.other_vert(v)

while len(le) == 4:

ov = e.other_vert(ov)



The solution is to use BMLoop, as it's the only element that has constant direction and doesn't depend on the order of other elements.

This example code works only with manifold geometry where all face normals facing one direction. For more information and examples look in the comments.

e = bm.edges[0] # edge at the start of the edge loop

# get BMLoop that points to the right direction