This document discusses a method for simulating interactions between objects in mechanisms using small-scale interference detection. It represents the contour shapes of objects using molecular models, where molecules prevent overlap between driver and driven objects. It can analyze and synthesize planar kinematic pairs. Examples show it can simulate gears, cams, ratchets, and generateva mechanisms. The method is generalized and automatically optimizes shapes based on functionality plots and molecular time plots. Local shape changes are shown to affect the simulation results.