code: def faces_to_edges(faces, return_index=False):
      
      faces = np.asanyarray(faces)
  
      # each face has three edges
      edges = faces[:, [0, 1, 1, 2, 2, 0]].reshape((-1, 2))
  
      if return_index:
          # edges are in order of faces due to reshape
          face_index = np.tile(np.arange(len(faces)),
                               (3, 1)).T.reshape(-1)
          return edges, face_index
      return edges
docs: Given a list of faces (n,3), return a list of edges (n*3,2)
  
      Parameters
      -----------
      faces : (n, 3) int
        Vertex indices representing faces
  
      Returns
      -----------
      edges : (n*3, 2) int
        Vertex indices representing edges