A method for fast reconstruction of closed section workpiece surface using point clouds

Parameterized reconstruction of workpiece surfaces is a critical step for advanced manufacturing applications, such as the solving of machining parameters, and the expression of workpiece in situ measurement. Generally, the point clouds model is easy to obtain and can be seen as the source model of the workpiece, and the B-spline surface is always taken as the ideal target parameterized model. Existing research focuses on reconstructing the single-valued surface, which can be projected onto a spatial plane without overlapping. However, the dual-valued surface, which overlaps at least twice, is also commonly encountered in industry, and has few investigations. Therefore, this paper proposes a fast reconstruction method based on reasonable segmentation and parameter domain mapping. In this approach, first, the dual-valued point clouds model is segmented into multiple single-valued point clouds models according to the sought edges in the optimal attitude. Then, the grid point coordinates of the single-valued point clouds model are calculated using the parametric-domain moving least squares method. Finally, the B-spline surface is generated by interpolating these grid points. The proposed algorithm is applied to single-bending closed-section workpieces such as the turbine blade to illustrate the effectiveness of this method. The contrast results with existing method demonstrate that the proposed approach can reconstruct the workpiece with multi-valued surfaces more quickly and more accurately, which is significant in advanced manufacturing.


Introduction
Computer numerical control (CNC) machining has been commonly used in the aerospace, automobile, and die/mold industries. 1 Since CNC machining procedures, cutting parameters, and machining toolpath are calculated according to the workpiece model, the acquisition and construction of the model are critical. 2,3The workpiece model has wide expressions such as point cloud, triangular mesh, and B-Spline surface.Among these, the B-Spline surface model is preferable for CNC machining because of its advantages such as high precision, convenient acquisition of surface information, and convenient computer operation.In addition, with the development of instruments, the point cloud model is becoming more widely used because of its advantages such as wide source, common format, and easy exchange. 4Therefore, the reconstruction of the B-Spline surface from the point cloud is significant for advanced manufacturing applications.
The published literature contains a vast number of papers on the reconstruction of the point cloud model.However, studies have different purposes and target models in different fields.In the computer field, the point cloud is mostly used for deep learning to identify features and reconstruct maps. 5,6In the reverse engineering field, it is commonly used to reconstruct the triangular mesh model. 7,8In the CNC machining field, a method of B-Spline surfaces reconstruction was proposed, but it has the application limitation of singlevalue surfaces. 2Furthermore, this method is highly correlated to Computational Geometry, and they are both based on a cross-section slicing fitting strategy (CSF). 9- 12This strategy is robust and universal, and the approximate B-Spline model under error control is adopted as the target model.Nevertheless, for the deterministic point cloud (error free) of regular shapes such as dualvalue single-bend closed-section workpieces, this strategy is inefficient and unprofessional.The dual-value single-bend closed-section workpiece is a workpiece whose surface is a dual-value surface.When a dualvalue surface is projected onto a spatial plane, at least two overlaps of surface projections occur in some regions of the projection plane.Besides, machining accuracy is affected by fitting accuracy in addition to the accuracy of the point cloud model.
Free-form surface (sculpture surface) expressed by B-Spline is widely used in the design and manufacture of aviation, aerospace, and marine equipment.As a typical type among these, the dual-value single-bend closedsection workpiece also has extensive applications such as turbine blades and propellers.4][15] However, these methods have defects of inefficiency and inaccuracy because above workpieces' characteristics of dual value, single bend, and high precision machining.
In recent years, to avoid complex surface reconstruction in digital manufacturing, the black-box models of surface reconstruction based on the neural network have been proposed, such as Duan et al. 16 proposed an RBF neural network mapping technology to pre-fit noise point clouds and Wang et al. 17 improved the performance of fitting disordered point clouds by neural networks.These methods avoided complex algorithms and achieved fast reconstruction but introduces uncertainty and significant pre-training costs.Furthermore, the methods of directly generating machining toolpath without surface reconstruction are proposed, such as Shen et al. 18 constructed workpiece mesh models based on the point cloud and generated toolpaths based on these mesh models and Wang et al. 19 proposed a direct planning method of robot toolpaths based on the fieldmeasured point clouds.These methods are dependent on the local accuracy of meshes and point clouds, which sacrifices the smoothness of the stitching and the overall coordination.To sum up, the general reconstruction algorithms cannot achieve excellent performance on specific workpieces, and no surface reconstruction will introduce greater costs.Therefore, it is necessary to study a fast and special reconstruction method for the workpiece with specific characteristics.
For the workpiece with specific characteristic, it is necessary to adopt a prior fitting model 20 or a specific reconstruction algorithm 21 to improve the accuracy and rapidity of reconstruction.Based on the above characteristics, this paper proposes a fast reconstruction method based on reasonable segmentation and parameter domain mapping, for multi-valued surfaces.In this approach, first, the transformation between the initial attitude and optimal processing attitude of workpieces is established.Then, the dual-value point cloud model is split into two single-value point clouds using an edge segmentation method.Next, the grid point coordinates of the single-valued point clouds model are calculated using the parametric-domain moving least squares method.Finally, the B-Spline surface model of the workpiece is obtained by interpolating these accurate grid points.
To sum up, the goal of the approach proposed in this paper is to quickly and accurately reconstruct the B-Spline surface model of the dual-value single-bend closed section workpiece from the point cloud model.Through reconstructing a typical turbine blade, the effectiveness of the proposed method is illustrated, and compared with the existing cross-section slicing fitting method (CSF), this method is fast and accurate due to the professionalism of this type of workpiece.
The following of this paper is organized as follows: Section ''Partition of the point cloud model'' introduces the edge partition under the optimal attitude, which split a dual-value point cloud into two single-value point clouds.Section ''B-spline surface fitting'' describes the details of grid construction and surface interpolating based on the dual-domain mapping.Subsequently, Section ''Illustration tests'' verify the effectiveness and superiority of the proposed method thorough two reconstruction experiments.In the final Section ''Conclusions,'' the full text is summarized, and the future work is anticipated.

