We address the problem of designing the shape of solid objects to satisfy a given set of functional specifications. In particular, we show how to design elementary components of mechanical devices (kinematic pairs) from a description of their desired behavior and a set of constraints. This is done using a backtracking algorithm that modifies (or creates) object shapes by adding and deleting line and arc segments to the objects' contours. These modifications are guided by the configuration space description of the desired behavior. The algorithm is extended to handle both qualitative and causal descriptions of desired behaviors. This work is based on the theory of shape and kinematics developed in [Joskowicz, 1988].