Real-time collision detection method for complex geometric model

By seamlessly discretizing complex geometric models and calculating three-sided depth information, and combining geometric transformation matrix optimization for collision detection in dynamic scenes, the problems of high computational load and low accuracy in existing technologies are solved, achieving efficient and real-time collision detection.

CN120850375APending Publication Date: 2025-10-28BEIHANG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510837349.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2025-10-28

AI Technical Summary

Technical Problem

Existing collision detection methods suffer from high computational cost and low accuracy when dealing with complex geometric models, making it difficult to achieve real-time detection. They are particularly inefficient in dynamic scenes and cannot meet real-time requirements.

Method used

By seamlessly discretizing complex geometric models and combining the depth information of three surfaces, collision detection in dynamic scenes is optimized using geometric transformation matrices, avoiding discretization errors and improving detection accuracy and efficiency.

Benefits of technology

It achieves efficient and accurate collision detection between complex geometric models, reduces computational load, meets real-time requirements, and improves detection accuracy and speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120850375A_ABST
    Figure CN120850375A_ABST
Patent Text Reader

Abstract

The invention relates to a real-time collision detection method for a complex geometric model, which belongs to the technical field of computer-aided geometric design and collision detection, and comprises the following steps of: performing seamless discretization processing on a complex geometric model A and a complex geometric model B in a CAD (Computer-Aided Design) system, and calculating depth information of three surfaces to obtain a real-time collision detection result of the complex geometric model A and the complex geometric model B; the method can efficiently and accurately judge the collision relationship between complex geometric models, optimizes the collision detection process in a dynamic scene, avoids the introduction of errors when discretization processing is carried out on a curved surface or solid model, improves the detection precision, is small in calculation amount, achieves real-time detection, and improves the detection accuracy. And the efficiency and accuracy of collision detection of a polyhedron, a curved surface or a solid model in a CAD system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer-aided geometric design and collision detection technology, specifically to a real-time collision detection method for complex geometric models. Background Technology

[0002] Collision detection is an integral part of computer graphics, robotics, physical simulation, virtual reality (VR), and augmented reality (AR). It involves the use of algorithms and data structures to determine whether objects in a virtual environment are in contact with or pass through each other. Accurate collision detection is crucial for creating realistic simulations and interactive experiences, especially in environments involving physical simulation and precise object control. In aerospace, automotive manufacturing, and other fields, collision detection technology plays a key role in ensuring the rationality and feasibility of product designs. For example, in the assembly design of aircraft components, accurate collision detection can avoid errors in actual manufacturing and assembly, reducing costs and time losses. In industrial automation, collision detection technology helps robotic arms effectively avoid obstacles during grasping operations, improving production efficiency and safety.

[0003] Existing collision detection methods mainly include the following: bounding box-based methods, such as Axially Aligned Bounding Box (AABB), Directed Bounding Box (OBB), and Minimum Bounding Sphere (MBS). AABB is a cuboid parallel to the coordinate axes; although computationally simple, it has low accuracy for rotating objects. OBB can adapt to the rotation of objects, but its computational complexity is high. MBS can effectively handle objects of arbitrary shapes, but its bounding volume may be larger than the actual object. There are also spatial segmentation-based techniques, such as octrees, binary spatial partitioning trees (BSP trees), and quadtrees, which reduce the number of detections by dividing the three-dimensional space into smaller parts. Furthermore, image-space-based collision detection algorithms utilize graphics hardware to project the model onto a two-dimensional plane, and then determine whether a collision occurs based on the intersection of these projections. The GJK (Gilbert-Johnson-Keerthi) algorithm is a commonly used collision detection algorithm, mainly used to detect whether two convex polygons intersect and calculate the minimum distance between them.

