Use heights when computing occlusion point.

Also tests and minor algorithm improvements.