The problem of designing a mechanism that comes closest to reaching a desired set of goal positions is examined in this paper. The approach is first applied to spherical four-bar mechanism design synthesis on SO(3), and then extended to general spatial problems on SE(3). For each class of problems, we define a distance metric which is used in a numerical optimization algorithm to determine the optimum design. An important feature of our approach is that analytic gradients of the distance metric are determined in a straightforward manner which can be easily programmed. Once these gradients are known, general purpose optimization packages can efficiently compute locally optimal solutions with excellent convergence properties.