Movable cable collision detection method based on digital simulation and OBB bounding box
Through the mechanical model based on Kirchhoff elastic thin rod theory and the collision detection method of OBB bounding box, the problem of failure to consider motion characteristics and collision situations in the mechanical simulation of active cables is solved, and efficient and accurate cable posture and collision are achieved. detection, improving computational efficiency and accuracy.
Patent Information
- Application Number
- CN202410303737.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-18
- Publication Date
- 2024-10-01
AI Technical Summary
The existing technology fails to effectively consider the motion characteristics and collision conditions of the cable in the mechanical simulation of moving cables, making it difficult to accurately detect the cable posture and collision during motion, and has high time complexity and redundant calculations. question.
The mechanical model of the movable cable is established based on the Kirchhoff elastic thin rod theory, and the elastic and plastic response of the cable is described through a set of differential equations. The OBB bounding box is used for collision detection, and the Levenberg-Marquardt algorithm is combined with the Levenberg-Marquardt algorithm for nonlinear optimization solution and pre-detection. Cables collide and generate bounding boxes for accurate collision detection.
It achieves accurate collision detection during the movement of the movable cable, improves calculation efficiency and accuracy, reflects the bending and torsion characteristics of the cable, and solves the limitations of cable pose simulation and collision detection in the existing technology.
Smart Images

