code: def face_ordering(mesh):
      
  
      # the length of each edge in faces
      norms = mesh.edges_unique_length[
          mesh.edges_unique_inverse].reshape((-1, 3))
  
      # the per- row index of the shortest edge
      small = norms.argmin(axis=1)
  
      # the ordered index for the medium and large edge norm
      # arranged to reference flattened norms for indexing
      MLidx = np.column_stack((small + 1, small + 2)) % 3
      MLidx += (np.arange(len(small)) * 3).reshape((-1, 1))
  
      # subtract the two largest edge lengths from each other
      diff = np.subtract(*norms.reshape(-1)[MLidx.T])
  
      # mark by sign but keep zero values zero
      order = np.zeros(len(norms), dtype=np.int64)
      order[diff < tol.merge] = -1
      order[diff > tol.merge] = 1
  
      return order
docs: Triangles with three different length sides are
      ordered in two ways:
      [small edge, medium edge, large edge] (SML)
      [small edge, large edge,  medium edge] (SLM)
  
      This function returns [-1, 0, 1], depending on whether
      the triangle is SML or SLM, and 0 if M == L.
  
      The reason this is useful as it as a rare property that is
      invariant to translation and rotation but changes when a
      mesh is reflected or inverted. It is NOT invariant to
      different tesselations of the same surface.
  
      Parameters
      -------------
      mesh : trimesh.Trimesh
        Source geometry to calculate ordering on
  
      Returns
      --------------
      order : (len(mesh.faces), ) int
        Is each face SML (-1), SLM (+1), or M==L (0)