def total_length_selected(ed='empty', coords='empty', ob='empty'):
'''Returns the total length of all edge segments'''
if ob == 'empty':
ob = bpy.context.object
if coords == 'empty':
coords = get_coords(ob)
if ed == 'empty':
ed = get_edge_idx(ob)
edc = coords[ed]
e1 = edc[:, 0]
e2 = edc[:, 1]
ee1 = e1 - e2
sel = get_selected_edges(ob)
ee = ee1[sel]
leng = np.einsum('ij,ij->i', ee, ee)
return np.sum(np.sqrt(leng))
评论列表
文章目录