@pimms.value<EOL><INDENT>def edge_data(faces):<DEDENT>
limit = np.max(faces) + <NUM_LIT:1><EOL>all_edges = np.hstack([[faces[<NUM_LIT:0>],faces[<NUM_LIT:1>]], [faces[<NUM_LIT:1>],faces[<NUM_LIT:2>]], [faces[<NUM_LIT:2>],faces[<NUM_LIT:0>]]])<EOL>(edge_list,cnt) = np.unique(np.sort(all_edges, axis=<NUM_LIT:0>), axis=<NUM_LIT:1>, return_counts=True)<EOL>rng = np.arange(edge_list.shape[<NUM_LIT:1>])<EOL>poss_edges = np.hstack([edge_list, np.flipud(edge_list)])<EOL>poss_idcs = np.concatenate([rng,rng])<EOL>idx = {k:ii for (k,ii) in zip(zip(poss_edges[<NUM_LIT:0>],poss_edges[<NUM_LIT:1>]), poss_idcs)}<EOL>rng = np.arange(faces.shape[<NUM_LIT:1>])<EOL>face_idcs = np.concatenate([rng,rng,rng])<EOL>esrt = np.sort(all_edges, axis=<NUM_LIT:0>)<EOL>edge2face = {k:ii for (k,ii) in zip(zip(*all_edges), face_idcs)}<EOL>for (e,er) in zip(zip(*edge_list), zip(*np.flipud(edge_list))):<EOL><INDENT>tup = tuple([eff for q in (e,er) for eff in [edge2face.get(q)] if eff is not None])<EOL>assert(len(tup) > <NUM_LIT:0>)<EOL>for eidx in (e,er): edge2face[eidx] = tup<EOL><DEDENT>edge_list.setflags(write=False)<EOL>return pyr.m(edges=edge_list,<EOL>edge_index=pyr.pmap(idx),<EOL>edge_face_index=pyr.pmap(edge2face))<EOL>
tess.edge_data is a mapping of data relevant to the edges of the given tesselation.