Partition of the point cloud model
The point cloud model of the workpiece has a wide range of sources, and because of this, its initial posture is random.To split the dual-value point cloud by its edges, an optimal attitude is necessary for the recognition and clustering of edge points.Thereby, the edges can be fitted, and the middle surface can be constructed to split dual-value point clouds into two single-value point clouds.In this section, as shown in Figure 1, the transformation between initial posture and optimal posture is first established.Then the edge points are recognized, and the edges are fitted.Finally, the middle surface is constructed and optimized continuously, and the point cloud is split.

Optimal attitude transformation
To obtain the optimal attitude of the input point cloud, a least-square method is used to find the optimal plane, and a dichotomy is adapted to find the optimal rotation angle.The plane transformation and the rotation transformation together form the transformation relationship between the original attitude and the optimal attitude.The details of the transformations are shown in Figure 2.
In the plane transformation, the plane z = c 1 x + c 2 y is utilized as the mathematical model which can be solved by the normal equation x y Thus, the plane transformation is expressed by equation (1).
In the above equations, c 1 and c 2 are undetermined coefficients, X P , Y P , and Z P are axes of the plane coordinate system, and Unit() is the unitized function of the column direction.
In the rotation transformation, the rotation axis is Z P and the rotation angle u is determined using dichotomy by minimizing circumscribed rectangle S = (y OA, max À y OA, min )(x OA, max À x OA, min ).Thus, the rotation transformation is expressed by equation (2).
where, x max , x OA, min , y OA, max , and y OA, min are the limit position of the coordinates of the point cloud, and u is limited to a range of 0°-90°.Finally, the transformation from the original attitude to the optimal attitude is expressed in equation (3).
Thus, the axes X O , Y O , and Z O of the optimal coordinate system is derived by Without special explanation, the points mentioned later in this paper are all on the optimal attitude.

