Although parallel-jaw grippers play a vital role in automated manufacturing, gripper surfaces are still designed by trial-and-error. This paper presents an algorithmic approach to designing gripper jaws that mechanically align parts in the vertical (gravitational) plane. We consider optimal edge contacts, based on modular trapezoidal segments that maximize contact between the gripper and the part at its desired final orientation. Given the n-sided 2D projection of an extruded convex polygonal part, mechanical properties such as friction and center of mass, and initial and desired final orientations, we present an O(n3 log n) numerical algorithm to design optimal gripper jaws. We also present an O(n log n) algorithm to compute tolerance classes for these jaws, and report on an online implemented version of the algorithm and physical experiments with the jaws it designed. This paper extends earlier results that generated optimal point contacts [M. T. Zhang and K. Goldberg, “Gripper point contacts for part alignment,” IEEE Trans. Robot. Autom.18(6), 902–910 (2002)].