A surface reconstruction method for material shape analysis is presented. The three-dimensional shape reconstruction system detects object surface based on optical principle. A series of gratings are projected to the object, and the projected gratings are deformed by the object surface. From images of the deformed gratings, three-dimensional profile of the material surface can be obtained. The basic aspects of the method are discussed, including the vision geometry, the light projection and code principle. The proposed method can deal with objects with various discontinuities on the material surface, thus increasing the flexibility and robustness of shape reconstruction process. The experimental results show the efficiency of the method, the material surface can be reconstructed with high precision in various applications.