code: def fitPlane(points, c="g", bc="darkgreen"):
      
      data = np.array(points)
      datamean = data.mean(axis=0)
      res = np.linalg.svd(data - datamean)
      dd, vv = res[1], res[2]
      xyz_min = points.min(axis=0)
      xyz_max = points.max(axis=0)
      s = np.linalg.norm(xyz_max - xyz_min)
      n = np.cross(vv[0], vv[1])
      pla = vs.Plane(datamean, n, s, s, c, bc)
      pla.info["normal"] = n
      pla.info["center"] = datamean
      pla.info["variance"] = dd[2]
      return pla
docs: Fits a plane to a set of points.
  
      Extra info is stored in ``actor.info['normal']``, ``actor.info['center']``, ``actor.info['variance']``.
  
      .. hint:: Example: |fitplanes.py|_