## 2 Materials and Methods
### A Method of Edge Line Restoration Based on Cutting Triangular Patches
#### 2.2.2 Construction of the Fitting Plane and Projection Plane  
In order to facilitate the cutting of triangular patches, the triangular patches must be projected onto a two-dimensional plane, but the method of vertical projection cannot be directly used for edge line cutting. We took into account that the local part of the edge line was composed of two intersecting planes, but since the two planes were not fixed, the projection plane was expected to be variable. Therefore, the method of constructing the projection surface in this paper was as follows. (1) We calculated the normal vector of each triangular surface. (2) We set the threshold and divided the normal vector into two categories. (3) We calculated the included angle of the normal vector and took the plane with the direction of the angle bisector as the normal vector as the projection plane.  
First, we calculated the normal vector of each triangular surface and observed that it could be roughly divided into two categories near the edge line. As shown in Figure 3, the yellow line was the feature line drawn interactively, and the local relevant triangles that were searched according to the intersection method described in Section 2.1 were white triangular nets, while the red line was the normal vector of each triangular surface.  
Figure 3: Local triangle vector graph.  
Figure 2: Schematic diagram of cylinder selection range.  
The normal vectors of local triangles were unitized and drawn in three-dimensional space, as shown in Figure 4. Their distribution forms showed two clustered distributions with a high density and several discrete distributions. According to our analysis, we considered that the two normal vectors with high density were the normal vectors of the two planes constituting the edge line, and the triangle corresponding to most of the discrete distribution vectors was the reason why the edge line features were not sufficiently prominent. Therefore, according to the characteristics of the vector distribution of the local triangular patches of the edge lines, they were divided into two categories using the European clustering method [33]. We calculated the average values of various types as the normal vector of the plane to be fitted, and then constructed two planes by manually drawing the midpoint of the feature line, as shown in Figure 5. The yellow and blue planes are fitting planes, which correspond to the fitting of normal vectors in the two red circles in Figure 4. The white plane is the fitting of the normal vector in the blue circle in Figure 4. Since the normal vector distribution is too discrete, we decided to discard it.  
Through the above two plane normal vectors, the direction of the angular bisector was taken as the normal vector of the projection plane, and the projection plane was tangential to the hand-drawn feature line. We projected local triangles and feature lines onto the projection plane. As shown in Figure 6, it can be seen that the triangles were distributed in a network, and there were no mutually superimposed triangles or discontinuous triangles. Therefore, the problem of triangle self-intersection caused by direct straightening was solved.  
Figure 4: Distribution of triangle normal vectors in three-dimensional space. Normal vectors in the red circles are the centralized distribution, and normal vectors in the blue circle are discrete distribution.  
Figure 5: Fitting plane rendering of normal vectors in two main directions after removing discrete normal vectors. The yellow and blue planes are fitting planes of the main normal vectors, the white plane is the fitting plane of the discrete normal vectors.