Keywords

1 Introduction

The development of science and technology has had a significant impact on the development process of world industry [1]. For the manufacturing industry, the dependence on people is increasingly weakened with the introduction of high and new technology, and a revolution that changes the entire manufacturing industry is taking place. Taking virtual assembly technology as an example, it has played a very important role in the product development and manufacturing process of many enterprises. Collision Detection is a key technology in the virtual assembly system, which is to detect whether, when and where a collision occurs between two or more objects in the virtual environment [2]. Accurate and efficient collision detection is very important for virtual assembly systems. In the virtual assembly system, when two objects are in contact or when the virtual hand is in contact with the object, the collision detection algorithm is needed to detect the contact between the two objects. Moreover, the virtual hand modeling and three-dimensional objects are mostly polyhedral modeling structures, and the accurate collision detection is based on the level of surface patch. In other words, the accurate judgment of whether there is a collision between two objects is mainly to detect whether there is a collision between the two surface patches. However, it is difficult to carry out collision detection directly among so many parts, the system calculation amount increases, and the response is not timely. In this regard, it is necessary to analyze the assembly relationship between parts and components in the process of importing parts into the system to reduce the number of collision detection, so as to promote the continuous reduction of system calculation and improve the real-time performance of the system. In order to continuously improve the system reaction performance, it is necessary to select a reasonable collision detection algorithm. Such algorithms need to be as simple as possible to improve the system’s responsiveness [3].

2 Description of Collision Problems in Virtual Assembly

The essence of collision detection is to determine the real-time model when the product digital model is in what relation. When the distance between two parts is 0, collision will occur, and in virtual assembly, collision detection based on this theory cannot meet the requirements of virtual assembly:

First of all, in the simulation, the distance between the parts is a discrete variable, and it is almost impossible to equal 0. Because the simulation algorithm is used for calculating the position iteration of parts by discrete time steps, and the parts do not move continuously [4]. Even if the smaller distance length is chosen to make the motion of the part appear continuous, the part is still essentially jumping from one position in space to another. In collision detection, the parts are still separated at that point in time and are already connected at the next point in time.

Second, the computer is not yet able to achieve accurate representation of the parts. Under normal circumstances, the accurate modeling method can express the error-free ideal state of the part, but the polygon model is only an approximate description, and the two should apply different methods to approximate the expression of the objects, so there is still a certain distinction between the real thing and the object. Therefore, it is difficult for the collision detection results of relevant models to fully reflect the problem of actual product collision [5]. In virtual assembly, it is necessary to know the space range near a part, so as to judge whether the part is reasonable. When conducting virtual maintenance, it is also necessary to know the spatial distance near the repaired part, so as to determine whether the maintenance tool can enter or operate normally. Taking into account the actual needs, it is often necessary to know the distance value of other parts that collide with the part or the part and other parts in the direction when a part moves a certain distance in a certain direction. If the manual measurement is carried out, the efficiency will be very low. According to this requirement, the algorithm of space collision fast verification and space distance fast verification is proposed, which are referred to as collision verification and distance verification respectively [6].

At present, collision detection in virtual assembly is a big problem to be solved urgently, so it is necessary to study the effective algorithm of collision detection.

3 Precise Collision Detection Method of K-DOPs

K-DOPs method needs to combine the specific shape of the scene, select multiple groups of parallel plane pairs with different directions, which contains a scene or a group of scenes of the hierarchical bounding box technology. These parallel plane pairs form a convex body, that is, a parallel 2K hedron. Based on this idea, more than 3 parallel plane pairs are used to approximate the object in collision detection. All parallel plane pairs are derived from the intersection of half Spaces defined by two normal vectors with opposite directions, and the normal vectors of these parallel plane pairs are fixed. In the specific application process, the direction of normal vector can be selected according to the specific situation, which is necessary to simplify the calculation process of parallel planes [7]. This collision detection algorithm is proposed based on the vertex mapping principle. The idea is to map a set of planar normals to various points on the k-DOP, and each stored point represents the farthest point along that direction. This point and this direction form a plane that completely contains the model in a half space, that is, the point is at the vertex of the k-DOP of the model. In the process of testing, vertices of a given orientation can be used for more precise cross-testing between K-DOPs, such as for improved cone culling, and for finding tighter AABBs after rotation.