Figure CN118734528A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of computer simulation, and in particular relates to a method for detecting collision of movable cables. Background Art
[0002] During the operation of the airborne satellite system, the antenna array is driven by the tracking servo turntable to rotate back and forth continuously, and the multiple cables on the servo mechanism also follow the movement. These cables are called active cables. Since active cables will affect the ideal working state of the servo mechanism, it is particularly important to study the motion form of active cables before cable assembly.
[0003] At present, the collision between cables is rarely mentioned in the mechanical simulation research on active cables. However, if there is a collision between active cables, the position of the collision cable and the interference torque it generates on the servo mechanism will be greatly changed compared with the simulation results without considering the collision. Therefore, it is very important to perform collision detection during the simulation process.
[0004] Reference (Jin Wangtao, Liu Jianhua, Liu Jiashun, et al. Physical property modeling and motion simulation technology of active cables under smooth plane constraints [J]. Journal of Mechanical Engineering, 2016, 52(3): 118-127.) uses Kirchhoff elastic thin rod theory to model the mechanical properties of active cables and proposes a set of differential equations to express the mechanical properties of cable elements. However, this method does not consider the change in the position of the cable after the active plane rotates, and ignores the actual working conditions of multiple cables colliding, which has certain limitations in engineering applications.
[0005] The literature (Wang Falin, Guo Yu, Liao Wenhe, Huang Shaohua. Cable collision detection technology based on distance field and sweep and cut algorithm [J]. Computer Engineering and Applications, 2017, 53 (10): 27-33.) uses the bounding sphere hierarchy, distance field and sweep and cut algorithm to perform collision detection, and proposes a collision detection method based on three-dimensional distance field mapping. However, the shape of the cable studied by this method is different from the cable detected by the present invention. At the same time, this method does not consider collision detection during the movement process, and only performs collision detection on the posture state of the moving cable at a certain moment. Therefore, this method is not suitable for the engineering application scenario targeted by the present invention.
[0006] Current methods for active cable collision detection have the following limitations:
[0007] 1. When simulating the position and posture of the active cable, its motion characteristics are not considered. It is difficult to give the corresponding cable position and posture at each moment when the active cable rotates with the plane, making it even more difficult to consider whether the active cable collides during the movement;
[0008] 2. The detection method for collision between different cables mainly calculates whether multiple bounding spheres or AABB bounding boxes intersect. These methods have the limitation of high time complexity, and there are many redundant calculations for cables that are originally impossible to collide and cables with special shapes (such as catenary). Summary of the invention
[0009] In order to overcome the shortcomings of the prior art, the present invention provides a collision detection method for active cables based on digital simulation and OBB bounding box, firstly, a mechanical model of an active cable is established; then the position of an active cable is solved; then, whether two active cables may collide is pre-detected; then, the bounding box model of the two active cables is established; finally, whether the bounding boxes of the two active cables intersect is determined. The present invention adopts Kirchhoff's elastic thin rod theory to establish the mechanical model of the active cable, which can better reflect the bending and torsion characteristics of the cable.
[0010] The technical solution adopted by the present invention to solve the technical problem is as follows:
[0011] Step 1: Establish a mechanical model of an active cable;
[0012] The active cable mechanics model is based on Kirchhoff's elastic thin rod theory. The active cable mechanics model consists of a set of differential equations that are used to describe the elastic and plastic responses of the thin rod under different loads and constraints.
[0013] The variables used in this step are defined as follows:
[0014] P O : Fixed end point of the active cable;
[0015] P l : Active end point of active cable;
[0016] L: length of active cable;
[0017] P-xyz: Frenet coordinate system with the center of the cable micro-element section as the origin and the micro-element binormal, tangent and normal directions as the axes;
[0018] O-ξηζ: A Cartesian three-dimensional inertial coordinate system is established with O as the origin, which is the global coordinate system;
[0019] F i : The component of the principal vector of the internal force acting on the adjacent cross section of the cable microelement section in the direction of the i-axis;
[0020] s: The arc coordinate on the cross section of the cable microelement, i.e. O The starting arc length distance;
[0021] T: unit vector in the tangent direction of the cable microelement section;
[0022] ω i : The bending torsion of the cable microelement section in the i-axis direction;
[0023] k i : Bending stiffness / torsional stiffness of the cable microelement section around the i-axis;
[0024] E: Young’s modulus of the active cable;
[0025] G: shear modulus of the active cable;
[0026] J i : moment of inertia of the cable microelement section about the i-axis;
[0027] d p : The cross-sectional diameter of the cable microelement segment;
[0028] q1,q2,q3,q4: Euler quaternion of the cross section of the cable microelement segment;
[0029] Step 1-1: Establish the global coordinate system O-ξηζ, input the length L of the active cable to be modeled, the coordinates P of the fixed end O , active end point coordinates P l , Young's modulus E, shear modulus G, cross-sectional diameter d p ;
[0030] Step 1-2: Divide the active cable into 10 micro-element segments evenly according to length;
[0031] Step 1-3: According to the formula Substitute the E, G, and d of the active cable p Calculate the bending stiffness / torsional stiffness k of the active cable microelement segment i ;
[0032] Step 1-4: Use Euler quaternions q1, q2, q3, q4 to represent the bending torsion ω i ; The algebraic relationship between bending and torsion and Euler quaternion is:
[0033]
[0034] in
[0035] Step 1-5: Establish the Kirchhoff force balance equations for the cable microelement segment:
[0036]
[0037] The equations are composed of the balance of forces and moments in the three axes in the Frenet coordinate system; the equilibrium equations and equations This constitutes essentially 7 unknowns F x 、F y 、F z , q1, q2, q3, q4 and a system of differential equations of 7 equations;
[0038] Step 1-6: Establish the Kirchhoff force balance equations of 10 cable microelement segments according to steps 1-3 to 1-5;
[0039] Step 1-7: Add geometric constraints to the cable;
[0040] Since the length of the active cable and the coordinates of the active point are known, four geometric constraint equations need to be added, including:
[0041]
[0042]
[0043] At this point, the overdetermined differential equations of 74 equations with 70 unknowns for a single active cable have been established, and this equation group is the active cable mechanics model;
[0044] Step 2: Solve the pose of an active cable;
[0045] Solving the position and posture of the active cable is to solve the overdetermined equations established in step 1, and then calculate the global coordinates of each discrete point of the active cable through the known quantities obtained;
[0046] The variables used in this step are defined as follows:
[0047] C n : The weight coefficient matrix of the n-th derivative;
[0048] N: the number of discrete points;
[0049] s i : Arc coordinates of the i-th point on the active cable;
[0050] Step 2-1: Discretize the differential terms of the equation system into the sum of the products of the elements of the n-th derivative of the weight coefficient matrix and the function value;
[0051] The nth order derivative is expressed as in
[0052] The calculation of the weight coefficient matrix is determined by the selection method of discrete points. The Chebyshev method is used to select discrete points, that is, After discretization, the differential terms in the system of equations are replaced by first-order polynomials consisting of discrete points;
[0053] Step 2-2: Convert the problem of solving the overdetermined algebraic equations into an optimization problem;
[0054] Suppose the expression of the jth equation in the overdetermined algebraic equation system is f j (x) = 0, then the algebraic equation system is f(x) = (f1(x), f2(x), …, f t (x) T =0, f(x) is the residual form of the system of equations;
[0055] The objective function of the optimization problem is defined as:
[0056]
[0057] Step 2-3: Use the Levenberg-Marquard method to solve the nonlinear optimization problem;
[0058] The input consists of a vector function f(x) = (f1(x), f2(x), …, f t (x) T , the initial value x0 of the solution vector, and the convergence condition ε x ,ε g , the output includes the solution vector of the overdetermined algebraic equation system;
[0059] Step 2-4: Calculate the global coordinates of the discrete points of the active cable using the solution of the system of equations;
[0060] The coordinates of the discrete points of the active cable are related to the Euler quaternion, and the calculation formula is:
[0061]
[0062] The global coordinates of each discrete point on the active cable have been solved, and the pose simulation of a single cable without considering the collision scenario has been completed at a rotation angle of the active plane;
[0063] Step 3: Preliminary detection of whether two active cables may collide;
[0064] Determining whether n active cables collide is equivalent to determining whether there is a colliding cable pair among all the cable pairs in the n active cables. Two cables form a cable pair, that is, there is a colliding cable pair among the n cables. different cable pairs; if there is no colliding cable pair, it is determined that the n active cables have not collided; if there is any colliding cable pair, it is determined that the n active cables have collided;
[0065] The variables used in this step are defined as follows:
[0066] l1: length of active cable 1;
[0067] l2: length of active cable 2;
[0068] d m : The distance between the coordinates of the active end of active cable 1 and the coordinates of the active end of active cable 2;
[0069] d f : The distance between the fixed end coordinates of the movable cable 1 and the fixed end coordinates of the movable cable 2;
[0070] Step 3-1: Given the coordinates of the movable end and fixed end of movable cable 1 and movable cable 2, use the distance formula between two points to calculate d m and d f ;
[0071] Step 3-2: If l1+l2 is satisfied <d m +d f When the active cable 1 and the active cable 2 are not collided, it is determined that there is no collision between the active cable 1 and the active cable 2, and steps 4 and 5 are not required; if the above formula is not satisfied, there may be a collision between the active cable 1 and the active cable 2, and steps 4 and 5 are required for further detection;
[0072] Step 4: Create bounding box models of two active cables;
[0073] The variables used in this step are defined as follows:
[0074] ξ i : The ξ-axis coordinate value of the i-th discrete point of the active cable in the global coordinate system O-ξηζ
[0075] η i : The η-axis coordinate value of the i-th discrete point of the active cable in the global coordinate system O-ξηζ
[0076] ζ i : The coordinate value of the ζ-axis of the ith discrete point of the active cable in the global coordinate system O-ξηζ
[0077] Ω1: The point set formed by the discrete points of an active cable after being divided by the splitting plane
[0078] Ω2: The point set formed by another part of the discrete point set of an active cable after being divided by the splitting plane
[0079] μ ξ : The average value of the ξ-axis coordinates of all points in a point set
[0080] μ η : The average value of the η-axis coordinates of all points in a point set
[0081] μ ζ : The average value of the ζ-axis coordinates of all points in a point set
[0082] A: A 3-row 3-column covariance matrix obtained based on the coordinate values and average values of a point set
[0083] BOX: An array that records all the information of the OBB bounding box (including 9 elements)
[0084] B: center point of the bounding box
[0085] ξ box : The ξ-axis coordinate of the center point of the OBB bounding box
[0086] η box : η-axis coordinate of the center point of the OBB bounding box
[0087] ζ box : The z-axis coordinate of the center point of the OBB bounding box
[0088] R: basis transformation matrix from global coordinate system O-ξηζ to OBB bounding box coordinate system B-123
[0089] r1: The first row of the basis transformation matrix from the global coordinate system O-ξηζ to the OBB bounding box coordinate system B-123 (3D row vector)
[0090] r2: The second row of the basis transformation matrix from the global coordinate system O-ξηζ to the OBB bounding box coordinate system B-123 (3D row vector)
[0091] r3: The third row of the basis transformation matrix from the global coordinate system O-ξηζ to the OBB bounding box coordinate system B-123 (3D row vector)
[0092] he1: The semi-major axis of the OBB bounding box in the direction of the covariance matrix eigenvector 1
[0093] he2: semi-major axis of the OBB bounding box in the direction of covariance matrix eigenvector 2
[0094] he3: semi-major axis of the OBB bounding box in the direction of the covariance matrix eigenvector 3
[0095] Step 4-1: When the movable plane rotates within the range of -30° to 30°, the η-axis coordinates of all discrete point coordinates obtained by step 2 during the movable cable 1 are sorted to find the discrete point with the minimum η-axis coordinate;
[0096] Step 4-2: Draw a splitting plane through this point parallel to the ξOζ plane, dividing all discrete points in the cable motion process into two point sets Ω1 and Ω2;
[0097] Step 4-3: Find the average value μ of all points in Ω1 on the ξ-axis, η-axis, and ζ-axis ξ , μ η , μ ζ ,,in n is the number of midpoints of Ω1, μ η , μ ζ The method of finding μ is the same as ξ , the coordinates of the center point of the bounding box are μ ξ , μ η , μ ζ ;
[0098] Step 4-4: Calculate the covariance matrix A formed by the coordinates of all points in Ω1, where cov(ξ,η)=E[(ξ i -μ ξ )(η i -μ η )], i∈Ω1, E means taking the average value;
[0099] Step 4-5: Calculate the three eigenvectors of A and orthogonalize them to obtain the point B (μ ξ ,μ η ,μ ζ ) is the origin and the three eigenvectors of A are the directions of the OBB bounding box coordinate system B-123;
[0100] Step 4-6: Calculate the basis transformation matrix R from the global coordinate system O-ξηζ to the OBB bounding box coordinate system B-123, taking the first row as r1, the second row as r2, and the third row as r3;
[0101] Step 4-7: Use R to find the coordinate values of all points in Ω1 in the OBB bounding box coordinate system B-123, and use sorting to find the three positive numbers with the largest absolute values on the three axes, which are defined as the semi-major axes he1, he2 and he3 of the bounding box;
[0102] Step 4-8: Create a BOX array, BOX = {μ ξ ,μ η ,μ ζ ,r1,r2,r3,he1,he2,he3}, BOX can represent all the features in the bounding box generated by Ω1;
[0103] Step 4-9: Repeat steps 4-3 to 4-8 for the Ω2 point set;
[0104] Step 4-9: Repeat steps 4-1 to 4-9 for active cable 2.
[0105] Step 5: Determine whether the bounding boxes of the two active cables intersect;
[0106] Use the Separating Axis Theorem SAT to determine whether the bounding boxes of active cable 1 and active cable 2 intersect;
[0107] The variables used in this step are defined as follows:
[0108] S: There may be a separating axis between bounding box 1 and bounding box 2: There are 15 possible separating axes, including 6 axes (3×2) parallel to the normal vector of a face of bounding box 1 and bounding box 2, and 9 axes (3×3) parallel to the common perpendicular line of a side of bounding box 1 and a side of bounding box 2;
[0109] B1: The center point of bounding box 1, i.e. the origin of the coordinate system of bounding box 1;
[0110] B2: The center point of bounding box 2 is the origin of the coordinate system of bounding box 2;
[0111] B s1 : The projection point of the center point of bounding box 1 on S;
[0112] B s1 : The projection point of the center point of bounding box 1 on S;
[0113] d s12 : The length of the projection segment of the line connecting B1 and B2 on S;
[0114] r s1 : The length of the projection radius of the bounding box 1 on S;
[0115] r s2 : The length of the projection radius of the bounding box 2 on S;
[0116] Ω s1 : Calculate r s1 The required point set;
[0117] Ω s2 : Calculate r s2 The required point set;
[0118] Step 5-1: Calculate the equation of the straight line B1B2 according to the coordinate values of B1 and B2;
[0119] Step 5-2: Calculate the plane equation of each face of bounding box 1 and bounding box 2 according to the main axis direction vector and the semi-major axis length of the bounding box coordinate system;
[0120] Step 5-3: Based on the 12 plane equations obtained in step 5-2 and the line equation of B1B2, calculate the intersection of B1B2 with bounding box 1 and bounding box 2 respectively. The four vertices of the intersection on bounding box 1 form a point set Ω s1 , the four vertices of the intersection surface on bounding box 2 form a point set Ω s2 ;
[0121] Step 5-4: Select an uncalculated separating axis S from the 15 separating axes. Determine the direction vector of S based on the direction vector of a principal axis of the two bounding box coordinate systems, or the direction vector of the cross product of the direction vector of a principal axis of the two bounding box coordinate systems;
[0122] Step 5-5: Make two planes perpendicular to S through B1 and B2. The intersection of these two planes with S is the projection B of B1 and B2 on S. s1 , B s2 , use the distance formula between two points to calculate B s1 , B s2 The distance d s12 ;
[0123] Step 5-6: Ω s1 The four points in are projected onto S in the same way as step 5-5, where B s1 The direction to the projection point is B s1 B s2 And the distance B s1 The farthest point is the projection point of bounding box 1 on S, which is the distance from B to s1 The distance is r s1 ;
[0124] Step 5-7: Ω s2 The four points in are projected onto S in the same way as step 5-5, where B s2 The direction to the projection point is B s2 B s1 And the distance B s2 The farthest point is the projection point of bounding box 2 on S, which is the distance from B to s2 The distance is r s2 ;
[0125] Step 5-8: If d is satisfied s12 >r s1 +r s2 , determine that bounding box 1 does not intersect with bounding box 2; otherwise, return to step 5-4 to calculate whether the two bounding boxes intersect based on the next possible separation axis; if for the 15 possible separation axes, d s12 >r s1 +r s2 If none of them holds true, then it is determined that bounding box 1 intersects bounding box 2. At this time, the coordinates of the midpoint of line segment B1B2 are calculated, and the position of this point is recorded as the collision location.
[0126] Step 5-9: If the two bounding boxes of active cable 1 do not intersect with the two bounding boxes of active cable 2, it is determined that active cable 1 and active cable 2 do not collide, and the output is that the cables do not collide; if one bounding box intersection occurs in the four bounding box intersection detections, it is determined that active cable 1 and active cable 2 collide, and the collided cables and all collision positions are output.
[0127] Preferably, the direction vector of a principal axis of the two bounding box coordinate systems is equivalent to the normal vector of the surface, which is 6 types in total; the direction vector after cross product of a principal axis direction vector of each of the two bounding box coordinate systems is equivalent to the common perpendicular line of the two sides, which is 9 types in total.
[0128] The beneficial effects of the present invention are as follows:
[0129] 1. The present invention adopts Kirchhoff's elastic thin rod theory to establish a mechanical model of the movable cable, which can better reflect the bending and torsion characteristics of the cable;
[0130] 2. The present invention uses the nonlinear least squares method Levenberg-Marquardt algorithm to solve the cable model. This solution has the advantages of high modeling accuracy and fast solution speed, and solves the problem that the elastic thin rod model is difficult to solve;
[0131] 3. The present invention performs a pre-detection before using the bounding box for accurate collider detection, thereby eliminating redundant calculations between non-intersecting cables and accelerating the calculation execution efficiency;
[0132] 4. The present invention adopts a bounding box generation method in which two bounding boxes (supporting expansion to multiple bounding boxes) contain an active cable, which combines the dual requirements of calculation speed and calculation accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0133] Figure 1 This is a schematic diagram showing the principle of using the theorem that the sum of two sides of a triangle is greater than the third side to determine the possibility of collision.
[0134] Figure 2 Schematic diagram of a double OBB bounding box enclosing a catenary.
[0135] Figure 3 This is the principle diagram of separation axis detection.
[0136] Figure 4 This is a software concept diagram of an embodiment of the present invention. DETAILED DESCRIPTION
[0137] The present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0138] In order to overcome the shortcomings of the prior art, the present invention provides an active cable collision detection method based on digital simulation and OBB bounding box, which can simulate whether there is a collision between multiple cables under the condition that the assembly position and physical characteristics of the active cables are known.
[0139] The technical solution of the present invention comprises the following steps:
[0140] Step 1: Establish a mechanical model of an active cable;
[0141] The active cable mechanics model is based on Kirchhoff's elastic thin rod theory. This theory is a mathematical model that describes the behavior of thin rods when subjected to bending, torsion and tension. The active cable mechanics model consists of a set of differential equations that describe the elastic and plastic responses of thin rods under different loads and constraints. Since the establishment of the mechanics model of multiple cables only requires repeating the establishment process of a single cable multiple times, only the modeling method of a single cable is described here.
[0142] Step 1-1: Establish the global coordinate system O-ξηζ, input the length L of the active cable to be modeled, the coordinates P of the fixed end O , active end point coordinates P l , Young's modulus E, shear modulus G, cross-sectional diameter d p ;
[0143] Step 1-2: Divide the active cable into 10 micro-element segments by length. Because the modeling process of each micro-element segment is the same, and the mechanical model of an active cable is a large equation system composed of all micro-element segment equations, the following steps only explain the modeling process of one micro-element segment;
[0144] Step 1-3: Calculate the bending stiffness / torsional stiffness k of the active cable microelement segment i According to the formula Substitute the E, G, and d of the active cable p Then it can be calculated;
[0145] Step 1-4: Use Euler quaternions q1, q2, q3, q4 to represent the bending torsion ω i The algebraic relationship between the bending torsion and the Euler quaternion is in
[0146] Step 1-5: Establish the Kirchhoff force balance equations for the cable segment The system of equations consists of the balance of forces and moments in the three axes in the Frenet coordinate system. This constitutes essentially 7 unknowns F x 、F y 、F z , q1, q2, q3, q4 and a system of differential equations of 7 equations;
[0147] Step 1-6: Establish the Kirchhoff force balance equations of 10 cable microelement segments according to steps 1-3 to 1-5;
[0148] Step 1-7: Add geometric constraints to the cable. Since the length of the active cable and the coordinates of the active point are known, four geometric constraint equations need to be added, including and At this point, the overdetermined differential equations of 74 equations with 70 unknowns for a single active cable have been established, which is the required mechanical model. In addition, when the active plane rotates within the range of -30° to 30°, the coordinates of the active point of the active cable will change with the rotation of the active plane, and the three constraint equations established based on the coordinates of the active point need to be changed to establish a new mechanical model.
[0149] Step 2: Solve the pose of an active cable;
[0150] Solving the pose of the active cable is to solve the overdetermined equations established in step 1, and then calculate the global coordinates of each discrete point of the active cable through the known quantities obtained.
[0151] Step 2-1: Discretize the differential terms of the system of equations into the sum of the products of the elements of the n-th derivative of the weight coefficient matrix and the function value. The n-th derivative can be expressed as in The calculation of the weight coefficient matrix is determined by the selection method of discrete points. Here, the Chebyshev method is used to select discrete points, that is, After discretization, the differential terms in the system of equations are replaced by first-order polynomials consisting of discrete points;
[0152] Step 2-2: Convert the problem of solving an overdetermined algebraic equation system into an optimization problem. Suppose the expression of the jth equation in the overdetermined algebraic equation system is f j (x) = 0, then the algebraic equation system is f(x) = (f1(x), f2(x), …, f t (x) T = 0, f(x) is the residual form of the system of equations. The objective function of the optimization problem is defined as
[0153] Step 2-3: Use the Levenberg-Marquard method to solve the nonlinear optimization problem. The input of the algorithm includes the vector function f(x) = (f1(x), f2(x), …, f t (x)T , the initial value x0 of the solution vector, and the convergence condition ε x ,ε g ,The output of the algorithm mainly includes the solution vector of the ,overdetermined set of algebraic equations.
[0154] Step 2-4: Use the solution of the equation group to calculate the global coordinates of the discrete points of the active cable. The coordinates of the discrete points of the active cable are related to the Euler quaternion, and the calculation formula is At this point, the global coordinates of each discrete point on the active cable have been solved, and the pose simulation of a single cable without considering the collision scenario has been completed at a rotation angle of the active plane.
[0155] Step 3: Preliminary detection of whether two active cables may collide;
[0156] Determining whether n active cables collide is equivalent to determining whether all the cable pairs among the n active cables (two cables form a cable pair, that is, there are different cable pairs), whether there is a cable pair that collides. If there is no cable pair that collides, it is determined that the n active cables do not collide; if there is any cable pair that collides, it is determined that the n active cables collide. Because the collision detection process is to continuously detect whether two cables collide, in step 3, step 4 and step 5, the detection of whether two cables collide is taken as an example. When it is necessary to determine the situation where more than two cables collide, the method can be repeated for different cable pairs.
[0157] like Figure 1 As shown in the figure, according to the theorem that the sum of two sides of a triangle is greater than the third side, if the coordinates of the fixed ends of two active cables are too far away from the coordinates of the active ends, there is no possibility that the two cables intersect. In this case, there is no need to solve the bounding box model of the active cables, and it can be directly determined that the two active cables do not intersect; otherwise, it is necessary to establish the bounding box model of the active cables to further determine whether the cables collide.
[0158] Step 3-1: Given the coordinates of the movable and fixed ends of active cable 1 and active cable 2, use the distance formula between two points to calculate d m and d f ;
[0159] Step 3-2: If l1+l2 is satisfied <d m +d f When , it is determined that there will be no collision between the active cable 1 and the active cable 2, and steps 4 and 5 are not required; if the above formula is not satisfied, a collision may occur between the active cable 1 and the active cable 2, and steps 4 and 5 are required to further perform precise detection.
[0160] Step 4: Create bounding box models of two active cables;
[0161] Since the active cable belongs to the catenary, the error of generating a single OBB bounding box to include a cable is large. Therefore, this method uses two OBB bounding boxes to include an active cable, and also supports the expansion of the bounding box. When using two OBB bounding boxes to include the active cable 1, first find a discrete point belonging to the active cable 1, the ζ coordinate of this point is the minimum value of the ζ coordinate of all discrete points of the active cable. Make a splitting plane parallel to the ξOζ plane through this point, which splits all discrete points of the active cable 1 into two point sets. The two point sets generate a bounding box respectively, and these two bounding boxes contain the active cable 1.
[0162] Since the position and posture of the active cable 1 will change with the rotation of the active plane, when the rotation range of the active plane is -30° to 30°, it is necessary to obtain a set of discrete point coordinates through step 2 every time the active plane rotates 5°. Use the point set formed by all 13 groups of discrete points to generate two OBB bounding boxes. These two bounding boxes contain all active areas of the active cable 1. If the calculation accuracy of the two bounding boxes cannot meet the collision detection requirements under certain working conditions, this method supports expansion to multiple bounding boxes containing an active cable, so that the collision position of the cable can be accurately output. Since the generation method of each bounding box is basically the same, only the operation process of using two bounding boxes to enclose the active cable is described here. When there are multiple bounding boxes, multiple corresponding point sets can be divided and generated in sequence. Figure 2 shown.
[0163] Step 4-1: When the movable plane rotates within the range of -30° to 30°, the η-axis coordinates of all discrete point coordinates obtained by step 2 during the movable cable 1 are sorted to find the discrete point with the minimum η-axis coordinate;
[0164] Step 4-2: Draw a splitting plane parallel to the ξOζ plane through this point to divide all discrete points in the cable motion process into two point sets Ω1 and Ω2. Since the same bounding box generation operation needs to be performed on Ω1 and Ω2, the following description takes the method of generating a bounding box for Ω1 as an example.
[0165] Step 4-3: Find the average value μ of all points in Ω1 on the ξ-axis, η-axis, and ζ-axis ξ , μ η , μ ζ ,,in n is the number of midpoints of Ω1, μ η , μ ζ The method of finding μ is the same as ξ , the coordinates of the center point of the bounding box are μ ξ , μ η , μ ζ ;
[0166] Step 4-4: Calculate the covariance matrix A formed by the coordinates of all points in Ω1, where cov(ξ,η)=E[(ξ i -μ ξ )(η i -μ η )], i∈Ω1, E means taking the average value;
[0167] Step 4-5: Calculate the three eigenvectors of A and orthogonalize them to obtain the point B (μ ξ ,μ η ,μ ζ ) is the origin and the three eigenvectors of A are the directions of the OBB bounding box coordinate system B-123;
[0168] Step 4-6: Calculate the basis transformation matrix R from the global coordinate system O-ξηζ to the OBB bounding box coordinate system B-123, taking the first row as r1, the second row as r2, and the third row as r3;
[0169] Step 4-7: Use R to find the coordinate values of all points in Ω1 in the OBB bounding box coordinate system B-123, and use sorting to find the three positive numbers with the largest absolute values on the three axes, which are defined as the semi-major axes he1, he2 and he3 of the bounding box;
[0170] Step 4-8: Create a BOX array, BOX = {μ ξ ,μ η ,μ ζ ,r1,r2,r3,he1,he2,he3}, BOX can represent all the features in the bounding box generated by Ω1;
[0171] Step 4-9: Repeat steps 4-3 to 4-8 for the Ω2 point set;
[0172] Step 4-9: Repeat steps 4-1 to 4-9 for active cable 2.
[0173] Step 5: Determine whether the bounding boxes of the two active cables intersect
[0174] like Figure 3 As shown, the separating axis theorem (SAT) is used to determine whether the bounding boxes of active cable 1 and active cable 2 intersect. Because each active cable is represented by two (or more) bounding boxes, it is necessary to detect whether the two bounding boxes intersect multiple times to verify whether the two cables collide. Since the method for determining whether any two bounding boxes intersect is the same, only the method for determining whether any two bounding boxes intersect is described here.
[0175] Step 5-1: Calculate the equation of the straight line B1B2 according to the coordinate values of B1 and B2;
[0176] Step 5-2: Calculate the plane equation of each face of bounding box 1 and bounding box 2 according to the main axis direction vector and the semi-major axis length of the bounding box coordinate system;
[0177] Step 5-3: Based on the 12 plane equations obtained in step 5-2 and the line equation of B1B2, calculate the intersection of B1B2 with bounding box 1 and bounding box 2 respectively. The four vertices of the intersection on bounding box 1 form a point set Ω s1 , the four vertices of the intersection surface on bounding box 2 form a point set Ω s2 ;
[0178] Step 5-4: Select an uncalculated separating axis S from the 15 separating axes. Determine the direction vector of S based on the direction vector of a principal axis of the two bounding box coordinate systems (equivalent to the normal vector of the surface, a total of 6 types), or the direction vector of the cross product of the direction vector of a principal axis of the two bounding box coordinate systems (equivalent to the common perpendicular line of the two sides, a total of 9 types);
[0179] Step 5-5: Make two planes perpendicular to S through B1 and B2. The intersection of these two planes with S is the projection B of B1 and B2 on S. s1 , B s2 , use the distance formula between two points to calculate B s1 , B s2 The distance d s12 ;
[0180] Step 5-6: Ω s1 The four points in are projected onto S in the same way as step 5-5, where B s1 The direction to the projection point is B s1 B s2 And the distance B s1 The farthest point is the projection point of bounding box 1 on S, which is the distance from B to s1 The distance is r s1 ;
[0181] Step 5-7: Ω s2 The four points in are projected onto S in the same way as step 5-5, where B s2 The direction to the projection point is B s2 B s1 And the distance B s2 The farthest point is the projection point of bounding box 2 on S, which is the distance from B to s2 The distance is r s2 ;
[0182] Step 5-8: If d is satisfied s12 >r s1 +r s2, determine whether bounding box 1 and bounding box 2 do not intersect; otherwise, return to step 5-4 to calculate whether the two bounding boxes intersect based on the next possible separation axis. If for the 15 possible separation axes, d s12 >r s1 +r s2 If none of them holds true, then it is determined that bounding box 1 intersects bounding box 2. At this time, the coordinates of the midpoint of line segment B1B2 are calculated, and the position of this point is recorded as the collision location;
[0183] Step 5-9: If the two bounding boxes of active cable 1 do not intersect with the two bounding boxes of active cable 2, it is determined that active cable 1 and active cable 2 do not collide, and the output is that the cables do not collide; if one bounding box intersection occurs in the four bounding box intersection detections, it is determined that active cable 1 and active cable 2 collide, and the collided cables and all collision positions are output.
[0184] Example:
[0185] A method for detecting collision of active cables based on digital simulation and OBB bounding box includes the following steps:
[0186] Step 1: Establish the active cable mechanical model;
[0187] Step 1-1: Input the length L of the active cable and the coordinates P of the fixed end O , active end point coordinates P l , Young's modulus E, shear modulus G, cross-sectional diameter d p ;
[0188] Step 1-2: Divide the active cable into 10 micro-element segments evenly according to length;
[0189] Step 1-3: Calculate the bending stiffness / torsional stiffness k of the active cable microelement segment i and bending torsion ω i ;
[0190] Step 1-4: Establish the Kirchhoff force balance equations for each cable segment, and add 4 geometric constraint equations about the length of the active cable and the coordinates of the active point to form an overdetermined differential equation system with 70 unknowns and 74 equations;
[0191] Step 1-5: Under different rotation angles of the active plane, 13 groups of overdetermined differential equations about a single active cable are established according to different active point coordinates;
[0192] Step 1-6: Establish an overdetermined differential equation group for all cables according to steps 1-2 to 1-5;
[0193] Step 2: Solve the active cable pose;
[0194] Step 2-1: Discretize the differential terms of the system of equations into the sum of the products of the elements of the n-th derivative of the weight coefficient matrix and the function value.
[0195] Step 2-2: Convert the system of equations into f(x)=(f1(x),f2(x),…,f t (x) T =0, the optimization goal is
[0196] Step 2-3: Use the Levenberg-Marquard method to solve the nonlinear optimization problem, and use the discrete point calculation formula and the optimization problem solution vector to calculate the position of an active cable at a rotation angle on the active plane;
[0197] Step 2-4: Solve all positions of a single cable at different rotation angles of the activity plane according to steps 2-2 to 2-3;
[0198] Step 2-5: Solve all positions of all cables when the movable panel rotates according to steps 2-2 to 2-4;
[0199] Step 3: Screen the cable pairs that may collide;
[0200] Step 3-1: Divide all active cables into n groups of different cable pairs;
[0201] Step 3-2: Calculate the coordinate distance d between the active ends of a pair of cables m The distance d from the fixed end coordinate f ;
[0202] Step 3-3: l1 and l2 are the lengths of the two active cables, and l1+l2 is determined. <d m +d f Is it true? If it is true, the cable pair will not collide; otherwise, the cable pair may collide;
[0203] Step 3-4: Determine whether all cable pairs may collide according to the method of steps 3-2 to 3-3, and record the cable pairs that may collide;
[0204] Step 4: Create a bounding box model of the active cable;
[0205] Step 4-1: Find the point with the smallest η-axis coordinate among all the discrete points of a moving cable that may collide, and make a splitting plane parallel to the ξOζ plane through this point to divide all the discrete points in the cable motion process into two point sets Ω1 and Ω2;
[0206] Step 4-2: Calculate the average value μ of all points in Ω1 on the ξ-axis, η-axis, and ζ-axis ξ , μη , μ ζ and the covariance matrix A;
[0207] Step 4-3: Calculate the three eigenvectors of A and orthogonalize them to obtain the point B (μ ξ ,μ η ,μ ζ ) is the origin and the three eigenvectors of A are the directions of the OBB bounding box coordinate system B-123;
[0208] Step 4-4: Calculate the basis transformation matrix R from the global coordinate system O-ξηζ to the OBB bounding box coordinate system B-123, as well as the semi-major axes he1, he2 and he3 of the bounding box, and use the BOX array to record all the information of the bounding box formed by Ω1;
[0209] Step 4-5: Create a bounding box generated by the Ω2 point set in the same manner as steps 4-2 to 4-4;
[0210] Step 4-6: According to the method of steps 4-1 to 4-5, two bounding box models (supporting expansion to multiple bounding box models) are established for all active cables that may collide, to represent their active ranges;
[0211] Step 5: Determine whether there is a collision between cables;
[0212] Step 5-1: For a pair of active cables that may collide, select a bounding box of each of the two cables;
[0213] Step 5-2: Calculate the equation of the line connecting the center points of the two bounding boxes and the plane equation of each face of the bounding box, so as to find the intersection of the line connecting the center points and the two bounding boxes. The four vertices on the two intersections form two point sets Ω s1 and Ω s2 ;
[0214] Step 5-3: Calculate an untested separation axis direction vector;
[0215] Step 5-4: Project the center points of the two bounding boxes onto the separation axis and calculate the distance d between the projection points s12 , Ω s1 and Ω s2 Project the points in onto the separation axis and calculate the projection radius r of the two bounding boxes s1 and r s2 ;
[0216] Step 5-5: Determine d s12 >r s1 +r s2If it is true, the two bounding boxes do not intersect; if not, follow steps 5-3 to 5-4 to verify whether there is a separation axis that makes the two bounding boxes non-intersecting. If for the 15 possible separation axes, d s12 >r s1 +r s2 If neither of them holds true, then the two bounding boxes are judged to intersect, and the coordinates of the midpoint of the line connecting the center points of the two bounding boxes are calculated, and the position of this point is recorded as the collision location;
[0217] Step 5-6: Follow the steps 5-1 to 5-5 to verify whether the other bounding boxes of the two cables intersect. If there are bounding boxes that intersect, record the collision of the two active cables and the collision position; if the bounding boxes do not intersect each time, the cable pair does not collide;
[0218] Step 5-7: Follow the steps 5-1 to 5-6 to verify whether other cable pairs that may collide collide. If a collision occurs, record the collided cables; if no collision occurs, the active cables to be tested will not collide;
[0219] Step 5-8: If all active cables do not collide, output that the cables do not collide; if a collision occurs, output all cable pairs that collide and all collision positions of each pair of active cables.
[0220] Step 6: Software implementation;
[0221] like Figure 4 As shown in the figure, the algorithm part of the software is developed in Python, the front-end part adopts the ThreeJS framework and is developed in the react language. The window size is 600*600, and the entire interface is divided into three parts: upper, middle and lower. The top is a menu bar with a size of 600*50, which has three buttons: mode selection, quantity setting, and photo taking. In the middle is a photo preview window with a size of 600*400, which holds the preview of the current photo. At the bottom is a console with a size of 600*150, which contains two text boxes on the left and right. The left text box outputs the color information of the wire obtained for the first time, and the right text box outputs the color information of the wire obtained for the second time and the order of its first appearance.
[0222] How to use the software:
[0223] Import the 3D model of the rotating mechanism, select two planes in the model as the fixed plane and the rotating plane, and select a straight line on the rotating plane as the rotating axis; click the Add Cable button, enter the length, Young's modulus, shear modulus, and cross-sectional radius of the cable, and select the active end point and fixed end point of the cable; after adding all the cables in sequence, click the Collision Detection button, and the information bar will output collision information after the software has run for a while.
[0224] Install two cables at different positions on the test bench, add cables with the same physical parameters in the software and select the same installation position. When the collision cable pair output by the software is consistent with the control experiment results, and the maximum difference between the collision position output by the software and the collision position of the control experiment result is less than or equal to the cable diameter, the experiment can be considered successful; otherwise, it means the experiment failed.
[0225] Experimental results:
[0226] Table 1 Calculation results of discrete point coordinates of cable 1 in a control experiment
[0227] Unit(m)
[0228]
[0229] Table 2 Calculation results of discrete point coordinates of cable 2 in a control experiment
[0230] Unit(m)
[0231]
[0232] Table 3 Comparison of collision information between software output and actual experiment in a control experiment
[0233] Unit(m)
[0234] Software output results Actual experimental results Error (≤ cable diameter) Collision cable pair (cable 1, cable 2) (cable 1, cable 2) none Collision point coordinates 1 (0.133,0.0883,0.0734) (0.1297,0.0889,0.0722) 0.0036 Collision point coordinates 2 (0.1311,0.0861,0.0731) (0.1274,0.0845,0.0728) 0.004 Collision point coordinates 3 (0.1505,0.0833,0.0745) (0.1477,0.0852,0.0761) 0.0037 Collision point coordinates 4 (0.1414,0.0821,0.0774) (0.1388,0.0845,0.0794) 0.0041 Collision point coordinates 5 (0.1509,0.0794,0.0851) (0.1466,0.0801,0.0841) 0.0045
[0235] Table 4 Experimental results statistics
[0236] success fail Success rate 5 0 100%
[0237] The experimental results show that the present invention has a 100% success rate in testing the collision of two cables. Because the number of active cables on the servo mechanism is also small in real use scenarios, the present method has engineering value and is fully capable of simulating the collision of active cables.
Claims
1. A method for detecting collision of active cables based on digital simulation and OBB bounding box, characterized in that: The steps include: Step 1: Establish a mechanical model of an active cable; The active cable mechanics model is based on Kirchhoff's elastic thin rod theory. The active cable mechanics model consists of a set of differential equations that are used to describe the elastic and plastic responses of the thin rod under different loads and constraints. The variables used in this step are defined as follows: P O : Fixed end point of the active cable; P l : Active end point of active cable; L: length of active cable; P-xyz: Frenet coordinate system with the center of the cable micro-element section as the origin and the micro-element binormal, tangent and normal directions as the axes; O-ξηζ: A Cartesian three-dimensional inertial coordinate system is established with O as the origin, which is the global coordinate system; F i : The component of the principal vector of the internal force acting on the adjacent cross section of the cable microelement section in the direction of the i-axis; s: The arc coordinate on the cross section of the cable microelement, i.e. O The starting arc length distance; T: unit vector in the tangent direction of the cable microelement section; ω i : The bending torsion of the cable microelement section in the i-axis direction; k i : Bending stiffness / torsional stiffness of the cable microelement section around the i-axis; E: Young’s modulus of the active cable; G: shear modulus of the active cable; J i : moment of inertia of the cable microelement section about the i-axis; d p : The cross-sectional diameter of the cable microelement segment; q1,q2,q3,q4: Euler quaternion of the cross section of the cable microelement segment; Step 1-1: Establish the global coordinate system O-ξηζ, input the length L of the active cable to be modeled, the coordinates P of the fixed end O , active end point coordinates P l , Young's modulus E, shear modulus G, cross-sectional diameter d p ; Step 1-2: Divide the active cable into 10 micro-element segments evenly according to length; Step 1-3: According to the formula Substitute the E, G, and d of the active cable p Calculate the bending stiffness / torsional stiffness k of the active cable microelement segment i ; Step 1-4: Use Euler quaternions q1, q2, q3, q4 to represent the bending torsion ω i ; The algebraic relationship between bending and torsion and Euler quaternion is: in Step 1-5: Establish the Kirchhoff force balance equations for the cable microelement segment: The system of equations consists of the balance of forces and moments in the three axes in the Frenet coordinate system; the system of equilibrium equations and equation This constitutes essentially 7 unknowns F x 、F y 、F z , q1, q2, q3, q4 and a system of differential equations of 7 equations; Step 1-6: Establish the Kirchhoff force balance equations of 10 cable microelement segments according to steps 1-3 to 1-5; Step 1-7: Add geometric constraints to the cable; Since the length of the active cable and the coordinates of the active point are known, four geometric constraint equations need to be added, including: At this point, the overdetermined differential equations of 74 equations with 70 unknowns for a single active cable have been established, and this equation group is the active cable mechanics model; Step 2: Solve the pose of an active cable; Solving the position and posture of the active cable is to solve the overdetermined equations established in step 1, and then calculate the global coordinates of each discrete point of the active cable through the known quantities obtained; The variables used in this step are defined as follows: C n : The weight coefficient matrix of the n-th derivative; N: the number of discrete points; s i : Arc coordinates of the i-th point on the active cable; Step 2-1: Discretize the differential terms of the equation system into the sum of the products of the elements of the n-th derivative of the weight coefficient matrix and the function value; The nth order derivative is expressed as in The calculation of the weight coefficient matrix is determined by the selection method of discrete points. The Chebyshev method is used to select discrete points, that is, After discretization, the differential terms in the system of equations are replaced by first-order polynomials consisting of discrete points; Step 2-2: Convert the problem of solving the overdetermined algebraic equations into an optimization problem; Suppose the expression of the jth equation in the overdetermined algebraic equation system is f j (x)=0, then the algebraic equation system is f(x)=(f1(x),f2(x),…,f t (x) T =0, f(x) is the residual form of the system of equations; The objective function of the optimization problem is defined as: Step 2-3: Use the Levenberg-Marquard method to solve the nonlinear optimization problem; The input consists of a vector function f(x) = (f1(x), f2(x), …, f t (x) T , the initial value x0 of the solution vector, and the convergence condition ε x ,ε g , the output includes the solution vector of the overdetermined algebraic equation system; Step 2-4: Calculate the global coordinates of the discrete points of the active cable using the solution of the system of equations; The coordinates of the discrete points of the active cable are related to the Euler quaternion, and the calculation formula is: The global coordinates of each discrete point on the active cable have been solved, and the pose simulation of a single cable without considering the collision scenario has been completed at a rotation angle of the active plane; Step 3: Preliminary detection of whether two active cables may collide; Judging whether n active cables collide is equivalent to judging whether there is a cable pair that collides among all the cable pairs in the n active cables. Two cables form a cable pair, that is, there is a C in the n cables. n 2 different cable pairs; if there is no colliding cable pair, it is determined that the n active cables have not collided; if there is any colliding cable pair, it is determined that the n active cables have collided; The variables used in this step are defined as follows: l1: length of active cable 1; l2: length of active cable 2; d m : The distance between the coordinates of the active end of active cable 1 and the coordinates of the active end of active cable 2; d f : The distance between the fixed end coordinates of the movable cable 1 and the fixed end coordinates of the movable cable 2; Step 3-1: Given the coordinates of the movable end and fixed end of movable cable 1 and movable cable 2, use the distance formula between two points to calculate d m and d f ; Step 3-2: If l1+l2 is satisfied <d m +d f When , it is determined that there will be no collision between the active cable 1 and the active cable 2, and there is no need to perform steps 4 and 5; if the above formula is not satisfied, there may be a collision between the active cable 1 and the active cable 2, and steps 4 and 5 need to be performed for further detection; Step 4: Create bounding box models of two active cables; The variables used in this step are defined as follows: ξ i : The ξ-axis coordinate value of the i-th discrete point of the active cable in the global coordinate system O-ξηζ η i : The η-axis coordinate value of the i-th discrete point of the active cable in the global coordinate system O-ξηζ ζ i : The coordinate value of the ζ-axis of the ith discrete point of the active cable in the global coordinate system O-ξηζ Ω1: The point set formed by the discrete points of an active cable after being divided by the splitting plane Ω2: The point set formed by another part of the discrete point set of an active cable after being divided by the splitting plane μ ξ : The average value of the ξ-axis coordinates of all points in a point set μ η : The average value of the η-axis coordinates of all points in a point set μ ζ : The average value of the ζ-axis coordinates of all points in a point set A: A 3-row 3-column covariance matrix obtained based on the coordinate values and average values of a point set BOX: An array that records all the information of the OBB bounding box (including 9 elements) B: center point of the bounding box ξ box : The ξ-axis coordinate of the center point of the OBB bounding box η box : η-axis coordinate of the center point of the OBB bounding box ζ box : The z-axis coordinate of the center point of the OBB bounding box R: basis transformation matrix from global coordinate system O-ξηζ to OBB bounding box coordinate system B-123 r1: The first row of the basis transformation matrix from the global coordinate system O-ξηζ to the OBB bounding box coordinate system B-123 (3D row vector) r2: The second row of the basis transformation matrix from the global coordinate system O-ξηζ to the OBB bounding box coordinate system B-123 (3D row vector) r3: The third row of the basis transformation matrix from the global coordinate system O-ξηζ to the OBB bounding box coordinate system B-123 (3D row vector) he1: The semi-major axis of the OBB bounding box in the direction of the covariance matrix eigenvector 1 he2: semi-major axis of the OBB bounding box in the direction of covariance matrix eigenvector 2 he3: semi-major axis of the OBB bounding box in the direction of the covariance matrix eigenvector 3 Step 4-1: When the movable plane rotates within the range of -30° to 30°, the η-axis coordinates of all discrete point coordinates obtained by step 2 during the movable cable 1 are sorted to find the discrete point with the minimum η-axis coordinate; Step 4-2: Draw a splitting plane through this point parallel to the ξOζ plane, dividing all discrete points in the cable motion process into two point sets Ω1 and Ω2; Step 4-3: Find the average value μ of all points in Ω1 on the ξ-axis, η-axis, and ζ-axis ξ , μ η , μ ζ ,,in n is the number of midpoints of Ω1, μ η , μ ζ The method of finding μ is the same as ξ , the coordinates of the center point of the bounding box are μ ξ , μ η , μ ζ ; Step 4-4: Calculate the covariance matrix A formed by the coordinates of all points in Ω1, where cov(ξ,η)=E[(ξ i -μ ξ )(η i -μ η )], i∈Ω1, E means taking the average value; Step 4-5: Calculate the three eigenvectors of A and orthogonalize them to obtain the point B (μ ξ ,μ η ,μ ζ ) is the origin and the three eigenvectors of A are the directions of the OBB bounding box coordinate system B-123; Step 4-6: Calculate the basis transformation matrix R from the global coordinate system O-ξηζ to the OBB bounding box coordinate system B-123, taking the first row as r1, the second row as r2, and the third row as r3; Step 4-7: Use R to find the coordinate values of all points in Ω1 in the OBB bounding box coordinate system B-123, and use sorting to find the three positive numbers with the largest absolute values on the three axes, which are defined as the semi-major axes he1, he2 and he3 of the bounding box; Step 4-8: Create a BOX array, BOX = {μ ξ ,μ η ,μ ζ ,r1,r2,r3,he1,he2,he3}, BOX can represent all the features in the bounding box generated by Ω1; Step 4-9: Repeat steps 4-3 to 4-8 for the Ω2 point set; Step 4-9: Repeat steps 4-1 to 4-9 for active cable 2; Step 5: Determine whether the bounding boxes of the two active cables intersect; Use the Separating Axis Theorem SAT to determine whether the bounding boxes of active cable 1 and active cable 2 intersect; The variables used in this step are defined as follows: S: There may be a separating axis between bounding box 1 and bounding box 2: There are 15 possible separating axes, including 6 axes (3×2) parallel to the normal vector of a face of bounding box 1 and bounding box 2, and 9 axes (3×3) parallel to the common perpendicular line of a side of bounding box 1 and a side of bounding box 2; B1: The center point of bounding box 1, i.e. the origin of the coordinate system of bounding box 1; B2: The center point of bounding box 2 is the origin of the coordinate system of bounding box 2; B s1 : The projection point of the center point of bounding box 1 on S; B s1 : The projection point of the center point of bounding box 1 on S; d s12 : The length of the projection line segment of the line connecting B1 and B2 on S; r s1 : The length of the projection radius of the bounding box 1 on S; r s2 : The length of the projection radius of the bounding box 2 on S; Ω s1 : Calculate r s1 The required point set; Ω s2 : Calculate r s2 The required point set; Step 5-1: Calculate the equation of the straight line B1B2 according to the coordinate values of B1 and B2; Step 5-2: Calculate the plane equation of each face of bounding box 1 and bounding box 2 according to the main axis direction vector and the semi-major axis length of the bounding box coordinate system; Step 5-3: Based on the 12 plane equations obtained in step 5-2 and the line equation of B1B2, calculate the intersection of B1B2 with bounding box 1 and bounding box 2 respectively. The four vertices of the intersection on bounding box 1 form a point set Ω s1 , the four vertices of the intersection surface on bounding box 2 form a point set Ω s2 ; Step 5-4: Select an uncalculated separation axis S from the 15 separation axes; determine the direction vector of S according to the direction vector of a principal axis of the two bounding box coordinate systems, or the direction vector of the cross product of the direction vector of a principal axis of the two bounding box coordinate systems; Step 5-5: Make two planes perpendicular to S through B1 and B2. The intersection of these two planes with S is the projection B of B1 and B2 on S. s1 , B s2 , use the distance formula between two points to calculate B s1 , B s2 The distance d s12 ; Step 5-6: Ω s1 The four points in are projected onto S in the same way as step 5-5, where B s1 The direction to the projection point is B s1 B s2 And the distance B s1 The farthest point is the projection point of bounding box 1 on S, which is the distance from B to s1 The distance is r s1 ; Step 5-7: Ω s2 The four points in are projected onto S in the same way as step 5-5, where B s2 The direction to the projection point is B s2 B s1 And the distance B s2 The farthest point is the projection point of bounding box 2 on S, which is the distance from B to s2 The distance is r s2 ; Step 5-8: If d is satisfied s12 >r s1 +r s2 , determine that bounding box 1 does not intersect with bounding box 2; otherwise, return to step 5-4 to calculate whether the two bounding boxes intersect based on the next possible separation axis; if for the 15 possible separation axes, d s12 >r s1 +r s2 If none of them holds true, then it is determined that bounding box 1 intersects bounding box 2. At this time, the coordinates of the midpoint of line segment B1B2 are calculated, and the position of this point is recorded as the collision location. Step 5-9: If the two bounding boxes of active cable 1 do not intersect with the two bounding boxes of active cable 2, it is determined that active cable 1 and active cable 2 do not collide, and the output is that the cables do not collide; if one bounding box intersection occurs in the four bounding box intersection detections, it is determined that active cable 1 and active cable 2 collide, and the collided cables and all collision positions are output.
2. The method for detecting collision of active cables based on digital simulation and OBB bounding box according to claim 1, characterized in that: The direction vectors of a principal axis of the two bounding box coordinate systems are equivalent to the normal vector of the surface, which are 6 in total; the direction vectors after the cross product of the direction vectors of a principal axis of the two bounding box coordinate systems are equivalent to the common perpendicular line of the two sides, which are 9 in total.