[0004] However, existing collision detection methods have many limitations. For polyhedral models, existing methods based on geometric feature retrieval and comparison are computationally expensive when dealing with complex models, making real-time detection difficult. For curved or solid models, complex discretization is often required, which can introduce errors and affect the accuracy of collision detection. Existing bounding box-based detection methods may require a large number of bounding boxes to accurately represent objects when dealing with complex models, leading to increased computational costs. Image-space-based collision detection algorithms are limited by image resolution, which may result in false positives, and they are not suitable for handling collision detection between concave bodies. When dealing with dynamic scenes, existing collision detection algorithms struggle to efficiently incorporate the model's motion characteristics for optimization, resulting in low detection efficiency and failing to meet real-time requirements. Summary of the Invention

[0005] In view of the above problems, this invention provides a real-time collision detection method for complex geometric models. This invention performs seamless discretization processing on complex geometric models A and B in a CAD system, and then calculates the depth information of three surfaces. It can efficiently and accurately determine the collision relationship between complex geometric models, optimize the collision detection process in dynamic scenes, avoid the errors introduced when discretizing curved or solid models, improve detection accuracy, reduce computational load, achieve real-time detection, and improve the efficiency and accuracy of collision detection of polyhedra, curved surfaces, or solid models in CAD systems. It can be widely used in fields with high requirements for 3D model collision detection, such as aerospace, automobile manufacturing, and industrial design.

[0006] This invention provides a real-time collision detection method for complex geometric models, comprising:

[0007] Step S1: Discretize the complex geometric model A and complex geometric model B in the CAD system to obtain a seamless multi-faceted model A and a seamless multi-faceted model B.

[0008] Step S2: Perform three-sided depth information processing on the seamless multi-faceted model A and the seamless multi-faceted model B respectively to obtain three-sided depth digital model one and three-sided depth digital model two respectively.

[0009] Step S3: Let t = 0. When t = 0, it represents a state of rest. When t = 1, it represents the initial moment of motion.

[0010] Step S4: When at rest, i.e., t=0, traverse each coordinate plane. If the three-dimensional depth digital model one and the three-dimensional depth digital model two do not satisfy the intersection condition in at least one coordinate plane, it means that no collision has occurred and proceed to the next step; if all coordinate planes satisfy the intersection condition, it is determined that a collision has occurred, and the collision detection of the complex geometric model is completed.

[0011] Step S5: At time t, determine whether the seamless polyhedron model A or the seamless polyhedron model B is a static or dynamic body, and obtain the dynamic body and the static body at time t.

[0012] Step S6: Obtain the surface point coordinates and corresponding motion path of the moving body at time t, calculate the motion direction of the moving body relative to the stationary body at time t, and determine the corresponding geometric transformation matrix;

[0013] Step S7: Using the geometric transformation matrix at motion time t, transform the three-dimensional depth digital model of the moving body at motion time t from its own coordinate system to the coordinate system of the stationary body at motion time t, and obtain the surface point coordinates of the moving body at motion time t in the stationary coordinate system.

[0014] Step S8: Determine whether the coordinates of the surface point of the moving body at time t in the static coordinate system are within the spatial range defined by the three-dimensional depth digital model of the static body at time t.

[0015] If at least one surface point has coordinates within the three-dimensional depth digital model of the stationary body at time t, then a collision is determined to have occurred at time t, and the collision detection of the complex geometric model is completed; otherwise, it is considered that no collision has occurred, and the process proceeds to the next step.

[0016] Step S9: Determine whether t is greater than or equal to T, where T represents the total number of motion moments. If yes, complete the collision detection of complex geometric model A and complex geometric model B. If no, take the surface point coordinates of the moving body at motion moment t in the static coordinate system as the surface point coordinates of the moving body at motion moment t+1, let t = t+1, and return to step S5.

[0017] Optionally, the complex geometric model A and complex geometric model B are polyhedral models, surface models or solid models in a CAD system.

[0018] Optionally, the specific steps for obtaining the moving body and the stationary body at motion time t in step S5 include: at motion time t, determining whether one of the seamless polyhedron model A and the seamless polyhedron model B remains stationary; if so, taking the stationary seamless polyhedron model as the stationary body and the other seamless polyhedron model as the moving body.

