I've got an N dimensional (regular) grid with data, which doesn't fill it's volume completely, but should be convex. So, for example, in 2D this is okay (1=exists, 0=missing):
0011111100 0111111110 1111111111 0011111100 0000011100
But this is not:
0011111100 0111101110 1111111111 0011111000 0000011100
I want to find the additional zeros in this second example (marked in bold). And I want to do this in more than 2 dimensions.
The only way I can think of now is to get all possible coordinates in N-1 dimensions and check in the Nth dimension, whether it's convex, which just means finding the first and last data points in that dimension and check, whether any point is missing in between. But I'd have to do that in every dimension and for every slice in that dimension.
There must be an easier solution, right?
You would need to figure out and understand the algorithms that help to get a "multidimensional convex hull" for a given multidimensional grid. This is bit complex and I can't explain a full blown solution in the post but can give the below pointers.
I doubt if an easier solution would exist for this as you are talking about multiple dimensions.