code: def project_to_plane(points,
                       plane_normal=[0, 0, 1],
                       plane_origin=[0, 0, 0],
                       transform=None,
                       return_transform=False,
                       return_planar=True):
      
  
      if np.all(np.abs(plane_normal) < tol.zero):
          raise NameError('Normal must be nonzero!')
  
      if transform is None:
          transform = plane_transform(plane_origin, plane_normal)
  
      transformed = transformations.transform_points(points, transform)
      transformed = transformed[:, 0:(3 - int(return_planar))]
  
      if return_transform:
          polygon_to_3D = np.linalg.inv(transform)
          return transformed, polygon_to_3D
      return transformed
docs: Projects a set of (n,3) points onto a plane.
  
      Parameters
      ---------
      points:           (n,3) array of points
      plane_normal:     (3) normal vector of plane
      plane_origin:     (3) point on plane
      transform:        None or (4,4) matrix. If specified, normal/origin are ignored
      return_transform: bool, if true returns the (4,4) matrix used to project points
                        onto a plane
      return_planar:    bool, if True, returns (n,2) points. If False, returns
                        (n,3), where the Z column consists of zeros