I'm currently creating a "neighbourhood graph" by doing roughly this:
for every voxel
look at every other unseen voxel
check if neighbours
which runs roughly in n squared (minus n). It is acceptable for a certain number of voxels, but obviously it takes much more time with bigger lists.
Another naive solution is simply to put everything into either a big 3d array, or in a hashmap, which would run in O(n) but at the expense of much more memory.
Is there a faster way? I can't seem to enter the right search terms in google...