The design of mechanical components is traditionally carried out under the assumption that components have perfect geometry. However, actual manufacturing processes produce components whose form and dimension deviate from the nominal design. Mechanical tolerances serve as a common ground between the need to produce reliable products which conform to the nominal design and the ability of manufacturing processes to produce parts in a cost-effective manner. Selection of geometric tolerances for an assembly or mechanism can be a complex problem, involving analysis of mating conditions between several components. This complexity forces designers to make simplifying assumptions, resulting in overly conservative tolerances and high manufacturing cost. The purpose of this research is to investigate a computer-aided approach to tolerance analysis for assemblies and mechanisms. A CAD system which can generate freeform surfaces is used to produce imperfect-form, variant models. A method is developed for simulating the mating of these imperfect-form components by formulating surface mating relationships as a nonlinear programming problem. Using this approach, tolerance analysis can be performed by generating a series of typical component variants, simulating the positioning of these imperfect-form components then measuring geometric attributes of the assembly or mechanism which correspond to functionality. This approach to tolerance analysis is demonstrated using the slider/guideway components of a slider-crank mechanism.