Recognition and clustering of edge points
In the optimal attitude, initial edge points are recognized according to a normal tolerance judgment.To determine the edges, the initial edge points are refined and clustered in turn.The procedure is shown in Figure 3.At first the estimated normal vector and surface curvature at each point is calculated using principal component analysis (PCA).Then the minimum curvature is selected to calculate the normal tolerance, by which the initial edge points are determined.Finally, two edges can be clustered based on refining these points.
The normal tolerance is the maximum difference between the estimated and actual normal vector of the point cloud, and as shown in Figure 4(a), it can be calculated by e = Kd according to the first order estimated, where K is the Gauss curvature and d is the discrete length of the point cloud.Then, the initial edge points are identified according to whether the angle between its normal vector and the X O Y O plane is within the normal tolerance, that is, 0 0 1 ½ Án p ł sin e.Additionally, and estimated normal vector and the Gauss curvature can be calculated by equations ( 6) and (8), respectively.This calculation is based on principal component analysis method. 22 where m is the number of points about the target point, p is the central point, and P is a decentralized matrix.
where H is the covariance matrix and U S 2 U T is its singular value decomposition.
where, H 1 ð Þ is the first column of H.
where, diag() is a function used to get the eigenvalue of the given matrix, and l 1 , l 2 , l 3 are corresponding eigenvalues.
To refine the initial edge points, the points which have the minimum angle with the X P Y P plane are selected.Then, as shown in Figure 4(b), a typical Kmeans algorithm 23 is utilized to cluster the edge points and the number of categories k is 2. Thus, two edge point sets E 1 and E 2 are obtained.

Fitting of edge curve
Since the existence of edge point errors, which are caused by non-coincidence with the X O Y O plane, it is necessary to fit E 1 and E 2 .As a universal and robust approach, B-spline fitting is adopted, and as its basics, a bidirectional angular scanning algorithm is used to sort the edge points.Therefore, as shown in Figure 5, the whole edge curve fitting algorithm has three steps.

The geometric center
p E of the edge points is calculated, and the angles between the lines from p E to the edge points and X O are evaluated by equation (9).
2. The edge points with the maximum limiting angle in E 1 and minimum limiting angle in E 2 are selected as the endpoints of the edge curve.
Then, the rest points in E 1 and E 2 are sorted along the direction of angle decrease and increase, respectively.3. Based on the sorted edge points, two edge curves C E1 and C E2 is fitted by three-order B-spline curve.

Construction of the partition surface
To obtain the partition surface, a construction algorithm of a straight grain surface is adapted to generate the initial partition surface, and the ideal partition surface is obtained by bending this surface using the pseudo-gradient method.The processes are shown in Figure 5.
For edge curves C E1 and C E2 , the constructing straight grain surface is expressed as equation (10), which is the standard expression of B-spline.
where, N j, 1 v ð Þ is the first order B-spline basis function, and corresponding node vector in the v direction is V = f0, 0, 1, 1g.
To bend this initial surface, the intermediate point set IP is sampled by equation ( 11) and inserted as new control points.Thus, the partition surface is expressed as equation (12).
where p + 1 is the number of sampling points which is equal to the number of control points of C E1 and C E2 .
where, the node vector in the v direction is V = f0, 0, 0:25, 0:75, 1, 1g, the node vector in the u direction is the same as the node vector of C E1 and C E2 , and IP(i) represent the i À element in the set.
To split the point cloud, a pseudo-gradient method is used to modify the intermediate point in IP.The modification rule is whether there are points of point   Splitting of the point cloud.Through the above processes, the partition surface is obtained.Therefore, as shown in Figure 6, the dual-value point cloud can be divided into two single-value point clouds by determining whether the point is above or below the surface.

B-spline surface fitting
After splitting the dual-value point cloud, two singlevalue point cloud is obtained, and either of them can be reconstructed using a B-spline fitting method.But to ensure the accuracy and efficiency of the reconstruction, a dual-domain mapping interpolating method based on moving least square regularizing.In detail, as shown in Figure 7, the mapping relation between the projection domain and the parameter domain is first established.Then, the grid points are calculated using a moving least square method (MLS) with a cubic basis support field.Finally, the B-spline surface is obtained by interpreting these grid points.