If the value of K is large enough, K-DOP can become the convex hull of an object. In planar graphics, a convex hull is a convex polygon that surrounds a set of control points. In stereo graphics, the convex hull is mainly a polyhedral envelope connecting each fixed point with a surface [8]. Therefore, the package object of the convex hull is more compact, as long as the size of K and the parallel plane direction are scientifically selected, the collision detection process can be simplified, the superstition between the wrapped objects can be improved, and the system requirements can be met. The intersection test of K-DOP is shown in Fig. 1 below:

Fig. 1.
figure 1

Intersection test of K-DOP

Suppose SA and SB are subsets of the basic geometric elements corresponding to nodes VA and VB, and b(SA) and b(SB) are their K-DOP bounding boxes, respectively, and ∅ represents the empty set. If you want to test whether two k-DOPs, A and B (superscript index A and B) intersect, then test whether all parallel Slab pairs overlap; It’s a one-dimensional interval overlap test, easy to solve. This is an example of the dimensionality reduction recommended by the rule of thumb in Sect. 22.5. In this paper, the three-dimensional Slab test is simplified to one-dimensional interval overlap test. If at any time (i.e., an empty set), the BVs do not intersect and the test terminates. Otherwise, the Slba overlap test will continue. BVs are considered to overlap if and only if all si ≠ ∅,1 ≤ i ≤ k/2. According to the separation axis test, it is also necessary to test an axis of the cross product parallel to one edge of each k-DOP. However, these tests are often overlooked because their cost is higher than their return in performance [9]. Therefore, if the following test returns k-DOP overlaps, then they may in fact be disjoint.

Only k scalar values need to be stored in each instance of K-DOP (for all K-DOPs, the normal ni is stored only once because they are static). If k-DOP is translated by tA and tB respectively, the test becomes a little more complicated. Project tA onto the normal ni, such as piA = tA⋅ni(note that this is independent of any k-DOP, so it only needs to be calculated once for each tA or tB), and add piA to diA, min, and diA, max in the if statement. The same approach applies to tB. In other words, the translation changes the distance of k-DOP along each normal direction.

In order to accelerate the collision detection between objects, we can implement parallel bounding box-based collision detection between all objects with assembly relation [10]. Use a unified algorithm for all objects to conduct collision tests on other objects in parallel and virtual scenes. In this way the corresponding detection time can be changed from the original ft = ta + tb +… to ft = {max|ta + tb +… And it can also effectively reduce the collision detection time and help adapt to the requirements of the virtual assembly system. Figure 2 below shows the specific collision detection algorithm:

Fig. 2.
figure 2

Collision detection algorithm

After interference elimination is completed and the position of the object changes, the object is compared with the final initial position of the assembly. When j > 0 (j represents the projected length on the corresponding direction segment), the relationship between the current position and the final position of the virtual assembly is indicated. If the assembly process is completed within the preset threshold range, it means the completion of the assembly process, namely the end of the interference elimination process. In the case of j < 0, it represents the relationship between the current position and the initial position of the virtual assembly. If the object is out of the assembly interference area, then the assembly process is completed [11].

4 Conclusion

For virtual assembly, collision detection is an important task, and ensuring the accuracy of collision detection is the guarantee of the authenticity of virtual assembly data [12]. The use of 3D digital models for real product simulation is key to improving the accuracy of collision detection. In this study, it is proposed to establish the assembly relationship between virtual assemblies, combined with the use of the bounding box method, and finally carry out interference elimination. The application of k-DOPs algorithm is studied to improve the efficiency of the system collision detection and shorten the time required by the collision detection algorithm. This algorithm has been applied in virtual assembly with remarkable results. In the specific experimental operation, it is also necessary to consider that there may be ineffective compatibility between various parts, which may lead to a decrease in system efficiency, so relevant work needs to be further improved in the future.