def mesh_dist(tris, vert):
 edges = mesh_edges(tris).tocoo()
 dist = np.sqrt(np.sum(((vert[edges.row, :] - vert[edges.col, :]) ** 2), axis=1))
 dist_matrix = csr_matrix((dist, (edges.row, edges.col)), shape=edges.shape)
 return dist_matrix

def mesh_dist ( tris , vert ) : edges = mesh_edges ( tris ) . tocoo ( ) dist = np . sqrt ( np . sum ( ( ( vert [ edges . row , : ] - vert [ edges . col , : ] ) ** 2 ) , axis = 1 ) ) dist_matrix = csr_matrix ( ( dist , ( edges . row , edges . col ) ) , shape = edges . shape ) return dist_matrix
compute adjacency matrix weighted by distances .