In this paper, we describe a new method for simulating mechanical assembly between components that are composed of surfaces that do not have perfect geometric form. Mating between these imperfect form surfaces is formulated as a constrained optimization problem of the form “minimize the distance from perfect fit, subject to noninterference between components.” We explore the characteristics of this mating problem and investigate the applicability of several potential solution algorithms. The problem can be solved by converting the constrained optimization formulation into an unconstrained problem using a penalty-function approach. We describe the characteristics of this unconstrained formulation and test the use of two different solution methods: a randomized search technique and a gradient-based method. We test the algorithm by simulating mating between component models that exhibit form errors typically generated in end-milling processes.