Fits a plane to a set of points

    Parameters
    ----------
    points : np.ndarray
        Size n by 3 array of points to fit a plane through

    return_meta : bool
        If true, also returns the center and normal used to generate the plane

def fit_plane_to_points(points, return_meta=False):
    """
    Fits a plane to a set of points

    Parameters
    ----------
    points : np.ndarray
        Size n by 3 array of points to fit a plane through

    return_meta : bool
        If true, also returns the center and normal used to generate the plane
    """
    data = np.array(points)
    center = data.mean(axis=0)
    result = np.linalg.svd(data - center)
    normal = np.cross(result[2][0], result[2][1])
    plane = vtki.Plane(center=center, direction=normal)
    if return_meta:
        return plane, center, normal
    return plane