Collision detection method, device, storage medium and program product

By constructing pseudo-distance and potential energy functions and combining them with separation criteria, the problem of low efficiency in convex collision detection in existing technologies is solved, achieving efficient and accurate collision detection, especially for non-smooth or non-strictly convex objects.

CN122241788APending Publication Date: 2026-06-19ACAD OF MATHEMATICS & SYSTEMS SCIENCE - CHINESE ACAD OF SCI

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ACAD OF MATHEMATICS & SYSTEMS SCIENCE - CHINESE ACAD OF SCI
Filing Date
2026-03-12
Publication Date
2026-06-19

AI Technical Summary

Technical Problem

In the existing technology, convex body collision detection methods have high memory requirements and low computational efficiency. They are particularly difficult to accurately determine collisions when dealing with non-smooth or non-strictly convex objects. Furthermore, existing methods still require complete iterative calculations in the separated state, resulting in unnecessary computational overhead.

Method used

A pseudo-distance function and potential energy function construction method is adopted. By constructing pseudo-distance functions and potential energy functions, the separation judgment condition is used to determine whether the object is separated, avoiding complete iterative calculation and quickly determining the collision or separation state.

Benefits of technology

It improves the efficiency and accuracy of collision detection, reduces memory requirements, enables fast processing of collision detection for objects with complex shapes, and reduces computational complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122241788A_ABST
    Figure CN122241788A_ABST
Patent Text Reader

Abstract

This disclosure provides a collision detection method, device, storage medium, and program product, relating to the field of collision detection technology. The method includes: constructing a first pseudo-distance function for a first object and a second pseudo-distance function for a second object; based on the first and second pseudo-distance functions, constructing a potential energy function to characterize the spatial relationship between the first and second objects; before the iteration point converges to the minimum point of the potential energy function, determining whether the first and second objects are in a separated state using a separation determination condition, and obtaining a detection result indicating no collision between the first and second objects when the separation determination is made; if the iteration point converges to the minimum point and the separation determination condition is not triggered, determining whether the first and second objects collide using the minimum value of the potential energy function. The method provided by this disclosure can improve collision detection efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure belongs to the field of collision detection technology, specifically relating to a collision detection method, electronic device, computer-readable storage medium, and computer program product. Background Technology

[0002] Collision detection is a fundamental problem in computational geometry and physics simulations, used to determine whether two or more objects share the same spatial region at a given time, or whether their surfaces are in contact within tolerance. Convex body collision detection methods in related technologies typically employ discretization methods, specifically for polyhedral objects. Polyhedral-oriented collision detection algorithms rely on discretized approximations of the object. This method treats a smooth object, such as a sphere, as a series of small triangles (polyhedra). When the convex body itself has curved boundaries, achieving high accuracy in representing the object using polyhedra requires a large number of vertices. However, a large number of vertices increases the algorithm's memory requirements and negatively impacts computational efficiency. Summary of the Invention

[0003] The purpose of this disclosure is to provide a collision detection method, electronic device, computer-readable storage medium, and computer program product that can improve the efficiency of collision detection.

[0004] This disclosure provides a collision detection method, comprising: constructing a first pseudo-distance function for a first object and a second pseudo-distance function for a second object; constructing a potential energy function to characterize the spatial relationship between the first object and the second object based on the first pseudo-distance function and the second pseudo-distance function; determining whether the first object and the second object are in a separated state using a separation determination condition before the iteration point converges to the minimum point of the potential energy function, and obtaining a detection result that the first object and the second object do not collide when the separation determination is made; if the iteration point converges to the minimum point and the separation determination condition is not triggered, determining whether the first object and the second object collide using the minimum value of the potential energy function.

[0005] In some exemplary embodiments of this disclosure, the potential energy function is obtained by performing a power operation greater than or equal to 2 on the first pseudo-distance function and the second pseudo-distance function respectively, and then performing a positive linear combination.

[0006] In some exemplary embodiments of this disclosure, when the implicit function satisfies the homogeneity condition: if the object is enclosed by an implicit surface, a line is drawn from the center point of the object to the iteration point, and the isolation plane of the corresponding object is determined based on the intersection of the line and the surface of the object and the gradient direction of the pseudo-distance function at the iteration point; if the object is enclosed by multiple implicit surfaces, a hyperplane is constructed for each implicit surface of the object, and the support points in the gradient direction of the corresponding pseudo-distance function in the region enclosed by the hyperplanes corresponding to all implicit surfaces of the object are obtained to obtain the base point of the isolation plane of the object, and the isolation plane of the object is determined based on the base point and the gradient direction of the corresponding pseudo-distance function at the iteration point.

[0007] In some exemplary embodiments of this disclosure, constructing a first pseudo-distance function for a first object and a second pseudo-distance function for a second object includes: determining implicit functions for the first object and the second object; determining a convex function whose each component is monotonically increasing; combining the implicit function of the first object and the convex function to obtain the first pseudo-distance function; and combining the second object and the convex function to obtain the second pseudo-distance function.

[0008] In some exemplary embodiments of this disclosure, both the first object and the second object are convex bodies.

[0009] In some exemplary embodiments of this disclosure, the convexity is represented by a region enclosed by one or more implicit functions.

[0010] In some exemplary embodiments of this disclosure, the convexity includes cases where it is not strictly convex and / or has unsmooth boundaries.

[0011] In some exemplary embodiments of this disclosure, the method is applied to collision detection in robot motion planning, computer-aided design, or virtual simulation systems.

[0012] This disclosure provides a collision detection device, comprising: a processing unit configured to construct a first pseudo-distance function for a first object and a second pseudo-distance function for a second object; the processing unit is further configured to construct a potential energy function characterizing the spatial relationship between the first object and the second object based on the first pseudo-distance function and the second pseudo-distance function; a detection unit configured to determine whether the first object and the second object are in a separated state using a separation determination condition before the iteration point converges to the minimum point of the potential energy function, and to obtain a detection result indicating that the first object and the second object do not collide when the separation determination condition is determined to be in the separated state; the detection unit is further configured to determine whether the first object and the second object collide by using the minimum value of the potential energy function if the iteration point converges to the minimum point and the separation determination condition is not triggered.

[0013] This disclosure provides an electronic device including a processor, a memory, and an input / output interface; the processor is connected to the memory and the input / output interface respectively, wherein the input / output interface is used to receive data and output data, the memory is used to store a computer program, and the processor is used to call the computer program so that the electronic device executes the method described in any embodiment of this disclosure.

[0014] This disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, is used to implement the methods described in any embodiment of this disclosure.

[0015] This disclosure provides a computer program product, including a computer program, characterized in that the computer program, when executed by a processor, implements the methods described in any embodiment of this disclosure.

[0016] The collision detection method, collision detection device, electronic device, computer-readable storage medium, and computer program product provided in this disclosure, on the one hand, replace the expensive precise distance with a quickly estimated pseudo-distance, making the calculation highly efficient; on the other hand, through the separation and judgment mechanism, the calculation can be terminated in advance during the iteration process, quickly eliminating a large number of non-collision cases, further improving the overall efficiency. Attached Figure Description

[0017] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.

[0018] Figure 1 This diagram illustrates an application system architecture according to an embodiment of the present disclosure.

[0019] Figure 2 A flowchart of a collision detection method according to an embodiment of this disclosure is shown.

[0020] Figure 3 A flowchart illustrating a collision detection method based on implicit surface modeling is shown in an embodiment of this disclosure.

[0021] Figure 4 A schematic diagram of the construction of the isolation plane is shown in an embodiment of this disclosure.

[0022] Figure 5 A schematic diagram showing the separation determination conditions based on the isolation plane in an embodiment of this disclosure is shown.

[0023] Figure 6 A schematic diagram of a test sample is shown in an embodiment of this disclosure.

[0024] Figure 7 This diagram illustrates a collision detection of a test sample in an embodiment of the present disclosure.

[0025] Figure 8 This diagram illustrates the collision detection results and time statistics in an embodiment of the present disclosure.

[0026] Figure 9 A structural block diagram of a collision detection device according to an embodiment of the present disclosure is shown.

[0027] Figure 10 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation

[0028] The exemplary embodiments will now be described with reference to the accompanying drawings. The examples can be implemented in many forms and are not limited to the paradigms set forth herein; rather, these methods are provided to fully convey the implementation ideas to those skilled in the art, thereby making this disclosure more comprehensive and complete. The described features or structures can be combined in any suitable manner in any implementation.

[0029] Furthermore, some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0030] The specific implementation methods of the embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.

[0031] Figure 1 A schematic diagram of an exemplary application system architecture to which the collision detection method of this disclosure can be applied is shown. Figure 1 As shown, the system architecture may include terminal device 101, network 102 and server 103.

[0032] Network 102 is a medium used to provide a communication link between terminal device 101 and server 103, and can be a wired network or a wireless network.

[0033] Optionally, the aforementioned wireless or wired networks use standard communication technologies and / or protocols. The network is typically the Internet, but can also be any network, including but not limited to Local Area Networks (LANs), Metropolitan Area Networks (MANs), Wide Area Networks (WANs), mobile, wired or wireless networks, private networks, or any combination of virtual private networks. In some embodiments, technologies and / or formats, including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), etc., are used to represent data exchanged over the network. Furthermore, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Networks (VPNs), and Internet Protocol Security (IPSec) can be used to encrypt all or some links. In other implementation examples, custom and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.