[0019] If not, then both seamless polyhedron model A and seamless polyhedron model B are in motion. Compare the volumes of seamless polyhedron model A and seamless polyhedron model B, and designate the seamless polyhedron model with the larger volume as the static body and the seamless polyhedron model with the smaller volume as the dynamic body.

[0020] Optionally, the geometric transformation matrix can describe the position and attitude changes of the moving body during the motion process.

[0021] Optionally, the specific steps for obtaining the first and second three-sided depth digital models respectively include:

[0022] Set the grid spacing for each coordinate plane. Based on the grid spacing, uniformly divide each coordinate plane of the seamless polyhedron model A and the seamless polyhedron model B to generate corresponding grid cells A and B.

[0023] Set the starting position of the ray;

[0024] In each grid cell of grid cell A, rays are emitted along a set direction and intersected with the seamless polyhedral model A. The coordinates of the intersection point of each ray with the seamless polyhedral model A and the depth value of the intersection point are recorded to obtain multiple sets of two-dimensional arrays.

[0025] In each grid cell of grid cell B, rays are emitted along a set direction and intersected with the seamless polyhedral model B. The coordinates of the intersection point of each ray with the seamless polyhedral model B and the depth value of the intersection point are recorded to obtain multiple sets of two-dimensional arrays.

[0026] Based on multiple sets of two-dimensional arrays, a three-dimensional depth digital model is established.

[0027] Based on multiple sets of two-dimensional arrays, a three-dimensional depth digital model is established.

[0028] Optionally, the specific steps to obtain the coordinates of the intersection point include:

[0029] Determine grid point P, and emit a ray from grid point P;

[0030] Establish the equation of the coordinate plane;

[0031] Based on the plane equation of the coordinate plane, obtain the intersection parameters of the ray and the coordinate plane, and determine whether the intersection parameters are ≥0. If yes, the ray intersects the coordinate plane and proceeds to the next step; otherwise, it means that the ray does not intersect the coordinate plane.

[0032] The intersection point coordinates are obtained based on the intersection point parameters.

[0033] Optionally, the coordinates of the intersection point are expressed as:

[0034]

[0035] Where Q is the coordinate of the intersection point, and t' is the intersection point parameter. Let P be the ray direction vector, and let P represent the grid point coordinates.

[0036] The specific steps of step S3 include:

[0037] At any coordinate plane at the initial moment, determine whether the depth value of the intersection point of the three-sided depth digital model one and the depth value of the intersection point of the three-sided depth digital model two satisfy the intersection condition; if they satisfy the condition, the coordinate planes are considered to have an intersection; if they do not satisfy the condition, the coordinate planes do not have an intersection.

[0038] Traverse each coordinate plane at the initial moment. If at least one coordinate plane has no intersection, it means that no collision has occurred, and proceed to the next step.

[0039] If all coordinate planes at the initial moment satisfy the intersection condition, then a collision is determined to have occurred, thus completing the collision detection for the complex geometric model.

[0040] Compared with the prior art, the present invention has at least the following beneficial effects:

[0041] (1) The present invention obtains the depth information of the complex geometric model on three planes, which can more comprehensively describe the geometric features of the complex geometric model and further improve the accuracy of collision detection.

[0042] (2) In dynamic scenes, the present invention reasonably distinguishes between moving and static bodies and performs corresponding geometric transformations, making collision detection more targeted, eliminating the need for complex multi-threaded operations, simplifying the detection process, and reducing the difficulty of implementation;

[0043] (3) This invention uses a geometric transformation matrix to transform the depth model of a moving body to a static coordinate system, thereby realizing real-time collision detection of complex geometric models;

[0044] (4) This invention can efficiently and accurately determine the collision relationship between complex geometric models by discretization processing and three-sided depth information calculation, avoiding misjudgment and missed judgment, improving detection speed while ensuring detection accuracy, effectively reducing the amount of calculation, and meeting real-time requirements. Attached Figure Description

