def drop_outside_points(df, segment):
    """
    Drop points where the grid node is outside the domain.

    Parameters
    ----------
    df : pandas DataFrame
        The dataframe of points
    segment : ndarray
        The interior-exterior segmentation of the domain
    """
    x_vals = df.index.get_level_values('x').to_numpy()
    y_vals = df.index.get_level_values('y').to_numpy()
    z_vals = df.index.get_level_values('z').to_numpy()

    ext_int = segment[x_vals, y_vals, z_vals] == 1
    return df[ext_int]