for v in bm.verts:
for e in v.link_edges:
vv = e.other_vert(v)
print(v.co, vv.co)
import bmesh
ao = bpy.context.scene.objects.active
m = ao.data
bm = bmesh.new()
bm.from_mesh(m)
bm.verts.index_update()
vs = [-1]*2*len(bm.verts)
usedvs = [1]*len(bm.verts)
vs[0]=0
usedvs[0] = 0
p=0
def f(v):
global p
if p>0:
p+=1
elif p<0:
p-=1
i = 2
for e in v.link_edges:
i -= 1
vv = e.other_vert(v)
if p == 0:
print("init p")
if vs[1] == -1:
p = 1
else:
p = -1
if usedvs[vv.index] == 1:
usedvs[vv.index] = 0
vs[p] = vv.index
print(p)
f(vv)
if i == 1:
print("path ended")
print(vs)
p = 0
f(bm.verts[0])
for i in range(len(ws)):
if ws[-i] != -1:
continue
break
xs = []
for j in range(-i+1, -i+1+int((len(ws)/2))):
xs.append(ws[j])