I have a 6D grid of approximation order 10. This means, it has a million points: (x, y, z, Vx, Vy, Vz) = (10, 10, 10, 10, 10, 10). Now, I want to find those points of this grid that lie within a given shape. In simple cases of 2D grid, this shape can be a circle/rectangle and more complex shapes like a bent ellipse. In higher dimensions, the shapes can be more complex and I'm trying to find a way to filter these points without checking each one of them.