[0034] Terminal device 101 can be various electronic devices, including but not limited to smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, wearable devices, augmented reality devices, virtual reality devices, etc.

[0035] Server 103 can be a server that provides various services, such as a backend management server that supports the device operated by the user using terminal device 101. The backend management server can analyze and process received requests and other data, and feed the processing results back to the terminal device.

[0036] Optionally, the server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.

[0037] Those skilled in the art will know that Figure 1The number of terminal devices, networks, and servers shown is merely illustrative; any number of terminal devices, networks, and servers can be included depending on actual needs. This disclosure does not limit the scope of the embodiments.

[0038] Under the above system architecture, this disclosure provides a collision detection method (exemplarily, the method provided in this disclosure is a collision detection method for objects modeled by implicit surfaces, or a collision detection method based on convex optimization and separation judgment conditions, or a collision detection method applicable to convex bodies represented by implicit surfaces), which can be executed by any electronic device with computing power.

[0039] In some embodiments, the collision detection method provided in this disclosure can be executed by a terminal device in the above-described system architecture; in other embodiments, the collision detection method provided in this disclosure can be executed by a server in the above-described system architecture; in still other embodiments, the collision detection method provided in this disclosure can be implemented by the terminal device and the server in the above-described system architecture through interaction.

[0040] The collision detection method provided in this disclosure can be widely applied in many important scenarios such as robot systems, computer-aided design (CAD) systems, and virtual simulation systems. In research on robot path planning problems, collision detection between robots and obstacles is fundamental to guiding robot obstacle avoidance. For example, in a factory, preventing a robot's arm from colliding with a nearby box. In computer simulations and games, systems must be able to effectively use collision detection algorithms to identify contact between objects and make reasonable responses to reflect motion patterns in the real physical environment. For example, in a game, preventing a character from passing through a wall. In CAD design, determining whether parts of a new mobile phone will be squeezed together and unable to fit. Collision detection for protrusions is one of the core fundamental functions of these systems, and its efficiency and reliability directly affect the overall system performance. That is, the computer can quickly and accurately determine whether two objects have collided.

[0041] The collision detection method provided in this disclosure can be applied to collision detection of convex bodies, that is, when the object to be detected is a convex body or a combination of multiple convex bodies. An object is considered a convex body if the line connecting any two points on its surface lies inside the object. Examples include a basketball, an egg, and a box. Real-world objects come in various shapes, but many complex objects can be broken down into many small convex bodies for analysis.

[0042] The convex collision detection method provided in this disclosure employs a continuous approach, accurately describing smooth objects using mathematical formulas without discretization, and is suitable for objects modeled by implicit or parametric surfaces. For example, it can accurately describe a sphere or curved surface using formulas.

[0043] Collision detection algorithms for objects modeled by implicit or parametric surfaces do not require discretization approximation of the object and are theoretically very accurate because they describe the true shape of the object itself without approximation error. In some embodiments, they are based on common normals. A common normal is a line drawn between two points on the surfaces of two objects that is perpendicular to both surfaces. This line represents the shortest distance between the two objects when they are closest to each other or have just come into contact. This line needs to be found before determining a collision. A major limitation of this type of method is its difficulty in handling non-smooth or non-strictly convex objects and the need for a good initial guess to ensure that the algorithm converges iteratively to the correct solution. If the initial guess is unreasonable, it will affect the correctness and robustness of the algorithm. If the object surface is not smooth enough (e.g., has a sharp corner) or the object is not strictly convex (e.g., a dumbbell shape), this common normal is difficult to find and may not even exist. Furthermore, this type of algorithm typically uses an iterative approximation method to find this shortest distance, that is, starting from an initial guess point and searching step by step to the correct position. If the initially guessed point is too far from the correct location, the algorithm may go astray and find an incorrect point, leading to a collision detection error.

[0044] In other embodiments, collision detection can be achieved by using the interior point method to solve for the Euclidean distance between objects whose boundaries are composed of multiple implicit surface segments. That is, the shortest distance between two objects is measured using Euclidean distance. If the distance is greater than 0, the two objects are considered not to have collided; if the distance is equal to 0, they collide; if the distance is less than 0 (i.e., the objects intersect), the two objects are considered to have collided. However, the cost of calculating the Euclidean distance between objects is often much higher than the Boolean result of determining whether a collision exists, resulting in unnecessary computation in collision detection applications. This precise measurement process is computationally very expensive. Often, it is only necessary to know whether a "collision" or "no collision" has occurred (a yes / no Boolean result), without caring about the specific distance between the two objects. Performing complex mathematical calculations to obtain a yes / no Boolean result wastes computational resources.

[0045] In some embodiments, a pseudo-distance function-based method is proposed for collision detection between convex bodies represented by multiple implicit surfaces. This method may be fast when handling cases where two objects have already collided. However, in actual computation, this method still requires numerical iteration to find the minimum value of the function. When the two convex bodies are separated, a complete iterative process must be performed, resulting in unnecessary computational overhead. That is, even when two objects are clearly far apart (separated), a complete and complex computational process (numerical iteration) is still required until it is determined that they are indeed separated. In most scenarios, such as open environments, where objects do not collide most of the time, this results in significant unnecessary computational overhead.

[0046] For example, the collision detection method provided in this disclosure can describe objects using implicit surfaces to ensure high accuracy, simplify calculations and improve computing speed, and maintain high efficiency when dealing with various complex situations and states (whether collision or separation).

[0047] like Figure 2 As shown, the method provided in this embodiment includes the following steps.

[0048] In S210, a first pseudo-distance function for the first object and a second pseudo-distance function for the second object are constructed.

[0049] For example, both the first object and the second object are convex bodies.

[0050] For example, the convexity is represented by a region enclosed by one or more implicit functions.

[0051] For example, the convexity includes cases where it is not strictly convex or has an unsmooth boundary.

[0052] For example, both the first pseudo-distance function and the second pseudo-distance function satisfy: The value is non-negative at any point in space, and for any point in space, the point is determined to be inside the corresponding object if and only if the corresponding pseudo-distance function takes zero at that point; It is convex with respect to a point in space.

[0053] For example, both the first pseudo-distance function and the second pseudo-distance function also satisfy: Its square function is differentiable with respect to points in space.

[0054] For example, constructing a first pseudo-distance function for a first object and a second pseudo-distance function for a second object includes: determining implicit functions for the first object and the second object; determining a convex function whose each component is monotonically increasing; combining the implicit function of the first object and the convex function to obtain the first pseudo-distance function; and combining the second object and the convex function to obtain the second pseudo-distance function.

[0055] In S220, a potential energy function is constructed to characterize the spatial relationship between the first object and the second object, based on the first pseudo-distance function and the second pseudo-distance function.

[0056] For example, the potential energy function satisfies: Its value is non-negative; The potential energy function is zero if and only if there is a collision between the first object and the second object; Its global differential is convex downwards.

[0057] For example, the potential energy function also satisfies: It is defined in a fully Euclidean space with the same dimension as the space containing the first object and the second object.

[0058] For example, the potential energy function is constructed by performing a power operation greater than or equal to 2 on the first pseudo-distance function and the second pseudo-distance function respectively, and then performing a positive linear combination.

[0059] In S230, before the iteration point converges to the minimum point of the potential energy function, the separation determination condition is used to determine whether the first object and the second object are in a separated state, and when it is determined that they are in the separated state, the detection result that the first object and the second object have no collision is obtained.

[0060] For example, determining whether the first object and the second object are in a separated state using separation determination conditions includes: constructing a first isolation plane for the first object and a second isolation plane for the second object; and determining whether the first object and the second object are in a separated state based on the geometric relationship between the first isolation plane and the second isolation plane and the first object and the second object.

[0061] In this disclosure, the isolation plane (including the first and second isolation planes) refers to the isolation plane at the iteration point. For a convex body represented by an implicit surface, a plane or hyperplane satisfies the following two conditions: 1) Parallel normal vectors: The normal vector of the hyperplane and the corresponding pseudo-distance function are parallel at the iteration point. The gradient at that point is parallel.

[0062] 2) Separability: The hyperplane separates the entire convex body and the iteration point. Separated on both sides (i.e., the convex body is entirely on one side of the plane, iteration point) On the other side).

[0063] The isolation plane in this embodiment can also be called a pseudo-supporting hyperplane. Here, "pseudo" can also mean "quasi-" or "similar," meaning it is not standard. In convex geometry, a standard supporting hyperplane for a convex body requires that it contact the convex body (tangent to a point or surface of the convexity). The isolation plane does not require that it necessarily contact the convex body. It only requires that it can connect the convex body to the current iteration point. Separately, the plane itself may still be some distance from the convex body. Meanwhile, from the current iteration point... The gradient is determined by local information, not directly by the surface of the convex body. Furthermore, it depends on the current iteration point. Location, The isolation plane changes during movement. Specifically, in this embodiment, the isolation plane is constructed based on the gradient of the current iteration point and separates the convex body from the current iteration point. It mimics the separating function of a standard supporting hyperplane, but does not strictly require contact, and its construction depends on the current iteration point rather than the object itself. Therefore, the isolation plane can also be called an isolation hyperplane. Based on the geometric relationship between the first and second isolation hyperplanes, it is determined whether the first and second convex bodies are in a separated state.

