Optimal Design of Planar Mechanisms