Establishment of the dual-domain mapping relation
Because two single-value point clouds and the partition surface are bijective along the Z O direction, the parameter coordinates of the point cloud can be calculated according to the parameter coordinates of the corresponding point on the partition surface.On the optimal attitude, the point on the partition surface corresponds to the point in the point cloud and is calculated according to their X O Y O coordinates.Due to the parametric expression of the surface, it is an iterative solving problem which is expressed as equation (13), and this problem can be solved using the Newton iteration method.
where, S u, v ð Þ is the parametric equation of the partition surface, p is the point in the point cloud, and the independent variable is u and v. Through rooting this equation, the parameter coordinates correspond to the point in the point cloud are calculated, and hybrid coordinates are formed according to these parameter coordinates and the Z O coordinate of the point in the point cloud.The format of hybrid coordinates is formed as (u, v, z), and the mapping relation from the hybrid coordinates to the space coordinates is expressed as equation (14).

Calculation of grid points
Based on the hybrid coordinates of the point cloud, the moving least square method 24 with a cubic basis support field is used to calculate the grid points.In detail, the parameter coordinates of the grid points are first generated by equation (15).Then, the Z O coordinates are calculated using the MLS method which is expressed as equation ( 22), and the support field is evaluated by equation (23).Finally, the space coordinates of the grid points are mapped from their hybrid coordinates by equation (14).
where m u is the number of the grid points along the u direction, and m v is the number of the grid points along the v direction.
where, P u, v ð Þ is cubic basis function, a is the base coefficient of the least square method, A is the extended coordinate matrix composed of the parameter coordinates of the point cloud, and m is the number of points in the point cloud.
where W node is the weight matrix for each grid point, v i is the weight of the point in the point cloud for a given grid point, s i is the relative distance between this point and grid point, and r is the radius of the support field.
where, Z is the column vector composed of the Z O coordinates of the point cloud, and a node is different for each grid point.

Bicubic B-spline surface interpolating
Based on the grid points, the B-spline surface can be readily interpolated by solving equation ( 24). 25 where, Q k, l , k = 1, Á Á Á , m u , l = 1, Á Á Á , m v represents the grid point, and P i, j is the control point to be solved.The parameter coordinates u k and v l of interpolating points are calculated using the chord-length parameterization method expressed as equations ( 25)-( 27).The node vector U and V are calculated using the average method expressed as equations ( 28)-(31).
where d l is the total chord length.Similarly, a reasonable v l can be obtained.
where, U i and V i represent the i À th element in the node vector, and p is the order of the B-spline interpolation.
Due to the obtained coefficient matrix is a positive definite band matrix, and its half bandwidth is less than p, so the Gaussian elimination method without a principal component can be used to solve equation (24).By solving the above equations, the mesh control points of the B-spline surface can be obtained.
It worth noting that the parameters mentioned in Section ''Partition of the point cloud model'' and Section ''B-spline surface fitting'' above need to be predefined, and the default recommended values for these parameters are listed in the Table 1.Based on these given parameters, the mathematical model of the workpiece can be reconstructed through the proposed method according to its point cloud model.

Illustration tests
Through the above-mentioned fast reconstruction method of dual-value single-bend closed section workpiece, a B-spline surface model is obtained based on its point cloud model.To verify the effectiveness of the proposed method, a universal turbine blade is adopted to illustrate the reconstruction process and results.To demonstrate the superiority of this method, a workpiece with known geometric parameters of configuration is tested by proposed method and crosssection slicing fitting method.