[0045] The accompanying drawings are for illustrative purposes only and are not intended to limit the scope of the invention.

[0046] Figure 1 This is a schematic diagram of the process of real-time collision detection method for complex geometric models in an embodiment of the present invention. Detailed Implementation

[0047] To better understand the above-described objectives, features, and advantages of the present invention, the invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments of the present invention and the features thereof can be combined with each other. Furthermore, the present invention can be implemented in other ways different from those described herein; therefore, the scope of protection of the present invention is not limited to the specific embodiments disclosed below.

[0048] A specific embodiment of the present invention, such as Figure 1 A real-time collision detection method for complex geometric models is disclosed, and the specific implementation steps are as follows:

[0049] Step S1: Extract complex geometric model A and complex geometric model B from the CAD system;

[0050] Discretize complex geometric models A and B to obtain seamless polyhedral models A and B.

[0051] It is understood that the CAD system is a computer-aided design system, a tool that uses computer technology to assist in design, drawing, and simulation.

[0052] It is understood that the complex geometric model A and complex geometric model B are polyhedral models, surface models or solid models in the CAD system;

[0053] It is understood that the complex geometric model is a model with a high level of detail, irregular shape, or complex topological structure;

[0054] Optionally, the polyhedral model is a discretized geometric model composed of multiple planar patches;

[0055] The surface model describes the surface of an object using parametric curves or surfaces;

[0056] The solid model contains a five-layer structure of points, lines, surfaces, and volumes, which is used to describe the complete geometric and topological information of the object;

[0057] Furthermore, the curved surface model can be a car body or an aircraft engine blade; the polyhedron model can be a physical model of a simulation game engine.

[0058] The physical model can be a gearbox, the arm of an industrial robot, or a building structure;

[0059] It is understandable that the surface of the aircraft engine blades consists of complex curved surfaces containing multiple fine geometric features; the car body includes a large number of free-form surfaces and complex contours.

[0060] Optionally, the specific steps for discretizing the complex geometric model A and the complex geometric model B in step S1 include:

[0061] Based on the accuracy requirements of the application scenarios of complex geometric models A and B, determine the resolution of mesh A and the resolution of mesh B;

[0062] Based on the resolution of mesh A and the resolution of mesh B, the three-dimensional space containing complex geometric model A and complex geometric model B is divided into uniform mesh unit A and mesh unit B, respectively.

[0063] Obtain each surface point of mesh cell A;

[0064] Obtain each surface point of mesh cell B;

[0065] Project the point cloud of each surface point 1 and each surface point 2 respectively to obtain the nearest neighbor of each surface point 1 in grid cell A and the nearest neighbor of each surface point 2 in grid cell B;

[0066] Obtain the Euclidean distance between the nearest neighbor of each surface point in grid cell A and the corresponding surface point, which is represented as distance error 1. Multiple distance errors 1 are obtained, sorted, and the largest distance error 1 is selected.

[0067] Obtain the Euclidean distance between the nearest neighbor of each surface point 2 in grid cell B and the corresponding surface point 2, which is represented as distance error 2. Multiple distance errors 2 are obtained, sorted, and the largest distance error 2 is selected.

[0068] Preset maximum curvature threshold;

[0069] Obtain the Gaussian curvature of the surface of mesh unit A, identify the corresponding high curvature region, and determine whether the high curvature region is within the preset maximum curvature threshold. At the same time, determine whether the maximum distance error is within the preset error threshold. If yes, obtain each mapped mesh node and proceed to the next step; otherwise, adjust the high curvature region and the maximum distance error of mesh unit A to obtain each mapped mesh node and proceed to the next step.

[0070] Obtain the Gaussian curvature 2 of the surface of grid cell B, identify the corresponding high curvature region 2, and determine whether the high curvature region 2 is within the preset maximum curvature threshold. At the same time, determine whether the maximum distance error 2 is within the preset error threshold. If so, obtain each mapped grid node 1 and each mapped grid node 2, and proceed to the next step.

