*4.2. Analysis of Local Flatness*

The analysis of local flatness first draws a flatness distribution map through the normal vector distance, and each point in the figure obtains the gradient of each point according to the gradient formula. In the gradient direction, the flatness changes the fastest. The local flatness is calculated in the gradient direction, and the local flatness is calculated and analyzed by determining the value of the horizontal distance *X* in the gradient direction. After the value of the horizontal distance *X* is determined, the height difference h between the starting point and the endpoint can be obtained, and *X* and h can be substituted into the local flatness calculation formula to obtain the final local flatness.

In this experiment, to analyze the influence of the value of the horizontal distance x on the local flatness results of the initial support surface of the tunnel, four-parameter values of *X* = 5 mm, *X* = 10 mm, *X* = 20 mm, and *X* = 50 mm were taken to determine the local flatness. The calculation and analysis of flatness are shown in Figure 16. In the figure, the *X*-axis is along the central axis of the tunnel, and the *Y*-axis is the direction of the cross-section of the tunnel.

**Figure 16.** Overall smoothness distribution of tunnel primary branch surface.

Through the calculation of the local flatness of the initial support surface of the tunnel, when *X* = 5 mm, the maximum local flatness is 2.5 mm and the minimum is −2.5 mm; when *X* = 10 mm, the maximum local flatness is 4.9 mm and the minimum When *X* = 20 mm, the maximum local flatness is 9.3 mm and the minimum is −9.3 mm; when *X* = 50 mm, the local flatness maximum is 18.6 mm and the minimum is −17.3 mm.

The traditional flatness detection of the initial support of the tunnel is to detect the flatness of the initial support of the tunnel by a combination of a two-meter ruler and a wedge feeler. During the inspection, place the two-meter ruler horizontally on the tunnel surface along the direction of the central axis of the tunnel. The ruler is close to the tunnel surface and finds the largest gap. Place the wedge-shaped feeler gauge here. The reading is the ruler datum plane and the initial support of the tunnel. The maximum gap distance of the protective surface is the flatness of the initial support surface of the tunnel [34]. According to the "GB-T 50299-2018 Construction Quality Acceptance Standard for Underground Railway Engineering", the allowable deviation of the flatness of the shotcrete should be 30 mm, and the local flatness of the initial support surface of the tunnel for the four sets of data meets the requirements of the specification.

When the value of *X* gradually increases, the local flatness value of the initial support surface of the tunnel also gradually increases. At the same time, when the value of X gradually increases, the local flatness value also tends to stabilize. To further determine when the local flatness tends to be stable, this paper adds five sets of variable test data *X* = 60~100 mm, as shown in Figure 17. In the figure, the *X*-axis is along the central axis of the tunnel, and the *Y*-axis is the direction of the cross-section of the tunnel.

**Figure 17.** Distribution diagram of local flatness of the variable set.

It can be seen from the two sets of test data that the horizontal distance *X* has a greater impact on the calculation of local flatness. The results of overall flatness and local flatness are summarized, as shown in Table 4 below.


**Table 4.** Summarization of flatness calculation results.

The following conclusions can be drawn from the analysis of the above table and the flatness distribution graph: (1) The calculation of local flatness depends on the program setting parameter step distance *X*. Choosing a suitable step distance parameter is very important for local flatness detection. When the value of *X* becomes larger and larger, the value of local flatness becomes larger and larger, and its value will approach the upper limit, which is similar to the calculation result of overall flatness. The approximate interval of the advance distance *X* is between 70 mm~90 mm, and it can be preliminarily judged that the Dangmai advance distance parameter setting between 70 mm~90 mm is suitable for local flatness detection. (2) By comparing and analyzing the flatness of the local flatness distribution map and the overall flatness distribution map, the flatness distributions of the two are basically the same. It can be explained that the detection methods of the overall flatness and the local flatness affect the flatness of the initial support of the tunnel. The representations are the same and the two have commonality. At the same time, the surface flatness of the initial support of the tunnel in this area meets the specification requirements. The local flatness calculation formula based on three-dimensional laser scanning proposed in this experiment is feasible.
