We propose a new method for recovering the 3D shape of a polyhedral object from its single 2D image using the shading information contained in the image and the prior information on the object. In a strict sense, we cannot recover the shape of a polyhedron from an incorrect line drawing, even if it is practically almost correct. In order to overcome this problem, we propose a flexible face positioning method that can permit inconsistencies in the recovered shape that arise from vertex-position errors contained in incorrect line drawings. Also, we propose to use prior information about the horizontality and verticality of special faces and the convex and concave properties of the edges in order to attain good solutions and present a method of formulating such prior information as physical constraints. The shape-from-shading method is formulated as a minimization problem of a nonlinear cost function with the nonlinear constraints and its solution is searched by a global optimization algorithm. In the experiments with a synthetic image and three kinds of real images, shapes that are similar to those of the actual objects were recovered in all cases. As a result, the proposed method has proven to be effective in the shape recovery of simple-shape polyhedral objects.