[0071] If not, adjust the high curvature region 2 and the maximum distance error 2 of grid cell B to obtain each mapped grid node 2, and proceed to the next step;

[0072] Connect the two adjacent mapped mesh nodes to generate a seamless multi-faceted model A;

[0073] Connect the two adjacent mapped mesh nodes to generate a seamless multi-faceted model B.

[0074] Optionally, the specific steps for adjusting the high curvature region and the maximum distance error of grid cell A include:

[0075] When the curvature region of grid cell A is greater than the preset maximum curvature threshold, and the maximum distance error is greater than the preset error threshold, then increase the resolution of grid cell A, increase the number of grids, and increase the number of multi-faceted patches.

[0076] When the curvature region of grid cell A is less than the preset maximum curvature threshold and the maximum distance error is less than the preset error threshold, the resolution of grid cell A is reduced, the number of grids is reduced, and the number of polyhedrons is reduced.

[0077] When the curvature region of mesh cell A is greater than the preset maximum curvature threshold and the maximum distance error is less than the preset error threshold, the priority of the curvature region and the distance error is evaluated, and the resolution and number of polymorphs of mesh cell A are processed according to the priority.

[0078] Optionally, the expression for the maximum distance error is:

[0079] τ=max||P i -S(P i )||

[0080] Where τ is the maximum distance error, representing the maximum geometric deviation between the complex geometric model and its corresponding mesh element, and P i S(P) is the i-th discrete point on a complex geometric model. i () is an approximate point of the i-th discrete point in the grid cell;

[0081] Optionally, the accuracy requirements include shape tolerance, position tolerance, surface roughness, global accuracy of mesh generation, and local accuracy.

[0082] This invention generates a high-precision, low-complexity seamless multi-faceted model by using the Catmull-Clark adaptive subdivision algorithm, combined with curvature-driven encryption and singularity processing.

[0083] The seamless processing method in this invention is achieved by precisely controlling the mesh generation and polyhedron generation during discretization. During discretization, the boundary of each mesh unit is aligned with adjacent units to avoid gaps or overlaps. Simultaneously, the geometric features of the complex geometric model surface are meticulously sampled, ensuring that the generated polyhedron model closely fits the shape of the original model. This guarantees that the discretized polyhedron model is seamless overall, effectively preventing errors introduced by discretization from affecting the accuracy of collision detection.

[0084] In the discretization process, this invention employs an adaptive discretization method to ensure that the multi-faceted model can accurately approximate the geometry of the original model, while minimizing the number of multifaceted pieces to reduce the complexity of subsequent calculations.

[0085] Step S2: Perform three-sided depth information processing on the seamless multi-faceted model A and the seamless multi-faceted model B respectively to obtain three-sided depth digital model one and three-sided depth digital model two respectively.

[0086] Optionally, the specific steps for obtaining the first three-sided depth digital model and the second three-sided depth digital model respectively include:

[0087] Set the grid spacing for each coordinate plane. Based on the grid spacing, uniformly divide each coordinate plane of the seamless polyhedron model A and the seamless polyhedron model B to generate corresponding grid cells A and B.

[0088] Set the starting position of the ray;

[0089] In each grid cell of grid cell A, rays are emitted along a set direction and intersected with the seamless polyhedral model A. The coordinates of the intersection point of each ray with the seamless polyhedral model A and the depth value of the intersection point are recorded to obtain multiple sets of two-dimensional arrays.

[0090] In each grid cell of grid cell B, rays are emitted along a set direction and intersected with the seamless polyhedral model B. The coordinates of the intersection point of each ray with the seamless polyhedral model B and the depth value of the intersection point are recorded to obtain multiple sets of two-dimensional arrays.

[0091] Based on multiple sets of two-dimensional arrays, a three-dimensional depth digital model is established.

[0092] Based on multiple sets of two-dimensional arrays, a three-dimensional depth digital model is established.

