Why not just make the plane smaller for more voxelized meshes? It saves memory, and makes all these calculations much simpler (just pcXEnd * pcWidth + pcYEnd).