Turbine blade test
The turbine blade test is used to illustrate the correctness of each step and the effectiveness of the proposed method, and the details of each procedure are shown below.As the basis of the reconstruction, the input point cloud model of the blade and its optimal attitude after optimal transformation are shown in Figure 8.
On the optimal attitude, the efficient edge points are identified, and the edges are fitted, which is shown in Figure 9.
Further, as shown in Figure 10, the initial partition surface is constructed through the edge curves, and it is continuously modified to split the dual-value point cloud into two single-value point clouds.
Next, the grid points of each single-value point cloud are calculated using the moving least square method with cubic basis support field, and they are shown in Figure 11 left.
Finally, the reconstruction of the B-spline surface model is completed by interpolating the grid points using bicubic B-spline, which is shown in Figure 11 right.These renderings illustrate the effectiveness of the proposed method.

Designed surface test
To show the performance of the proposed method and prove the superiority of this method, the workpiece shown in Figure 12 is used as the test model.The geometric parameters of its configuration are shown on the left, and the corresponding point cloud model is shown on the right.As shown in the figure on the left, the cross-section shape is formed by splicing four tangential arcs, and then twisting 208 based on stretching 60mm to construct the final workpiece model.
As shown in the Figure 13, the B-spline surface model of the test workpiece is reconstructed through the proposed method, and the corresponding grid points and interpolated surfaces are illustrated.It can be seen from the simulation diagram that the dualvalue point cloud is well segmented into two singlevalue point clouds according to the edges, and the interpolation grid points are constructed through the moving least square method based on the dual-domain mapping.Thus, the good B-spline surface model of this workpiece is reconstructed.

Predefined parameter Default recommended value
Step length of the pseudo-gradient method The number of the grid points along the u direction m u = Ceiling( X max À X min ð Þ K max ) b The number of the grid points along the v direction The radius of the support field r = 1 2Kmax a This is the thickness of the workpiece, that is, the difference of the limiting Z coordinates under the optimal attitude.b Where, X max and X min represent the limiting X coordinates of the point cloud under the optimal attitude, Ceiling() is an integer up function, and K max represents the maximum Gauss curvature of the point cloud.As the comparison, a typical cross-section slicing method (CSF) is adopted to fit the test workpiece.The core of cross-section method is to project the points in the slicing field onto the slicing plane and the fit the space curve of each layer on each slicing plane.When the curves of all slicing layers are fitted out the spatial curves can be interpolated into a spatial surface in order.Thus, the number of slices affects the accuracy and speed of fitting, and for the given point cloud model, the diagrams of single and multi-layer slices are shown in the Figure 14.To demonstrate the influence of different slice numbers on the cross-section slicing method, this paper reconstructs the test workpiece under two slice numbers of 100 and 1000 and compares them with the proposed method.
After fitting the spatial curves of each slicing layer, the parametric mesh points are constructed by connecting these curves in sequence, as shown in the Figure 15, and the B-spline surface model of the workpiece can be generated by interpolating these mesh points.As shown   in the Figure 15, it is obvious that the mesh is more uniform and finer when the number of slices is large.
Finally, the fitted B-spline surface can be obtained by interpolating these mesh points as show in the Figure 16.
To verify the superiority of the proposed method, the cross-section slicing fitting (CSF) methods with 100 1000 slices are compared, and the reconstruction results of these three methods are analyzed.In detail, for given the same test workpiece, the computing times, root mean square errors (RMSE), and maximum absolute errors (MAE) of the surfaces reconstructed by these three methods are calculated, and the calculation results are shown in the Table 2.It can be seen from the data in the table that the computing time, RMSE and MAE of the proposed method are superior to those of the cross-section slicing method for the specific single-bending closed-section workpieces.Additionally, for the cross-section slicing fitting method, with the increase of the number of slices, the effect of workpiece   reconstruction becomes better, but the computing time greatly increases.The algorithms of the above three methods are implemented by the Python, and because Python is an interpreted programming language, its speed will be about 20-100 times slower than the compiled programming language C ++, but the difference in computing time between the different methods is still significant.
Thus, the effectiveness of the proposed method is verified by Turbine blade test, and the superiority of the proposed method is proved by Designed surface test.

