**5. Conclusions**

This paper is based on the three-dimensional laser scanning technology to obtain the point cloud data of the initial support surface of the railway tunnel, and expounds the use of the tunnel point cloud data, through the B-spline interpolation method and the S-G smoothing method based on the curvature limitation, to obtain the flatness calculation reference plane. The normal vector distance formed by the intersection of the normal line drawn from the original point cloud and the flatness calculation datum plane is proposed, and the normal vector distance is used as the basis for flatness calculation, and two concepts based on the detection of the surface flatness of the initial support of the tunnel are introduced: the whole Flatness and local flatness. Through the analysis of the flatness distribution map and the flatness calculation results, the feasibility of the application of the three-dimensional laser scanning technology in the surface flatness detection of the initial support of the tunnel engineering is verified and discussed. The main conclusions are as follows:

(1) Compared with the traditional total station method and the two-meter ruler method in the traditional flatness detection, the efficiency is low, the accuracy is not high, and the operation is inconvenient. The use of three-dimensional laser scanning technology to detect the surface flatness of the initial support of the tunnel can quickly and accurately obtain the tunnel. A large amount of point cloud data on the surface of the initial support is easy to operate, without touching the surface of the initial support of the tunnel to be tested, and the accuracy of the instrument is high enough to make up for the problem of acquisition accuracy.

(2) Common surface fitting methods include meshing method, Poisson surface reconstruction method, Lagrangian interpolation method, and cubic B-spline interpolation method. To obtain the most suitable surface fitting method for this experiment, the experiment compares and analyzes the surface fitting degree and fitting accuracy of the four surface fitting methods. According to the comparative analysis, compared with the other three surface fitting methods, the tunnel surface constructed by the cubic B-spline interpolation method is continuous and complete, with higher smoothness, no local mutations, etc., and the details of the local area are rich and relatively The tunnel surface is restored well. At the same time, by calculating the statistical root mean square error of the four fitting methods, the fitting error of the surface area other than the original point can be obtained. The calculation result can be obtained by using the Poisson reconstruction method and the cubic B-spline interpolation method. The point cloud fitting error can be kept within a small range, and the fitting accuracy is high. Comprehensive comparative analysis shows that cubic B-spline interpolation is the most suitable fitting method for this study.

(3) After comparative analysis, a suitable surface fitting method for this experiment, namely cubic B-spline interpolation, has been obtained. On this basis, this research puts forward the method of two-way slice complementarity in the B-spline interpolation method to fit the overall surface of the tunnel and the method of SG filter smoothing based on curvature, which effectively eliminates the one-way slice to fit the whole tunnel. The jagged layering effect of the curved surface optimizes the fitting process of the tunnel curved surface. The optimized fitting surface is continuous and complete, with high smoothness, rich and complete local details, which is consistent with the actual engineering situation, and better restores the tunnel surface. At the same time, it can also meet the requirements of the flatness calculation of the initial support of the tunnel. It can be used as a reference plane for flatness calculation.

(4) The intersection of the normal line drawn from the original point cloud and the flatness calculation datum forms the normal vector distance. Based on this, this research proposes two flatness calculation methods and draws the flatness distribution map. The calculation of overall flatness can determine the overall flatness of the initial support surface of the tunnel, and the calculation of local flatness can determine the specific location of the uneven area. Combined with the flatness distribution map, the flatness detection can be more accurate and intuitive, which can be used for tunnel engineering. The construction provides technical support and theoretical guidance.

(5) In the flatness calculation method, this research proposes a local flatness calculation method. The step distance *X* set by the program is the main factor affecting the local flatness. In the flatness detection of the actual tunnel engineering, it is necessary to set an appropriate stepping distance *X* according to actual engineering conditions. To explore and analyze the influence of step distance *X* on local flatness, this study set up experimental groups with different step distance *X* to conduct analysis. The results show that the local flatness will increase as the step distance *X* increases. Finally, Infinite approaches the upper limit, which is roughly stable at around 20 mm, which is roughly the same as the overall flatness calculation result. According to the analysis of the flatness distribution map obtained by the two flatness calculation methods, the flatness of the initial tunnel support surface is basically consistent, which proves that the tunnel flatness detection method proposed in this study is feasible.

(6) Through the comparative analysis with the traditional flatness detection method, the true error of 3DLS meets the specification requirements within a certain measurement range, and both are less than the 25 mm required by the specification. This shows the accuracy of the point cloud data collected by 3DLS. At the same time, the initial fitting surface fitting of the tunnel project obtained by 3DLS technology has a higher degree of optimization and is closer to the actual engineering situation. The flatness calculation method is simpler and more effective, and the flatness analysis based on the flatness distribution map is more Precise and intuitive. The method of detecting the flatness of the initial support surface of the tunnel based on the three-dimensional laser scanning technology is feasible.

In summary, compared with traditional detection methods, 3DLS are faster and more accurate, with high acquisition accuracy, wide range, and simple operation in the detection of the flatness of the initial support surface of the tunnel. The surface fitting effect is best after cubic B-spline interpolation and SG filter smoothing based on curvature limitation. In this study, the normal vector distance is formed by the intersection of the normal line drawn from the original point cloud and the flatness calculation datum surface, and based on this, the concepts of overall flatness and local flatness are proposed, and corresponding flatness distribution maps are drawn respectively. The size of the local flatness will increase as the step distance *X* becomes larger, and finally, approach the calculation result of the overall flatness infinitely. Comparing the measurement accuracy of 3DLS and the traditional detection instrument, and comparing the flatness distribution map and the calculation results, it can be preliminarily concluded that the tunnel flatness detection method proposed in this study is feasible.
