docs: def pathpatch_2d_to_3d(pathpatch, z = 0, normal = 'z'):
      """
      Transforms a 2D Patch to a 3D patch using the given normal vector.
  
      The patch is projected into they XY plane, rotated about the origin
      and finally translated by z.
      """
      if type(normal) is str: #Translate strings to normal vectors
          index = "xyz".index(normal)
          normal = np.roll((1.0,0,0), index)
  
      normal /= np.linalg.norm(normal) #Make sure the vector is normalised
  
      path = pathpatch.get_path() #Get the path and the associated transform
      trans = pathpatch.get_patch_transform()
  
      path = trans.transform_path(path) #Apply the transform
  
      pathpatch.__class__ = art3d.PathPatch3D #Change the class
      pathpatch._code3d = path.codes #Copy the codes
      pathpatch._facecolor3d = pathpatch.get_facecolor #Get the face color
  
      verts = path.vertices #Get the vertices in 2D
  
      d = np.cross(normal, (0, 0, 1)) #Obtain the rotation vector
      M = rotation_matrix(d) #Get the rotation matrix
  
      pathpatch._segment3d = \
          np.array([np.dot(M, (x, y, 0)) + (0, 0, z) for x, y in verts])
      return pathpatch