[0093] It is understood that the starting position of the ray is from the top left corner of the grid in each coordinate plane;

[0094] Optionally, the coordinate plane is the XOY plane, the YOZ plane, or the ZOX plane;

[0095] For example, the XOY plane is projected along the positive Z-axis direction;

[0096] The YOZ plane is projected along the positive X-axis direction;

[0097] The ZOX plane is projected along the positive Y-axis direction;

[0098] Optionally, the expression for the intersection depth value is:

[0099] d=||PQ||

[0100] Where P is the coordinate of the grid point, Q is the coordinate of the intersection point, and d is the depth value of the intersection point.

[0101] Optionally, the three-sided depth digital model refers to a depth information model generated on three coordinate planes respectively, which is used to describe the geometric features of the seamless multi-faceted model in different directions, which is beneficial for extracting and storing depth information and facilitating collision detection.

[0102] Optionally, the specific steps to obtain the coordinates of the intersection point include:

[0103] Determine a grid point P, and emit rays from grid point P along the coordinate axes. The expression is:

[0104]

[0105] in, Let P be the ray direction vector, P represent the grid point coordinates, t represent the ray position when the ray extends a distance t, t represent the unknown intersection parameter, and t represent the distance the ray extends.

[0106] The equation of the coordinate plane is established as follows:

[0107]

[0108] in, X is the normal vector of the coordinate plane, and X represents the coordinates of any point in the coordinate plane.

[0109] Based on the plane equation of the coordinate plane, obtain the intersection parameter t of the ray and the coordinate plane, and determine whether the intersection parameter t is ≥0. If it is, the ray intersects the coordinate plane and proceeds to the next step; otherwise, it means that the ray does not intersect the coordinate plane.

[0110] The coordinates of the intersection point are obtained based on the intersection point parameters, expressed as follows:

[0111]

[0112] Where Q is the coordinate of the intersection point and t′ is the intersection point parameter.

[0113] Understandably, the starting position can be set to the origin (0,0) of each coordinate plane or the lower left corner of a grid point; for example, on the XOY plane, starting from the origin (0,0), rays are emitted sequentially along the X-axis or Y-axis to gradually cover the entire plane.

[0114] Step S3: Let t = 0. When t = 0, it represents a state of rest. When t = 1, it represents the initial moment of motion.

[0115] Step S4: At any coordinate plane at the initial moment, determine the depth value d at the intersection point d1 of the three-sided depth digital model one.A The depth value d at the intersection point d2 of the three-sided depth digital model 2 B Does the intersection condition satisfy? The intersection condition is d. A ≤d B +∈andd B ≤d A +∈, where ∈ is the fault tolerance value;

[0116] If the conditions are met, then the coordinate planes are considered to have an intersection; if the conditions are not met, then the coordinate planes do not have an intersection.

[0117] Traverse each coordinate plane at the initial moment. If at least one coordinate plane has no intersection, it means that no collision has occurred, and proceed to the next step.

[0118] If all coordinate planes at the initial moment satisfy the intersection condition, then a collision is determined to have occurred, and the collision detection of the complex geometric model is completed.

[0119] Step S5: At time t, determine whether one of the seamless polyhedron model A and the seamless polyhedron model B remains stationary. If so, take the stationary seamless polyhedron model as the static body and the other seamless polyhedron model as the dynamic body.

[0120] If not, then both seamless polyhedron model A and seamless polyhedron model B are in motion. Compare the volumes of seamless polyhedron model A and seamless polyhedron model B, and designate the seamless polyhedron model with the larger volume as the static body and the seamless polyhedron model with the smaller volume as the dynamic body.

[0121] Step S6: Obtain the surface point coordinates and corresponding motion path of the moving body at time t, calculate the motion direction of the moving body relative to the stationary body at time t, and determine the corresponding geometric transformation matrix;

[0122] It is understood that the geometric transformation matrix can describe the changes in position and attitude of a moving body during motion;

