This paper presents a new pattern design for encoding structured light for scanning 3D surface and the decoding process. The basic unit of the pattern is a code-block that contains one central label and eight square-shaped primitives that provide two functions: code-block indexing and point-positions for triangulating. The square-shaped primitive has one notch in a different position to represent 8 digit numbers, which are easily to convert label to number for indexing codeblock. One primitive also contributes five point-positions, centroid and four extreme, for triangulating and estimating 3D information. The design of code-block has eight 8-bit numbers allowing a higher error-tolerant and providing better resolution in 3D reconstruction. Experiment shows that the proposed pattern is suitable for indoor mapping and large scene scanning.