## 2 Improving the Accuracy of Determination of Work Object's Shape and Location
To do this, for each point \(G_{q}\), calculate the angle \(\varphi_{q}=arccos\left(\frac{\overset{\rightarrow}{n_{q}}\overset{ \rightarrow}{\varphi_{q}}}{\left|\overset{\rightarrow}{n_{q}}\right|\overset{ \rightarrow}{\varphi_{q}}\right|}\right)\) lying between the normal vector \(\overset{\rightarrow}{n_{q}}=\left(G_{q}-H_{G}\right)\), connecting the center of mass of the cloud \(H_{G}=\frac{1}{m}\sum_{q=1}^{m}G_{q}\) with the point \(G_{q}\), and the vector \(\overset{\rightarrow}{v_{q}}=\left(G_{q}-S\right)\), where \(S\)\(\in\)\(R^{3}\) are the coordinates of the CS origin of MVS in the CS _Oxyz_. Discard the points \(G_{q}\) for which the inequality \(\varphi_{q}\leq\pi/2\) is true (Figure 3). After discarding the excess points, the clouds are aligned again by the ICP algorithm, and the vector \(\overset{\rightarrow}{p}_{3}\in R^{3}\) and matrix \(M_{72}\in R^{3\times 3}\) are calculated that describe the subsequent linear displacement and rotation of the model's point cloud relative to the SC _Oxyz_. As a result, similarly to Equation (1), the coordinates of the points \(D_{q}\) of the aligned point cloud of the object model are found by the following expression:  
\[D_{q}=H_{G}+M_{72}\overset{\rightarrow}{n_{q}}\overset{\rightarrow}{p_{3}} \tag{2}\]  
**3. Testing the Accuracy of Point Clouds' Alignment and Building the Trajectories of Movement of MM Working Tool over Object Surfaces**  
To test the accuracy of the point clouds' alignment performed, it is suggested to compare two projections of the same test trajectory: a projection onto the triangulation surface of the scanned object and a projection of this trajectory onto the triangulation surface of the object model aligned. To do this, the point cloud \(D_{q}\) and the point cloud of the object obtained from MVS should be represented as triangulation surfaces [17,31] consisting of a multitude of triangular polygons, where adjacent ones have common edges and vertices. In the CS _Oxyz_, each triangle of the object model surface is defined by a set of  
Figure 3: Filtered (green) and discarded (red) point clouds near the point cloud of the object surface. three vertices \(V_{k0},V_{k1},V_{k2}\in R^{3}\), where \(k=\overline{1,g},g\) is the number of triangles, and each of the \(w\) triangles of the scanned object surface is defined by vertices \(V_{h0},V_{h1},V_{h2}\in R^{3}\)\((h=\overline{1,w})\). To project the test trajectory built in the CS \(Oxyz\) onto both triangulation surfaces, it is necessary, first, to define the direction of the projecting rays by a single vector \(\overset{\rightarrow}{o}=(H_{D}-S)/\|H_{D}-S\|\) from the point \(S\) of the CS origin of MVS to the center of mass \(H_{D}=\frac{1}{m}\sum_{q=1}^{m}D_{q}\) of the object model's point cloud (Figure 4). The test trajectory should run on a plane perpendicular to the vector \(\overset{\rightarrow}{o}\), and its configuration can be selected depending on the known dimensions and shape of the object. As an example, define the trajectory as a sequence of \(n\) points lying on the same straight line \(c_{i_{r}}\big{(}i=\overline{1,n}\big{)}\) and find intersections of the rays extending from these points in the direction of the vector \(\overset{\rightarrow}{o}\) with both triangulation surfaces (Figure 4). As a result of the intersections, sets of points \(C_{i}\) and \(C_{i}^{\prime}\) are formed, which are the projections of the test trajectory onto the surfaces of the actual and simulated objects, respectively. The coordinates of the points \(C_{i}\) and \(C_{i}^{\prime}\) can be calculated using the modified Moller-Trumbore algorithm [25] in the following form:  
\[ \begin{split} C_{i}&=c_{i}+\frac{((c_{i}-V_{h0}) \times(V_{h1}-V_{h0}))\cdot(V_{h2}-V_{h0})}{\left(\overset{\rightarrow}{o} \times(V_{h2}-V_{h0})\right)\cdot(V_{h4}-V_{h0})}\\ C_{i}^{\prime}&=c_{i}+\frac{((c_{i}-V_{h0})\times(V_ {h1}-V_{h0}))\cdot(V_{h2}-V_{h0})}{\left(\overset{\rightarrow}{o}\times(V_ {h2}-V_{h0})\right)\cdot(V_{h1}-V_{h0})}\overset{\rightarrow}{o}\end{split}