[0123] Step S7: Using the geometric transformation matrix at motion time t, transform the three-dimensional depth digital model of the moving body at motion time t from its own coordinate system to the coordinate system of the stationary body at motion time t, and obtain the surface point coordinates of the moving body at motion time t in the stationary coordinate system.

[0124] Step S8: Determine whether the coordinates of the surface point of the moving body at time t in the static coordinate system are within the spatial range defined by the three-dimensional depth digital model of the static body at time t.

[0125] If at least one surface point has coordinates within the three-dimensional depth digital model of the stationary body at time t, then a collision is determined to have occurred at time t, and the collision detection of the complex geometric model is completed; otherwise, it is considered that no collision has occurred, and the process proceeds to the next step.

[0126] It is understood that the spatial range defined by the three-dimensional depth digital model corresponding to the stationary body at motion time t is the spatial range formed by the coordinates of all intersection points of the three-dimensional depth digital model corresponding to the stationary body at motion time t.

[0127] Step S9: Determine whether t is greater than or equal to T, where T represents the total number of moments. If yes, complete the collision detection between complex geometric model A and complex geometric model B. If no, take the surface point coordinates of the moving body at moment t in the static coordinate system as the surface point coordinates of the moving body at moment t+1, set t = t+1, and return to step S5.

[0128] During the judgment process, multi-threading technology is used to assign different surface points to different threads for parallel judgment, thereby improving judgment efficiency and realizing real-time collision detection of complex geometric models.

[0129] Optionally, employing multithreading technology, the specific steps of assigning different surface points to different threads for parallel judgment include:

[0130] The surface points of the moving body are assigned to multiple threads according to the rules of spatial division or point index range. Each thread independently determines whether the surface point assigned to it is within the spatial range defined by the three-sided depth digital model of the static body.

[0131] Specifically, each thread checks whether the coordinates of the surface points meet the depth value range conditions of the static three-sided depth digital model. By processing multiple surface points in parallel, multi-threading technology can significantly reduce the total collision detection time, thereby achieving real-time collision detection for complex geometric models.

[0132] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included in the scope of protection of the present invention.

Claims

1. A real-time collision detection method for complex geometric models, characterized in that, include: Step S1: Discretize the complex geometric model A and complex geometric model B in the CAD system to obtain a seamless multi-faceted model A and a seamless multi-faceted model B. Step S2: Perform three-sided depth information processing on the seamless multi-faceted model A and the seamless multi-faceted model B respectively to obtain three-sided depth digital model one and three-sided depth digital model two respectively. Step S3: Let t = 0. When t = 0, it represents a state of rest. When t = 1, it represents the initial moment of motion. Step S4: When at rest, i.e., t=0, traverse each coordinate plane. If the three-dimensional depth digital model one and the three-dimensional depth digital model two do not satisfy the intersection condition in at least one coordinate plane, it means that no collision has occurred and proceed to the next step; if all coordinate planes satisfy the intersection condition, it is determined that a collision has occurred, and the collision detection of the complex geometric model is completed. Step S5: At motion time t, determine whether the seamless polyhedron model A and the seamless polyhedron model B are static or dynamic, and obtain the dynamic body and the static body at motion time t. Step S6: Obtain the surface point coordinates and corresponding motion path of the moving body at time t, calculate the motion direction of the moving body relative to the stationary body at time t, and determine the corresponding geometric transformation matrix; Step S7: Using the geometric transformation matrix at motion time t, transform the three-dimensional depth digital model of the moving body at motion time t from its own coordinate system to the coordinate system of the stationary body at motion time t, and obtain the surface point coordinates of the moving body at motion time t in the stationary coordinate system. Step S8: Determine whether the coordinates of the surface point of the moving body at time t in the static coordinate system are within the spatial range defined by the three-dimensional depth digital model of the static body at time t. If at least one surface point has coordinates within the three-dimensional depth digital model of the stationary body at time t, then a collision is determined to have occurred at time t, and the collision detection of the complex geometric model is completed; otherwise, it is considered that no collision has occurred, and the process proceeds to the next step. Step S9: Determine whether t is greater than or equal to T, where T represents the total number of motion moments. If yes, complete the collision detection of complex geometric model A and complex geometric model B. If no, take the surface point coordinates of the moving body at motion moment t in the static coordinate system as the surface point coordinates of the moving body at motion moment t+1, let t = t+1, and return to step S5.