[0064] It should be noted that the iteration point will generally move closer to the region between the two objects. For one of the objects, the iteration point may be closer or farther away, and after convergence, the iteration point may also be far away from both objects. At the same time, the distance of the iteration point from the object generally does not affect the calculation of the actual supporting hyperplane.

[0065] This embodiment employs an isolation plane. Since it relies only on the local gradient information of the current iteration point and does not require precise calculation of the support points on the object's surface, it has low computational cost and high efficiency. It can quickly construct an isolation plane to attempt separation, making it suitable for iterative processes. Furthermore, for complex convex bodies (such as polyhedra) composed of multiple curved surfaces, the true supporting hyperplane may involve edges and vertices, leading to computational complexity. However, the isolation plane, by integrating information from various surfaces using methods such as linear programming, can still construct an effective isolation plane.

[0066] For example, both the first isolation plane and the second isolation plane satisfy: Its normal vector is parallel to the gradient of the corresponding pseudo-distance function at the corresponding iteration point; The corresponding object and the iteration point are separated on both sides.

[0067] In this embodiment of the disclosure, a first isolation plane is constructed for the first convex body, and the normal vector of the first isolation plane and the first pseudo-distance function of the first convex body are at the current iteration point. The gradient direction at the point is parallel, and the first isolation plane connects the first convexity to the current iteration point. Separated on both sides. Construct a second isolation plane for the second convex body, where the normal vector of the second isolation plane intersects with the second pseudo-distance function of the second convex body at the current iteration point. The gradient direction at that point is parallel, and the second isolation plane connects the second convexity to the current iteration point. Separated on both sides.

[0068] For example, the first isolation plane and the first protrusion may or may not have a common contact point. The second isolation plane and the second protrusion may or may not have a common contact point.

[0069] For example, the positions of the first isolation plane and the second isolation plane are determined by the current iteration point. The decision is made and changes dynamically as the current iteration point is updated.

[0070] For example, when the first convex body is enclosed by multiple implicit surfaces, candidate hyperplanes are constructed for each implicit surface. Through linear programming, the point located within the region enclosed by all candidate hyperplanes and closest to the current iteration point along the negative gradient direction of the first pseudo-distance function is found and used as the base point of the first isolation plane. When the second convex body is enclosed by multiple implicit surfaces, candidate hyperplanes are constructed for each implicit surface. Through linear programming, the point located within the region enclosed by all candidate hyperplanes and closest to the current iteration point along the negative gradient direction of the second pseudo-distance function is found and used as the base point of the second isolation plane.

[0071] For example, constructing a first isolation plane for the first object and a second isolation plane for the second object includes: calculating the gradient of the corresponding pseudo-distance function at the iteration point in the process of solving the minimum value of the potential energy function; and determining the corresponding isolation plane based on the gradient of the corresponding pseudo-distance function and the implicit function of the corresponding object.

[0072] For example, when the implicit function satisfies the homogeneity condition: if the object is enclosed by a single implicit surface, then a line is drawn from the center point of the object to the iteration point, and the isolation plane of the corresponding object is determined based on the intersection of the line with the surface of the object and the gradient direction of the pseudo-distance function at the iteration point; if the object is enclosed by multiple implicit surfaces, then a hyperplane is constructed for each implicit surface of the object, and the support points in the gradient direction of the corresponding pseudo-distance function in the region enclosed by the hyperplanes corresponding to all implicit surfaces of the object are obtained to obtain the base point of the isolation plane of the object, and the isolation plane of the object is determined based on the base point and the gradient direction of the corresponding pseudo-distance function at the iteration point.

[0073] For example, determining whether the first object and the second object are in a separated state based on the geometric relationship between the first isolation plane and the second isolation plane and the first object and the second object includes: determining the intersection line of the first isolation plane and the second isolation plane; taking a point on the intersection line and constructing a first orthogonal plane perpendicular to the first isolation plane and a second orthogonal plane perpendicular to the second isolation plane; obtaining a first quarter-space region enclosed by the first isolation plane and the first orthogonal plane, and a second quarter-space region enclosed by the second isolation plane and the second orthogonal plane; determining whether the first object is within the first quarter-space region, whether the second object is within the second quarter-space region, and whether the first quarter-space region and the second quarter-space region overlap, to determine whether the first object and the second object are in a separated state.

[0074] In S240, if the iteration point converges to the minimum point and the separation determination condition is not triggered, then the minimum value of the potential energy function is used to determine whether the first object and the second object collide.

[0075] For example, the method is applied to collision detection in robot motion planning, computer-aided design, or virtual simulation systems.

[0076] This disclosure uses a rapidly estimated distance (pseudo-distance) instead of precise measurement (e.g., Euclidean distance). This estimated value can correctly determine whether a point is inside or outside the convex object to be detected. The collision problem of two convex objects is transformed into a mathematical "minimum finding" problem through a potential energy function. If the minimum value is 0, it means the two convex objects have collided; if the minimum value is greater than 0, it means the two convex objects have not collided. In the process of finding the minimum value, this disclosure introduces a rapid separation determination mechanism, which can draw conclusions in advance, saving a significant amount of time.

[0077] For example, based on the collision detection method based on the pseudo-distance function, a new separation judgment mechanism / condition is introduced, which enables the separation state between convex bodies to be identified before the iteration convergence during the calculation of the minimum value of the potential energy function. This allows the detection result to be given directly without completing the full iterative calculation, thereby saving computation and improving the overall collision detection efficiency.

[0078] For example, embodiments of this disclosure provide a collision detection method between protrusions that can simultaneously satisfy the following requirements: (1) A convex body is represented by one or more implicit surfaces / implicit functions; (2) It can effectively handle non-strictly convex and non-smooth objects, that is, the first object and / or the second object can be non-strictly convex and / or non-smooth objects; (3) The algorithm can converge and obtain the correct result under any initial value guess (i.e., the initial point of iteration can be set arbitrarily in this embodiment of the disclosure); (4) Avoid solving for Euclidean distance to achieve efficient collision detection.

[0079] Based on such requirements, this disclosure constructs a pseudo-distance function for implicit convex bodies (i.e., convex bodies represented by implicit functions), and determines whether two convex bodies collide by using the extreme value of the potential energy function and the separation judgment condition, thereby achieving efficient and stable collision detection for convex bodies represented by implicit surfaces.

[0080] For a convex body represented by one or more implicit surfaces, a corresponding pseudo-distance function is constructed. While the Euclidean distance between any point in space and the convex body can be calculated, and thus an Euclidean distance function corresponding to the convex body can be defined, the computational cost of the Euclidean distance function is high for general convex bodies represented by implicit functions. Therefore, embodiments of this disclosure may use the described pseudo-distance as an alternative to the Euclidean distance. This pseudo-distance may not be an Euclidean distance, but it retains some key properties of the Euclidean distance.

[0081] For example, when constructing a pseudo-distance function, it needs to satisfy the same internal and external properties as the Euclidean distance function, have lower convexity, and have differentiability of its squared function. Furthermore, compared to the Euclidean distance function, the function value, gradient, and Hessian matrix of this pseudo-distance function have lower computational cost.

[0082] For example, the pseudo-distance function in this disclosure embodiment does not require numerical precision, but satisfies the following two requirements: The pseudo-distance function differs depending on whether a point is inside or outside the object: if a point is inside the object, the function value is less than 0; if a point is outside the object, the function value is greater than 0; and if a point is on the surface of the object, the function value is equal to 0. This is consistent with the results obtained using Euclidean distance. The shape is convex: the graph of this function is "bowl-shaped", which ensures that the subsequent process of finding the minimum value will not fall into local traps and guarantees that the global minimum value can be found.

[0083] In one exemplary embodiment, for a convex body represented by an implicit surface, its corresponding pseudo-distance function can be constructed by the following method: Selecting a convex function. Make it monotonically increasing with respect to each of its components and differentiable over the region where all components are greater than 0, and represent the implicit function of the convex surface. and Combining the components yields a single pseudo-distance function that satisfies the requirements of internal / external separation and convexity. Pseudo-distance function The calculation is much faster than Euclidean distance and can correctly determine the positional relationship (inside / outside) of a point relative to the object.

[0084] For example, based on the pseudo-distance function corresponding to two convex bodies, a fully Euclidean space with the same dimension N as the space containing the convex bodies (N is an integer greater than or equal to 1; for example, when N=3, the two objects are solids in three-dimensional space; when N=2, the two objects are figures on a two-dimensional plane) is constructed. We construct a potential energy function to characterize the spatial relationship between two convex bodies, ensuring its value is non-negative and globally convex, and that its minimum value is zero if and only if a collision exists between the two convex bodies. This minimum value can be stably and efficiently calculated using an iteratively optimized numerical method, and by checking if the minimum value is 0, we can directly determine whether a collision exists between the two objects. That is, if the two convex bodies overlap (collide), the value of the potential energy function is 0 or close to 0; if the two convex bodies are separated, the value of the potential energy function is greater than 0.

