3D overlap algorithm