A novel method of designing hub and shroud contours is presented. The method, based on the medial axis transform theory in differential geometry, gives a uniform description of hub and shroud contours and the formula of cross section area. Through solving the formula of cross section area with an additional constraint, the hub and shroud contours can be determined numerically. The constraint is exposed through a curvature equation, which allows the medial axis or hub (shroud) contour to be a certain form. Using this method, various optimization criteria relating to the cross section area can be conveniently introduced into the design.