[0085] In one exemplary embodiment, for two convex bodies in space, the potential energy function can be constructed by exponentiation of the pseudo-distance functions corresponding to the two convex bodies to the power of 2 or higher, followed by a positive linear combination. That is, the potential energy function can be obtained by squaring (or raising to the power of higher) the pseudo-distance functions of the two objects respectively, multiplying them by a positive number, and then adding them together. This ensures good mathematical properties and allows for adaptation to different needs by adjusting the weights.

[0086] For example, in the process of solving the minimum value of the potential energy function using the iterative optimization numerical calculation method, a separation judgment condition can be introduced so that when two convex bodies do not collide, a collision-free result can be given before the iteration point converges to the minimum point, thereby terminating the iterative calculation process in advance and improving the efficiency of the method.

[0087] In this embodiment, it can be started from any point on the potential energy function (initial iteration point or iteration initial point). It starts by moving along the decreasing direction of the potential energy function, gradually approaching the minimum point. Each step leads to a new point, called the current iteration point. In related technologies, the algorithm must slide to a minimum point and confirm whether it is 0 before determining whether two objects have collided. However, the method provided in this disclosure introduces a separation determination condition, which can determine that the two objects have definitely not collided before reaching the minimum point, and then directly stop the calculation.

[0088] For example, the separation determination condition is achieved by constructing an isolation plane corresponding to the convex body.

[0089] For example, the steps of constructing the isolation plane include: (1) Calculate the gradient of the corresponding pseudo-distance function at the current iteration point in the process of solving the minimum value of the potential energy function.

[0090] For example, at the current iteration point ( ), calculate the gradient of the first pseudo-distance function of the first object A. The gradient direction is the direction starting from this point. The direction in which the value increases the fastest. For convex bodies, this direction generally points away from the object.

[0091] (2) Based on the gradient direction of the pseudo-distance function and the implicit representation / function of the corresponding convex body, estimate a hyperplane that separates the iteration point from the convex body as an isolation plane. The normal of the isolation plane is parallel to the gradient direction of the corresponding pseudo-distance function.

[0092] For example, with Construct a plane with the normal direction as its orientation. Position this plane such that it can represent the current iteration point. Separated from the first object A. This plane is the first isolation plane for the first object A at the current iteration point. The isolation plane is a line in two dimensions and a surface in three dimensions. That is, the first object A is on one side of the first isolation plane, while the current iteration point... On the other side of the first isolation plane.

[0093] In one exemplary embodiment, the isolation plane can be constructed more efficiently and robustly when the function corresponding to the implicit surface (i.e., the implicit function) satisfies the homogeneity condition (e.g., the object is a sphere, ellipsoid, etc.). An exemplary construction method is described below.

[0094] If a convex body is bounded by an implicit surface, then by utilizing the homogeneity of implicit functions, it is possible to directly move from the center point O of the object to the iteration point. Connect the line to the intersection of the line and the object's surface (implicit surface). It could be the location where the isolation plane is constructed, based on the intersection point. Its pseudo-distance function at the iteration point The gradient direction at a given location can determine the isolation plane of the corresponding object.

[0095] If a convex body is formed by multiple implicit surfaces, then for each implicit surface, the isolation plane of each surface is constructed using the method described above for single-surface surfaces. Then, the support points along the gradient direction of the pseudo-distance function in the region enclosed by the isolation planes corresponding to all implicit surfaces are solved using linear programming to obtain the base points of the isolation planes of the convex body. Based on this point With the pseudo-distance function at the iteration point The gradient direction at a given point can determine the final isolation plane of the convexity.

