Globally optimal segmentation of interacting surfaces with geometric constraints