Molecular Hydrogen in Diffuse Interstellar Clouds of Arbitrary Three-dimensional Geometry