[0096] For example, if an object / convex body (which could be a first object or a second object) is composed of multiple implicit surfaces Enclosed, First, for each implicit surface... The isolation plane is constructed using a single-surface surface method. For example, for the first face of the object, based on the current iteration point... The location allows you to find a point on this surface. and the normal to the side of this face pointing to the iteration point. For the second face, find a point on the second face. and the normal to the side of this face pointing to the iteration point. And so on, to find a point on the m-th face. and the normal to the side of this face pointing to the iteration point. That is, obtain m ( , (), , ), ..., ( , Then, the final location is found through linear programming, i.e., the support points are solved. That is, to find a unique and most suitable point from m candidate isolation planes. This will serve as the base point for the isolation plane of the convex body. For the first candidate ( , It defines a half-space: all spaces satisfying point This half-space contains the convexity (because it is at the level of...). (Inside the tangent plane of the support point). Similarly, for each candidate ( , Each of these defines a half-space containing the convex polyhedron. These half-spaces intersect and overlap, forming a common region. This region can be a convex polyhedron (potentially unbounded), but the entire convex polyhedron must be contained within this region. At the current iteration point (here, let's call it...), (For example, to illustrate) Calculate the gradient of the pseudo-distance function Its negative direction - It points to the interior of the convex body. Within this common area enclosed by all candidate half-spaces, along - This direction, starting from the beginning Start by walking into the interior of the convex body until you reach this area. The goal is to find the nearest point within the region along this direction. This nearest point is a point on the boundary, called a support point. In other words, it involves solving a linear programming problem, specifically finding the maximum objective function under the constraints of not being able to leave the region bounded by all candidate half-spaces in the gradient direction, or not encountering (entering) the region bounded by all candidate half-spaces in the negative gradient direction. The solution to this linear programming problem... That is the base point we are looking for. Then, we still take the gradient direction at the iteration point. (Or its unit vector) is used as the normal. The final isolation plane of the convex body is determined by this. That is, passing the point And perpendicular to the gradient direction The plane.

[0097] At each iteration point in the process of solving for the minimum value of the potential energy function using iterative optimization numerical calculation methods, separation determination can be achieved using an isolation plane.

[0098] In one exemplary embodiment, after obtaining the respective isolation planes of the two objects, the separation determination condition can be achieved by performing spatial reasoning to determine whether they are separated: (1) Find the intersection of the two isolated planes.

[0099] First, find the line of intersection between the first isolation plane of the first object A and the second isolation plane of the second object B.

[0100] (2) Calculate the orthogonal planes corresponding to the two isolation planes at the intersection line to obtain two quarter-space regions enclosed by the isolation planes and the corresponding orthogonal planes.

[0101] Take a point on the line of intersection, and construct a first orthogonal plane perpendicular to the first isolation plane and a second orthogonal plane perpendicular to the second isolation plane. Thus, for the first object, a first quarter-space region is obtained, bounded by the first isolation plane and the first orthogonal plane. For the second object, a second quarter-space region is obtained, bounded by the second isolation plane and the second orthogonal plane.

[0102] (3) Determine whether the two convex bodies are respectively contained in their respective quarter-space regions and that there is no intersection between the two quarter-space regions. If the conditions are met (i.e., the two convex bodies are respectively contained in their respective quarter-space regions and there is no intersection between the two quarter-space regions), it can be determined that there is no collision between the two convex bodies; if the conditions are not met, continue to check in a loop.

[0103] determination: Check 1: Is the first object truly entirely within the first quarter space region? Is the second object truly entirely within the second quarter space region? Check 2: Does the first quarter space region overlap with the second quarter space region? If check 1 is true and check 2 is false (i.e., the two quarter-space regions have no overlap), then it can be determined that there is no collision between the first and second objects, because they each reside in two non-overlapping spatial regions. Once the above conditions are met at some iteration point, the algorithm can stop immediately and output the collision-free result without needing to continue searching for the minimum value of the potential energy function.

[0104] By using the above separation criteria, a large number of cases where no collisions have occurred can be quickly eliminated before the iterative optimization process converges.

[0105] An object is convex because any line segment connecting any two points within that object lies entirely inside the object. Non-strict convexity, on the other hand, refers to the presence of flat regions on the object's surface. In contrast, a strictly convex surface is curved, and no straight lines can be found on it. On a non-strictly convex surface, there are straight line segments that lie entirely within the flat regions. For example, spheres and ellipsoids are strictly convex, while planes, cylinders, and cones are non-strictly convex.

[0106] Non-smooth surfaces refer to objects with sharp points or edges where the direction of the object's normal (i.e., the direction perpendicular to the surface) changes abruptly, and the derivative does not exist. In contrast, smooth surfaces are perfectly fluid, and a tangent plane and normal can be uniquely determined at every point. Non-smooth objects, such as the edges and vertices of a cube, the apex of a cone, or the seam where two curved surfaces meet, while having smooth surfaces, exhibit abrupt changes in the direction of the normal at their edges, changing from perpendicular to one surface to perpendicular to another – this is an abrupt change point. At vertices, the normal cannot be defined because there are infinitely many possible tangent planes.

[0107] When dealing with non-smooth objects (such as the edges and vertices of a cube), the normal vectors on the edges are not unique, making it impossible to directly determine a tangent plane. However, the embodiments disclosed herein rely on the current point... Rather than the surface of the object. In the case of multiple curved surfaces, the embodiments of this disclosure use linear programming to synthesize the information of each surface and find a unique and reasonable hyperplane as its isolation plane, thereby avoiding the direct processing of rough edges.

[0108] When dealing with non-strictly convex objects (such as the plane of a cylinder), many points on the plane of the cylinder have the same normal direction. This can lead to limited information in some decisions. In the embodiments of this disclosure, for convex bodies (whether strictly convex or non-strictly convex), its pseudo-distance function... It can be constructed as a convex function. The potential energy function is formed by the sum of squares of convex functions. It remains a convex function. Convex optimization guarantees convergence to the global minimum from any point. For a flat surface, the isolation plane is the surface itself. The separation determination in this embodiment is based on the geometric relationship between these hyperplanes and the current point; it does not require the object surface to be curved. Even if the object's boundary contains a plane, as long as two isolation planes can separate the space, collision-free determination can still be made in advance.

[0109] The method provided in this disclosure can effectively handle non-strictly convex and non-smooth objects because it does not depend on the local smoothness of the object's surface. This disclosure transforms the problem into a convex optimization problem by constructing a potential energy function and utilizes gradient information at iteration points (which is well-defined at the iteration points) to construct isolation planes, thereby bypassing the difficulties caused by the non-smoothness or non-strict convexity of the object's surface itself. For complex cases enclosed by multiple curved surfaces, linear programming methods can be synthesized and coordinated to obtain a unique and reliable solution.

[0110] The method provided in this disclosure can handle various convex bodies composed of complex curved surfaces, and has wide applicability; it replaces the expensive precise distance with a fast-estimated pseudo-distance, making the computation highly efficient; based on convex optimization, it ensures that the correct result can be found from any initial iteration point, thus improving reliability; through the separation and judgment mechanism, the calculation can be terminated in advance during the iteration process, quickly eliminating a large number of collision-free cases, further improving the overall efficiency.

[0111] In this embodiment, convex optimization refers to finding a minimum value on a potential energy function that is convex. In the collision detection method provided in this embodiment, the potential energy function is constructed as a globally convex function, ensuring that regardless of the initial iteration point, the subsequent optimization process consistently searches for a unique minimum value, thus improving stability. Furthermore, once this minimum value is found, it is the true global minimum, thereby improving accuracy. Subsequent checks on whether this minimum value is 0 are sufficient to accurately determine whether two objects collide, avoiding erroneous results due to an unfavorable iteration starting point, such as misjudging a collision as non-collision when it actually occurs.

[0112] This disclosure provides a method for arbitrary-dimensional Euclidean space. A collision detection method between convex bodies, wherein the convex body is represented by a region enclosed by one or more implicit functions / implicit surfaces, including cases where it is not strictly convex or has non-smooth boundaries. The collision detection method provided in this disclosure includes the following steps: (1) Construct the corresponding pseudo-distance function for the two convex bodies to be detected.

[0113] (2) Based on the pseudo-distance function, construct a potential energy function to characterize the spatial relationship between two convex bodies, and transform the collision detection problem into an unconstrained global optimization problem of the potential energy function.

[0114] (3) Use the iterative optimization method to solve the optimization problem of the potential energy function, and in the process of iteratively solving the potential energy function, that is, before the iteration point converges to the minimum point, use the preset separation judgment condition to determine whether the two convex bodies are in a separated state, and return the result of no collision when it is determined to be in a separated state.

[0115] (4) If, when solving the global optimization problem of the potential energy function, the iteration point converges to the extreme point and the separation judgment condition is not triggered, then the minimum value of the potential energy function is used to determine whether the two convex bodies collide.

[0116] For example, the pseudo-distance function satisfies the following property: (1) The pseudo-distance function takes a non-negative value at any point in space (always greater than or equal to 0, and will not be negative), and for any point in space, the point is located inside the corresponding convex body if and only if the pseudo-distance function takes a zero value at that point.

[0117] That is, the pseudo-distance function defines the interior and exterior of the convex body, i.e., if This indicates that it is located on the surface of the convex body or inside the convex body; if If the point is outside the convex body, then it must be outside the convex body. This is the foundation of collision detection. Because in subsequent steps, to determine whether two objects collide, we need to determine whether a point exists. Simultaneously located inside / on the surface of two objects.

[0118] (2) It is convex with respect to spatial points, that is, convexity.

[0119] This ensures the algorithm's stable convergence. When constructing the potential energy function, if the pseudo-distance function between the two objects is convex, then the potential energy function is also convex. Any local minimum of a convex function is a global minimum. This guarantees that regardless of the starting point of the iteration, as long as gradient descent is followed, a minimum point of the potential energy function will eventually be found. It also ensures the effectiveness of Newton's method. Newton's method relies on the second-order information of the function (Hessian matrix) to quickly find the minimum point. For convex functions, the Hessian matrix is ​​positive definite or positive semi-definite, ensuring that the direction of Newton's descent is always effective. Without convexity, the algorithm might get trapped in local optima, incorrectly identifying a collision between the two objects when they don't actually collide, or misjudging them as non-collision when they do.

[0120] (3) Its square function It is differentiable with respect to a point in space.

[0121] Differentiability means that the graph of a function is smooth, without cusps or creases, and its tangent slope (gradient) can be calculated. Differentiability allows for the subsequent calculation of the gradient of the potential function and achieves fast convergence. Furthermore, in the separation decision, the gradient of the pseudo-distance function is needed to construct the isolation plane.

[0122] For example, the potential energy function satisfies the following property: (1) It is defined in a fully Euclidean space with the same dimension N as the space containing the convex body. .

[0123] The entire Euclidean space refers to a space in which the potential energy function is defined throughout an infinitely large space. Optimization algorithms start from a certain initial point in the iteration and move freely throughout this space to find the minimum value; this property ensures that the search space is complete.

[0124] (2) Its value is non-negative, i.e., non-negativity.

[0125] Subsequently, a collision can be determined based on the value of the potential energy function being 0; if the function value is greater than 0, no collision is determined.

[0126] (3) Its minimum value is zero if and only if there is a collision between the two convex bodies.

[0127] This property transforms the geometric problem (whether objects collide) into a mathematical problem (whether the function has a minimum value of 0). It no longer requires intuitively determining whether two shapes overlap; instead, it necessitates using an optimization algorithm to find the minimum value of the function and then checking if this minimum value is 0. If it is 0, then a collision must have occurred.

[0128] (4) It is globally differentiable and convex downwards.

[0129] Global differentiability means that the potential function is smooth at any point in the entire space, and its gradient (first derivative) and Hessian matrix (second derivative) can be computed. There are no cusps, creases, or discontinuities. Convexity means that the potential function has only one global minimum and no local minima, thus guaranteeing global optimality and avoiding misjudgments. Furthermore, convexity ensures that iterative algorithms such as Newton's method can stably and monotonically converge to the unique minimum.

[0130] For example, the process of determining separation using the separation conditions includes the following steps: (1) Construct a pseudo-support (hyper) plane for each convex body to be detected; (2) The separation determination is achieved based on the geometric relationship between the four objects, namely the pseudo-support (hyper) plane obtained by the two constructions and the two convex bodies to be detected.

[0131] For example, the pseudo-support (hyper)plane obtained by the construction satisfies the following property: (1) Its normal vector is parallel (in the same direction or in opposite direction) to the gradient of the pseudo-distance function at the iteration point. Since the gradient direction is determined, this provides a clear and unique basis for the normal of the isolation plane, avoiding arbitrariness.

[0132] (2) The corresponding convex body and the iteration point are separated on both sides.

[0133] The following is combined Figure 2 The methods provided in the embodiments of this disclosure are illustrated by way of example, but this disclosure is not limited thereto.

[0134] Figure 3 This diagram illustrates a collision detection method based on implicit surface modeling, according to an embodiment of the present disclosure. Figure 3 As shown, the method provided in this embodiment may include the following steps.

[0135] S301, Algorithm initialization, including the construction of the potential energy function and the setting of the initial point for iteration.

[0136] For example, to construct the potential energy function, a pseudo-distance function is first constructed for each of the two objects to be detected colliding (hereinafter referred to as the first object A and the second object B, which can both be convex bodies, and therefore can also be called the first convex body and the second convex body, or the first object and the second object). The first object and the second object can be specifically defined in different application scenarios. For example, the first object can be a robot, and the second object can be an obstacle. Or, the first object can be a first component, and the second object can be a matching second component. Or, the first object is a car, and the second object is a wall.

[0137] In an exemplary embodiment, for one of the convex bodies to be detected (which can be either the first object or the second object mentioned above), its implicit surface is assumed to be... That is, this is the first component of this object. The equation of the surface. Here This refers to the coordinate vector / position vector of any point in space. For example, in two-dimensional space, It can include the x-coordinate and y-coordinate of the point; in three-dimensional space, It can include coordinates in three directions. Among them, , Used to distinguish different surface patches that make up the same convex body. This indicates the total number of implicit surface patches that make up the convex body. It is an integer greater than or equal to 1. When When = 1, this convex body is bounded by a single smooth implicit surface. Examples include a sphere, an ellipsoid, and a cylinder. When When the value is greater than 1, the convex body is formed by piecing together multiple curved surfaces, such as a polyhedron. For example, a hexahedron (cube) is formed by 6 planes. =6. For example, a cylinder is formed by a cylindrical surface and two circular flat end caps. =3.

[0138] For example, a convex function is selected that is monotonically increasing with respect to each component: (1) make This yields the pseudo-distance function corresponding to the convex body. Externalities were extracted: when point When inside the object <0, this item is =0; point When outside the object, It is positive. After taking the square root, the entire function is 0 inside and positive outside, and it is convex. It is simpler to calculate than the exact Euclidean distance.

[0139] This disclosure uses convex functions. , put multiple Combining them yields the pseudo-distance function . It is a multivariate function whose input is a vector. This vector consists of all The calculation results consist of, i.e. = ,in = ,therefore, = Each component here refers to input vector Each independent variable in the equation, i.e. The monotonically increasing nature of each component means that if we consider each component individually... One of the independent variables (e.g.) Increase ) while keeping all other independent variables (e.g.) If ) remains unchanged, then The function value either increases or remains unchanged, but never decreases. This can be expressed as: for any... (From 1 to m), if ,So: (2) The ellipsis in the above formula indicates that other components remain unchanged. This is to ensure that the final constructed pseudo-distance function... That's reasonable. Value determination point Compared to the first The position of the surface. If >0, indicating points The first of the objects The exterior of the surface. If <0 indicates a point The first of the objects The interior of a flat surface. When a point... Growing further and further away from the first When the surface is curved, The value will increase over time. Because about It is monotonically increasing, then The value will also increase accordingly. Conversely, when the point... Approaching the interior of the object, It becomes negative because it is monotonically increasing. The value will decrease (or even become 0, if) (Properly designed). This property guarantees... It should accurately reflect externalities. The farther a point is from an object (in any direction), the larger its pseudo-distance value should be; if a point enters the interior of an object, the pseudo-distance should be smaller. The value of is 0 when the point is outside the object, close to the object but not inside it. The value is positive and continuously approaches 0. Monotonically increasing is the guarantee for this.

[0140] The pseudo-distance function constructed by combining implicit surface functions and convex functions can handle convex bodies represented by one or more implicit surfaces (such as planes, quadric surfaces, hyperquadric surfaces, etc.) very well. Furthermore, the constructed pseudo-distance function naturally satisfies convexity and differentiability, has a good analytical form, is very suitable for subsequent convex optimization, and has high accuracy.

[0141] It should be noted that the construction of the pseudo-distance function is not limited to the convex functions mentioned above; other convex functions can also be used, such as... or As long as convexity and internal / external discrimination are satisfied, etc., a smooth approximation (such as softmax) can be used for non-smooth cases. That is, when the algorithm encounters non-differentiable problems caused by the max function or the edges of the object, it can be replaced by a smooth function that is differentiable everywhere and very close to the original function. This is done to ensure that gradient-based optimization methods (such as Newton's method) can run smoothly and efficiently, thereby obtaining collision detection results. The embodiments disclosed in this disclosure are not limited to implicit surfaces, but can also be extended to parametric surfaces or polygonal meshes (by constructing implicit approximations).

[0142] Using the above method, pseudo-distance functions for the two objects are constructed, wherein the first pseudo-distance function of the first object is expressed as: The second pseudo-distance function of the second object is expressed as: In constructing the pseudo-distance function corresponding to the two objects. and Then, a potential energy function to describe the spatial relationship between the two convex bodies is constructed based on the pseudo-distance function. In an exemplary embodiment, the decision function / potential energy function may be composed of the sum of squares of two pseudo-distance functions, i.e.: (4) This yields the potential energy function. This potential energy function is non-negative, globally convex, and has a minimum value. =0 if and only if a point lies simultaneously on the surfaces of both objects (collision critical point). The square guarantees that the potential energy function is always greater than or equal to 0, i.e., non-negativity. The sum of squares operation, and... and The inherent convexity of the potential energy function together ensures its integrity. The global convexity of the object, resembling a smooth bowl shape, means that the lowest / minimum point of this bowl can be found using reliable iterative optimization methods. If two objects collide, then at least one point in space... (For example, a point within their overlapping area), this point lies simultaneously inside both objects. According to The property of (internal value is 0). =0, =0. To make... To reduce it to 0, it must be made and Both are 0. This corresponds exactly to the point. Being located simultaneously within two objects (either inside or at their boundaries) is the critical point or contact point where a collision occurs. If the two objects separate, then for any point in space... At least one It is positive (because a point cannot be inside two separate objects simultaneously), so the potential energy function is positive. The minimum value of this potential energy function must be greater than 0. That is, this embodiment of the disclosure creates a scenario: whether two objects collide is equivalent to whether the minimum value of this potential energy function is 0 or close to 0.

[0143] It is understood that the potential energy function used in the embodiments of this disclosure is not limited to the examples described above. The potential energy function can be expressed as follows: ,in, It is a non-negative convex function and ,For example: (5) in, Denotes the power or exponentiation of the first pseudo-distance function and the second pseudo-distance function, where Let be any real number greater than 1. This is because if only the first power is taken, the function may not be differentiable within the object (e.g., ...). The gradient is always 0 inside the function, but the derivative is discontinuous at the boundary. The square (or higher power) can guarantee that the function is smooth (differentiable) throughout the space, and the gradient is zero at the minimum point, which is convenient for optimization algorithms. and These are the first weights of the first pseudo-distance function and the second weights of the second pseudo-distance function, respectively. >0, >0. and These can be any positive numbers, and they can adjust the weighting of the contributions of the two objects to the total potential energy, introducing weighting coefficients to adjust the sensitivity of the two objects to distance. If the two objects are of equal importance, a weighting coefficient can be used. = =1. Positive coefficients represent positive linear combinations, which preserve the non-negativity and convexity of the potential function. If the original function... and It is convex, and the linear combination of positive coefficients is still convex.

[0144] In this embodiment, the pseudo-distance function is transformed into a smooth, convex function through exponentiation, ensuring that the minimum value at zero (i.e., when the surfaces of the two objects intersect) has good mathematical properties (such as quadratic differentiability). The positive linear combination fuses the information of the two objects into a unified potential energy while maintaining convexity, enabling the subsequent optimization problem (finding the minimum value) to be solved stably.

[0145] For example, the initial point of iteration The initial point is set to the midpoint of the line segment formed by the center points of the two objects (i.e., the line connecting the geometric center points of the two objects). It should be noted that the algorithm can iteratively calculate the correct result for any given initial point. Optionally, the initial point can also be set by the user. Since the potential energy function is convex, any initial point can converge to the global minimum. The choice of will not affect the correctness of the result, only the convergence speed.

[0146] S302, determine whether the gradient magnitude at the iteration point is less than the error threshold; if it is less than the error threshold, execute S303; if it is not less than the error threshold, execute S304 and enter the loop.

[0147] S303, the result is a collision. Then proceed to S307.

[0148] For example, the potential energy function is determined at the current iteration point. ( gradient at ) Length of the module Is it less than a given error threshold? In this embodiment, the potential energy function at the iteration point can be calculated directly from its explicit expression (a formula that can be directly calculated numerically, not an implicit relationship that requires solving equations to obtain the result, thereby reducing computational costs). gradient at And calculate the magnitude of the gradient vector. If it is less than the preset error threshold, i.e. < If so, then the potential energy function is considered to be close to the extreme point and the minimum value. The gradient is close to 0 (because the gradient at the minimum point of a convex function is zero). At this point, the final result is directly determined that the two objects collide, and the process ends after outputting the result. A sufficiently small gradient means that the iteration point is near the minimum, and the non-negativity of V guarantees that a minimum of 0 corresponds to a collision. If the minimum is greater than 0, the gradient will not be zero (strictly convex), therefore this determination is reliable. Not less than the preset error threshold If so, the loop will begin and the subsequent operations will be executed.

[0149] S304, determine whether the separation condition or separation decision condition is not met; if not, proceed to S305; if met, proceed to S306.

[0150] like Enter the loop. Determine if the separation condition is met. To perform the separation condition determination, first construct isolation planes for two convex bodies at the iteration point.

[0151] In an exemplary embodiment, the function corresponding to the implicit surface satisfies the homogeneity condition, in which case the isolation plane can be constructed efficiently and robustly, as described below.

[0152] First, construct the isolation plane. At each current iteration point... At this point, an isolation plane is constructed for each object to separate the current iteration point from the object itself. This isolation plane is related to the pseudo-distance function. The gradient direction is parallel.

[0153] A function Known as A homogeneous function of degree 2, if for any positive real number... and any vector ,have: (6) That is, the independent variable Multiply all components by The function value will revert to its original value. times.

[0154] If a convex body is composed of an implicit curved surface Enclosed, set as Implicit surfaces writing: (7) in It is a convex function, and It is a homogeneous function. That is, the surface of the object is satisfied by... The points constitute. If It is homogeneous; when starting from the origin (the center of the object) and moving in a certain direction, The value increases uniformly with increasing distance (in terms of power). ).when When homogeneity is satisfied, constructing the isolation plane becomes simple and efficient. Therefore, for the iteration point... The radial contraction formula holds, let: (8) in, It is a homogeneous degree (e.g., for quadratic forms) =2), It can be any real number. At this point, To satisfy the separation property of the isolation plane, such as Figure 4 As shown in (a). Wherein, = . yes The hyperplane contracts radially to a point on the surface, with the gradient direction perpendicular to the surface, and passes through... Furthermore, the normal direction is the gradient, which can guarantee that... Separated from the object.

[0155] If a convex body is formed by multiple implicit surfaces, let it be... And for each Its corresponding isolation plane passes through point And the normal direction is ,but To satisfy the separation property of the isolation plane, where Here is the solution to the following linear programming problem: (9) (10) Therefore, the isolation plane of the convex body can be obtained as follows: Here and Same. For example... Figure 4 As shown in (b), assuming the points of the first face of the convex body are obtained first... And based on this, determine the hyperplane of the first surface. ; Obtain the point of the second face of the convex body And based on this, determine the hyperplane of the second surface. Then determine the point. Determine the isolation plane of the protrusion. . Figure 4 In A point drawn on the surface of an object The point, i.e., the current iteration point (here, is used as...). For example, the gradient direction at a point (where the gradient is perpendicular to the object's surface and points outward) represents the surface direction of the object at that point. The direction. Draw a point outside the object At that point, there is a vertically downward arrow. This represents the gradient, and the gradient direction is the direction in which the function value increases the fastest. At the point... place, For a convex body, the gradient generally points away from the object (i.e., outwards), so If upwards, then Downward, that is It roughly points inwards from the object. In the case of an ideal homogeneous function, and They are exactly parallel. Figure 4 This demonstrates a geometric coupling relationship: through points and direction Found a support point Then through the normal line The orientation was determined. Figure 4 In It represents an object, which can be the first object or the second object.

[0156] Specifically, for an object composed of multiple implicit surfaces, first consider each... Construct a similar hyperplane to obtain the corresponding points. and legal direction Then solve the linear programming problem. Where... Desirable . , By all , The constraints of the composition describe how the final [structure / structure] is determined. The position. Linear programming ensures that the final isolation plane can simultaneously isolate all surfaces of the object, that is, the object is located on one side of the isolation plane, and the current iteration point, for example... Located on the other side or boundary. Optimal solution obtained. Afterwards, the isolation plane is Here This indicates the direction of the normal to the isolation plane, and the orientation of the isolation plane is determined by it. Desirable This refers to the orientation of the isolation plane, chosen as the pseudo-distance function at position. The gradient direction at that point. Because this gradient direction points inwards from the object. Using it as the method line ensures that the resulting isolation plane can precisely isolate the object. Separated from the object. , This refers to the orientation of candidate points and candidate isolation planes for each hyperplane. Each ( , Each ) represents a suggestion. These suggestions become mathematical constraints. For example, regarding ( , ): final It must be located within a specific area; otherwise, it will not serve its isolation purpose. This constraint can be expressed as a mathematical inequality: (in It is by , A calculated number.

[0157] In this embodiment of the disclosure, , It is a system of equations formed by piling up all the constraints of all hyperplanes. It is a matrix containing all candidate normals of the hyperplane. . It is a vector containing the constants corresponding to all hyperplanes. .

[0158] Linear programming ensures that the resulting isolation plane can simultaneously isolate all surfaces, meaning the object lies on one side of the isolation plane, while Located on the other side. That is, we need to find a final isolation plane, the normal of which is... Let's simply take it as the current point (here, let's take it as...). (For example) gradient The direction. What was found. One condition must be met: it must be possible to simultaneously isolate every surface that makes up the object. Therefore, for each surface... Separately calculated isolation information ( , All of these are transformed into mathematical constraints (placed into a matrix). sum vector (Then, by solving a linear programming problem, we can find an optimal solution while satisfying all these constraints). This process ensures that, although the object has a complex shape (composed of multiple faces), the final constructed isolation plane... It can still reliably deliver Separate from the whole object.

[0159] Suppose an object is composed of multiple implicit surfaces A convex structure formed by walls. For example, in a polyhedral room, each wall is a curved surface. Standing at a point outside the room At the (iteration point), we want to find a final point. Construct an isolation plane based on it, and prove... It is separate from the rest of the room.

[0160] For each wall It has already calculated a candidate point independently based on its own information. and a candidate normal (this It usually points outwards from the wall, that is, away from the room. In other words, with One suggestion ( , ).

[0161] Each suggestion ( , In fact, a half-space is defined: because Pointing outwards from the wall, the room (object) is located inside the wall, which satisfies... One side of the equation. Expressed as a mathematical inequality: (11) This inequality applies to any point in the room. Both are true. In particular, if you want the final point... If it is located inside the room (or at least does not go outside the room), then it must also satisfy this inequality: .

[0162] In linear programming, constraints are often written as... The inequality above is in the form of "less than or equal to", and its direction can be reversed by multiplying both sides by -1: (12) If let The i-th action ,make The Each component is Then the above inequality becomes: (13) Put all By stacking up such inequalities, we obtain the entire constraint system. .

[0163] When finally solving the linear programming problem, it is required that... These inequalities must be satisfied on all walls simultaneously. This ensures... Located on the inside of all walls, i.e., inside the room or on the boundary. Then, by maximizing the objective function... (in = To select the most suitable spot from the room. As the final point. The isolation plane obtained in this way can... It is separated from the rest of the room.

[0164] It should be noted that in other embodiments, an isolation plane construction method that does not rely on homogeneity can also be adopted, and the support points can be obtained directly by solving the dual problem.

[0165] Obtain the first isolation plane of the first object The second isolation plane of the second object Then, geometric analysis is used to determine whether they are separated.

[0166] The separation condition is determined based on the isolation plane. In an exemplary embodiment, the separation condition is implemented as follows: If the gradients of the pseudo-distance functions of the two objects at the iteration point are parallel and opposite, it can be determined that there is no collision between the two convex bodies. Figure 5 As shown in (a). Solve for the intersection of the two isolated planes. .make and It is an intersection line Two normal vectors. Define two quarter-space regions. Determine if two objects lie within their respective quarter-space regions and if the two quarter-space regions do not intersect. If so, it can be determined that there is no collision between the two convex bodies. A separating hyperplane.

[0167] If two gradients are opposite and parallel, it can be directly determined that the two objects are not colliding. This is because opposite and parallel gradients mean that the two objects are at the same iteration point. If the trend is opposite to that of the other party's inward movement, it is very likely that they are already in a state of separation, for example, Figure 5 As shown in (a).

[0168] If the two gradients are not oppositely parallel, a more rigorous quarter-space test is performed: 1. Find the two isolation planes. and intersection ,in express The orientation is equal to ; express The orientation is equal to ; Represents the first object A point; Indicates the second object B point.

[0169] 2. At the intersection line Take a little upon taking office and define perpendicular to And located in The first normal vector inside (satisfy ), defined perpendicular to And located in The second normal vector inside (satisfy ).

[0170] 3. Construct the first quarter spatial region : (15) Construct the second quarter space region : (16) These regions are the intersections of half-spaces in which objects may be contained.

[0171] 4. Let the geometric centers of the two objects be respectively... and The maximum radii are respectively and (Preliminary estimation). Determine if the following conditions are met simultaneously: (The first object A is completely in) (17) (The second object B is completely in) (18) (The two regions do not overlap) (19) If all the above conditions are met, it can be determined that the two objects will not collide, and a separating hyperplane can be constructed. ,in , From a set Selected The largest vector, i.e.: (20) in, yes The normalized vector, yes The normalized vector, yes The normalized vector, yes The normalized vector, such as Figure 5 As shown in (b). This condition essentially finds a safe isolation zone, ensuring that the two objects are located in non-intersecting convex cones.

[0172] Figure 5 In Indicates the first object, It indicates the second object.

[0173] It is understandable that, in addition to the separation criteria mentioned above, other geometric criteria can be used, such as checking whether two separating planes divide the space into two non-intersecting half-spaces, or using linear programming to directly test whether a separating hyperplane exists.

[0174] S305, Newton's descent update iteration point.

[0175] For example, the iteration point is updated using Newton's descent method. At the current iteration point... At the (k+1)th iteration point, the direction of Newton's descent is directly calculated using the explicit expression of the potential energy function, and the step size is determined by performing a line search along the direction of Newton's descent. Update the current iteration point to the next iteration point. That is, at the (k+2)th iteration point, we return to the determination of the loop condition.

[0176] In this embodiment of the disclosure, if the separation condition is not met, Newton's method is used to update the iteration point: Calculate the Newton direction .

[0177] along Perform a line search to determine the step size ,renew = + .

[0178] Return from S305 to S302 and continue the loop.

[0179] It should be noted that this disclosure is not limited to iterative optimization using Newton's method; gradient descent, conjugate gradient, quasi-Newton (BFGS), and even global optimization algorithms (such as particle swarm optimization) can also be used. The step size can be fixed, adaptive, or based on the Armijo criterion.

[0180] S306, the result is no collision, and a separating hyperplane is constructed. Then proceed to S307.

[0181] S307, Output Results.

[0182] The program outputs the final result determining whether a collision exists between two objects. If no collision exists, it further outputs the separating hyperplane between the two objects. Specifically, it outputs the collision state when the loop terminates. If the separation condition is met, it can also output the separating hyperplane.

[0183] This embodiment of the disclosure accelerates the process by utilizing an isolation plane to determine separation in advance during the optimization process.

[0184] The method provided in this disclosure can be extended to handle non-convex objects. By decomposing the non-convex body into multiple convex bodies through convex decomposition, the method provided in this disclosure is applied to each convex body, and then a comprehensive judgment is made. Alternatively, a convex hull approximation can be used.

[0185] The method provided in this disclosure can be applied to robot path planning to quickly eliminate a large number of collision-free configurations. It can also be applied to computer graphics for real-time collision detection and physical simulation. Furthermore, it can be applied to virtual reality for force-sensing interaction.

[0186] The method provided in this disclosure can also be mapped to GPU parallel computing, for example, to process multiple object pairs simultaneously.

[0187] Figure 6 Examples of tests performed according to embodiments of this disclosure are shown. The boundaries of the examples include planes, quadric surfaces, hyperquadrilaterals, hyperellipsoids, and generalized hyperquadrilaterals, represented implicitly, and each example is enclosed by one or more implicit surfaces.

[0188] Figure 7 This diagram illustrates collision detection of a test sample in an embodiment of this disclosure. The test method involves randomly placing the center points of two objects within a three-dimensional region. In the process, its rotational orientation is randomly generated. The error threshold is set to... When a collision exists between two objects, this embodiment of the disclosure detects the existence of a collision. When no collision exists between two objects, this embodiment of the disclosure detects the absence of a collision and provides a separating hyperplane. Figure 7 In this context, d represents the shortest distance between two objects, such as Euclidean distance.

[0189] For each pair of test cases, the collision detection test was performed, and the test time was statistically analyzed and compared with advanced algorithms in related technologies, including baseline algorithms without separation conditions and the GJK algorithm implemented in the FCL library. The results are shown in Table 1 below. In Table 1, (a), (b), (c), (d), (e), and (f) respectively refer to… Figure 6 Each test case in the document.

[0190] Table 1

[0191] Figure 8 This diagram illustrates collision detection results and time statistics for different distances between objects according to embodiments of the present disclosure. Examples of the tests include... Figure 6 (a), (b), (e), (f). The distance tested is from... arrive . Figure 8 The solid purple line represents the average time taken using the method provided in the embodiments of this disclosure, the dashed purple line represents the number of iterations taken using the method provided in the embodiments of this disclosure, the solid blue line represents the average time taken using the baseline method (without using separation conditions), the dashed blue line represents the number of iterations taken using the baseline method, and the solid brown line represents the average time taken using the GJK algorithm implemented in the FCL library.

[0192] This disclosure presents a collision detection method applicable to convex bodies described by piecewise implicit surfaces. The method introduces a pseudo-distance function to construct a smooth and downwardly convex virtual potential energy field, transforming the collision detection problem into an unconstrained convex optimization problem. Simultaneously, an isolation plane is constructed based on the properties of the pseudo-distance function, thereby quickly eliminating non-collision cases using separation criteria. This method can handle non-strictly convex and non-smooth implicit surface models, significantly reducing the number of iterations and improving collision detection efficiency compared to traditional methods. Experiments show that this disclosure significantly outperforms related techniques in terms of efficiency.

[0193] like Figure 9 As shown in the embodiments of this disclosure, a collision detection device 900 is also provided, including: a processing unit 910, configured to construct a first pseudo-distance function for a first object and a second pseudo-distance function for a second object; the processing unit 910 is further configured to construct a potential energy function characterizing the spatial relationship between the first object and the second object based on the first pseudo-distance function and the second pseudo-distance function; a detection unit 920, configured to determine whether the first object and the second object are in a separated state using a separation determination condition before the iteration point converges to the minimum point of the potential energy function, and to obtain a detection result that the first object and the second object do not collide when it is determined that they are in the separated state; the detection unit 920 is further configured to determine whether the first object and the second object collide by using the minimum value of the potential energy function if the iteration point converges to the minimum point and the separation determination condition is not triggered.

[0194] Figure 9 Other aspects of the embodiments can be found in the above embodiments, and will not be repeated here.

[0195] Those skilled in the art will understand that various aspects of this disclosure can be implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which can be collectively referred to herein as a "circuit", "module" or "system".

[0196] Based on the same inventive concept, this disclosure also provides an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute the collision detection method described above by executing the executable instructions. Since the principle of solving the problem in this electronic device embodiment is similar to that of the above method embodiments, the implementation of this electronic device embodiment can refer to the implementation of the above method embodiments, and repeated details will not be elaborated further. See below for reference. Figure 10 To describe an electronic device 1300 according to such an embodiment of the present disclosure. Figure 10The electronic device 1300 shown is merely an example and should not be construed as limiting the functionality and scope of use of the embodiments disclosed herein.

[0197] like Figure 10 As shown, the electronic device 1300 is presented in the form of a general-purpose computing device. The components of the electronic device 1300 may include, but are not limited to: at least one processing unit 1310, at least one storage unit 1320, and a bus 1330 connecting different system components (including storage unit 1320 and processing unit 1310).

[0198] The storage unit stores program code that can be executed by the processing unit 1310, causing the processing unit 1310 to perform the steps described in the "Exemplary Methods" section above according to various exemplary embodiments of this disclosure.

[0199] Storage unit 1320 may include readable media in the form of volatile storage units, such as random access memory (RAM) 13201 and / or cache memory 13202, and may further include read-only memory (ROM) 13203.

[0200] Storage unit 1320 may also include a program / utility 13204 having a set (at least one) of program modules 13205, such program modules 13205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.

[0201] Bus 1330 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.

[0202] Electronic device 1300 can also communicate with one or more external devices 1340 (e.g., keyboard, pointing device, Bluetooth device, etc.), one or more devices that enable a user to interact with electronic device 1300, and / or any device that enables electronic device 1300 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 1350. Furthermore, electronic device 1300 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 1360. As shown, network adapter 1360 communicates with other modules of electronic device 1300 via bus 1330. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 1300, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0203] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.

[0204] Based on the same inventive concept, this disclosure also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements any of the above-described collision detection methods. Since the principle by which this computer-readable storage medium embodiment solves the problem is similar to that of the above-described method embodiments, the implementation of this computer-readable storage medium embodiment can refer to the implementation of the above-described method embodiments, and repeated details will not be elaborated further.

[0205] More specific examples of computer-readable storage media in this disclosure may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0206] Based on the same inventive concept, this disclosure also provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements the collision detection method of any one of the above method embodiments. Since the principle by which this computer program product embodiment solves the problem is similar to that of the above method embodiments, the implementation of this computer program product embodiment can refer to the implementation of the above method embodiments, and repeated details will not be elaborated further.

[0207] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0208] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.

[0209] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the appended claims.

Claims

1. A collision detection method, characterized in that, include: Construct the first pseudo-distance function for the first object and the second pseudo-distance function for the second object; Based on the first pseudo-distance function and the second pseudo-distance function, a potential energy function is constructed to characterize the spatial relationship between the first object and the second object; Before the iteration point converges to the minimum point of the potential energy function, the separation determination condition is used to determine whether the first object and the second object are in a separated state, and when it is determined that they are in the separated state, the detection result that the first object and the second object do not collide is obtained. If the iteration point converges to the minimum point and the separation determination condition is not triggered, then the minimum value of the potential energy function is used to determine whether the first object and the second object collide.

2. The method according to claim 1, characterized in that, Both the first pseudo-distance function and the second pseudo-distance function satisfy: The value is non-negative at any point in space, and for any point in space, the point is determined to be inside the corresponding object if and only if the corresponding pseudo-distance function takes zero at that point; It is convex with respect to a point in space; Its square function is differentiable with respect to points in space.

3. The method according to claim 1 or 2, characterized in that, The potential energy function satisfies: Its value is non-negative; The potential energy function is zero if and only if there is a collision between the first object and the second object; Its global differential nature is convex downwards; It is defined in a fully Euclidean space with the same dimension as the space containing the first object and the second object.

4. The method according to claim 1 or 2, characterized in that, Determining whether the first object and the second object are in a separated state using separation criteria includes: Construct a first isolation plane for the first object and a second isolation plane for the second object; Based on the geometric relationship between the first isolation plane and the second isolation plane and the first object and the second object, it is determined whether the first object and the second object are in a separated state.

5. The method according to claim 4, characterized in that, Both the first isolation plane and the second isolation plane satisfy: Its normal vector is parallel to the gradient of the corresponding pseudo-distance function at the corresponding iteration point; The corresponding object and the iteration point are separated on both sides.

6. The method according to claim 4, characterized in that, Constructing a first isolation plane for the first object and a second isolation plane for the second object includes: At each iteration point in the process of finding the minimum value of the potential energy function, the gradient of the corresponding pseudo-distance function is calculated; The corresponding isolation plane is determined based on the gradient of the corresponding pseudo-distance function and the implicit function of the corresponding object.

7. The method according to claim 4, characterized in that, Based on the geometric relationships between the first isolation plane and the second isolation plane and the first object and the second object, determining whether the first object and the second object are in a separated state includes: Determine the intersection line of the first isolation plane and the second isolation plane; Take a point on the line of intersection, and draw a first orthogonal plane perpendicular to the first isolation plane and a second orthogonal plane perpendicular to the second isolation plane; A first quarter-space region enclosed by the first isolation plane and the first orthogonal plane, and a second quarter-space region enclosed by the second isolation plane and the second orthogonal plane are obtained; Determine whether the first object is within the first quarter space region, whether the second object is within the second quarter space region, and whether the first quarter space region and the second quarter space region overlap, in order to determine whether the first object and the second object are in a separated state.

8. An electronic device, characterized in that, Includes processor, memory, and input / output interfaces; The processor is connected to the memory and the input / output interface respectively, wherein the input / output interface is used to receive data and output data, the memory is used to store computer programs, and the processor is used to call the computer programs so that the electronic device executes the method according to any one of claims 1-7.

9. A computer-readable storage medium having a computer program stored thereon, the program being executed by a processor to implement the method of any one of claims 1-7.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1-7.