2. The real-time collision detection method for complex geometric models according to claim 1, characterized in that, The complex geometric model A and complex geometric model B are polyhedral models, surface models or solid models in the CAD system.

3. The real-time collision detection method for complex geometric models according to claim 1, characterized in that, The specific steps for obtaining the moving body and the stationary body at motion time t in step S5 include: at motion time t, determining whether one of the seamless polyhedron model A and the seamless polyhedron model B remains stationary; if so, the seamless polyhedron model that remains stationary is taken as the stationary body, and the other seamless polyhedron model is taken as the moving body. If not, then both seamless polyhedron model A and seamless polyhedron model B are in motion. Compare the volumes of seamless polyhedron model A and seamless polyhedron model B, and designate the seamless polyhedron model with the larger volume as the static body and the seamless polyhedron model with the smaller volume as the dynamic body.

4. The real-time collision detection method for complex geometric models according to claim 1, characterized in that, The geometric transformation matrix can describe the changes in position and posture of a moving body during motion.

5. The real-time collision detection method for complex geometric models according to claim 1, characterized in that, The specific steps for obtaining the first and second three-sided depth digital models are as follows: Set the grid spacing for each coordinate plane. Based on the grid spacing, uniformly divide each coordinate plane of the seamless polyhedron model A and the seamless polyhedron model B to generate corresponding grid cells A and B. Set the starting position of the ray; In each grid cell of grid cell A, rays are emitted along a set direction and intersected with the seamless polyhedral model A. The coordinates of the intersection point of each ray with the seamless polyhedral model A and the depth value of the intersection point are recorded to obtain multiple sets of two-dimensional arrays. In each grid cell of grid cell B, rays are emitted along a set direction and intersected with the seamless polyhedral model B. The coordinates of the intersection point of each ray with the seamless polyhedral model B and the depth value of the intersection point are recorded to obtain multiple sets of two-dimensional arrays. Based on multiple sets of two-dimensional arrays, a three-dimensional depth digital model is established. Based on multiple sets of two-dimensional arrays, a three-dimensional depth digital model is established.

6. The real-time collision detection method for complex geometric models according to claim 1, characterized in that, The specific steps to obtain the coordinates of the intersection point include: Determine grid point P, and emit a ray from grid point P; Establish the equation of the coordinate plane; Based on the plane equation of the coordinate plane, obtain the intersection parameters of the ray and the coordinate plane, and determine whether the intersection parameters are ≥0. If yes, the ray intersects the coordinate plane and proceeds to the next step; otherwise, it means that the ray does not intersect the coordinate plane. The intersection point coordinates are obtained based on the intersection point parameters.

7. The real-time collision detection method for complex geometric models according to claim 6, characterized in that, The coordinates of the intersection point are expressed as: Where Q is the coordinate of the intersection point, and t' is the intersection point parameter. Let P be the ray direction vector, and let P represent the grid point coordinates.

8. The real-time collision detection method for complex geometric models according to claim 5, characterized in that, The specific steps of step S3 include: When stationary, on any coordinate plane, determine whether the depth value of the intersection point of the three-sided depth digital model one and the depth value of the intersection point of the three-sided depth digital model two satisfy the intersection condition; if they satisfy the condition, the coordinate planes are considered to have an intersection; if they do not satisfy the condition, the coordinate planes do not have an intersection. Traverse each coordinate plane at the initial moment. If at least one coordinate plane has no intersection, it means that no collision has occurred, and proceed to the next step. If all coordinate planes at the initial moment satisfy the intersection condition, then a collision is determined to have occurred, thus completing the collision detection for the complex geometric model.