Size of link_loops of a mesh circle is zero?

I have a mesh circle with 32 vertices and I am trying to get the edge loop of the circle (which is actually all vertices in sequence) with following code:

import bmesh
bm = bmesh.new()
bm.from_mesh(bpy.context.object.data)

bm.verts.ensure_lookup_table()
print(len(v_loops))

bm.edges.ensure_lookup_table()
print(len(e_loops))


However, at both places I get zero length of the edge loops. Am I doing anything wrong?

• I think link_loops function checks which face loops use the vertex/edge. From documentation . For vertex: Loops that use this vertex (read-only). and for edge: Loops connected to this edge, (read-only). If you fill in a face with F then you get a value of 1. So it confirms my theory :) Aug 26 at 10:47
• @HarryMcKenzie Yes, that's right :) So how to get the edge loops connected to selected vert or edge of a non-manifold mesh. I checked the relevant threads on stackexchange and they seem to be talking about manifold meshes only. Aug 27 at 11:38

This will take an input list of edges of any length, take the first element of the list as the starting edge and "walk" around the edge loop of a non-manifold loop until it finds the first edge it started with and return a list of edges of the loop. The key is the 3s.

3 is the number of edges each vert is connected to. If it was 4 then it would be looking for manifold edges.

def get_loop(edges):

edge_loop = []
edge = edges[0] # edge at the start of the edge loop

# get BMLoop that points to the right direction
break

first_edge = edge
edge_loop.append(first_edge)
next_edge = 0

# stop when reach the end of the edge loop
while len(loop.vert.link_edges) == 3 and next_edge != first_edge:

# jump between BMLoops to the next BMLoop we need