Conclusions
In this paper, a fast reconstruction method of dualvalue single-bend closed section workpiece, which is from the point cloud model to the B-spline surface model, is proposed.Compared with the universal and robust methods, this method is a specific dual-value single-bend closed section workpiece, and it adopts dual-domain mapping interpolation based on the optimal attitude edge partition.This advantage ensures the accuracy and efficiency of the algorithm.Therefore, this method is widely applicable to the reconstruction of a lot of aviation, aerospace, and marine workpieces.
First, the transformation between the initial attitude and optimal processing attitude of workpieces is established.Secondly, the dual-value point cloud model is split into two single-value point clouds using an edge segmentation method which constructs and continuously optimizes a partition surface on the optimal attitude.Next, the grid point coordinates of the singlevalued point clouds model are calculated using the moving least square method with a cubic basis support   field.Finally, the B-Spline surface model of the workpiece is obtained by interpolating these accurate grid points.Illustrations are conducted to evaluate the performance of the presented method.It can be seen from the results that the presented method performs well for a typical dual-value single-bend closed-section workpiece (steam turbine blade).In details, for the test workpiece, the computing time of the method is 2.206 s under the Python platform, the root mean square error is 3:6694 3 10 À7 mm, and the maximum absolute error is 4:8950 3 10 À3 mm, which meets the accuracy required for digital manufacturing.Compared with the typical cross-section slicing fitting method, the calculation efficiency of the proposed method is more than three times faster, the accuracy is more than 18 times higher, and the control of the maximum error is comparable.Thus, this method is faster and more accurate and more suitable for reconstructing the point clouds of given workpieces with dual-value single-bend closed-section configuration into corresponding B-spline surfaces.
According to the characteristics of the workpiece, this method innovatively divides the dual-valued point cloud into two single-valued point clouds through the segmentation surface constructed by pseudo-gradient optimization and realizes the sub-regional reconstruction of the workpiece by using the fast single-valued surface reconstruction based on the moving least square method under the dual-domain mapping.Through the proposed method, the reconstruction of the specific dual-value single-bend closed-section workpieces is well realized.These parts, such as turbine blades, are widely used in aerospace and marine applications, so a highprecision surface can be reconstructed according to the point cloud of the original machining toolpath to carry out toolpath optimization work, which does not require the original workpiece model, so it can be carried out on the machine.In addition, because of the rapidity and accuracy of the reconstruction of the workpiece with a specific configuration, this method can be used in the reverse engineering of the workpiece, such as the blade of the aeroengine.
In future studies, the proposed method will be adapted to more complex shape workpieces.

Figure 1 .
Figure 1.Schematic diagram of point cloud segmentation.

Figure 2 .
Figure 2. Schematic diagram of the optimal transformation.

Figure 3 .
Figure 3.The flowchart of recognition and clustering of edge points.

Figure 5 .
Figure 5. Schematic diagram of the edge fitting and partition surface construction.

Figure 4 .
Figure 4. Schematic diagram of recognition and clustering: (a) diagram of the normal tolerance and (b) recognition and clustering process.

Figure 6 .
Figure 6.Partition of the point cloud.

Figure 7 .
Figure 7. Schematic diagram of the interpolating grid point calculation.

c
Where Y max and Y min represent the limiting Y coordinates of the point cloud under the optimal attitude.

Figure 8 .
Figure 8. Blade point cloud and optimal attitude diagram.

Figure 9 .
Figure 9. Recognition and fitting of edges.

Figure 10 .
Figure 10.Construction of the partition surface and point cloud splitting.

Figure 11 .
Figure 11.Grid points and the surface of interpolations.

Figure 12 .
Figure 12.The experimental workpiece and the corresponding point cloud.

Figure 13 .
Figure 13.The grid points and surfaces of proposed method for designed surface test.

Figure 14 .
Figure 14.The slicing diagram of cross-section slicing fitting method.

Table 2 .
Performance comparison of the reconstructions.