Is there a way to get the normalID of terrain voxels?

Im currently working on a terrain thinner plugin which thins out the terrain to a maximum distance because the terrain on a huge map i work on is 100mb in storage which is just too much, but in order to thin out the terrain correctly, i need to figure out what the normalID is of each terrain voxel so i can thin it out accordingly.

How do i figure out what the normalID is of a single voxel without raycasting?
image