Shape Measurement with Grating Projection Using Whole-Space Tabulation Method