Approximation Method, Device, Computer Equipment, Readable Storage Medium and Program Product for Constructing Ball Set Collision Model

By constructing the sphere collection of target objects, using the simple convex hull characteristics of the sphere, the complex problem of concave packet collision judgment in traditional modeling methods is solved, and more efficient collision prediction is achieved.

CN119339032BActive Publication Date: 2025-06-10SHENZHEN HANS ROBOT CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411875762.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-06-10
Estimated Expiration
2044-12-19

AI Technical Summary

Technical Problem

When traditional modeling methods make object collision judgment, especially the collision judgment process of concave packs is complicated, which makes collision judgment difficult.

Method used

By obtaining the inner normals of multiple surface structures of the target object, a sphere with the largest radius and does not collide with any surface structure is constructed to form a set of balls for collision prediction.

Benefits of technology

It reduces the difficulty of the collision judgment process and improves the accuracy and efficiency of collision prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119339032B_ABST
    Figure CN119339032B_ABST
Patent Text Reader

Abstract

The present application relates to an approximate method, apparatus, computer device, readable storage medium, and program product for constructing a ball set collision model. The method includes: obtaining the inner normal of each of a plurality of surface structures of a target object; for a first inner normal among the inner normals that serves as a modeling starting point, constructing a first sphere with the largest radius that does not collide with any surface structure based on a first center position on the first inner normal; for a second inner normal among the inner normals other than the first inner normal, constructing a second sphere with the largest radius that does not collide with any of the spheres already constructed based on a second center position on the second inner normal; obtaining a ball set of the target object when each of the spheres already constructed fills the target object; the ball set is used for collision prediction of the target object. Using this method can reduce the difficulty of collision prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of modeling technologies, and particularly to an approximate method, apparatus, computer device, readable storage medium, and program product for constructing a ball set collision model. Background Art

[0002] With the development of modeling technologies, methods for predicting the collision process of objects based on modeling technologies have emerged. The actual objects can be modeled into three-dimensional models to predict the collisions of the objects and avoid losses caused by collisions.

[0003] Traditional modeling methods generally convert an object into a three-dimensional model including convex hulls and concave hulls, and perform collision judgments for each convex hull in the object with other convex hulls or concave hulls. However, the collision judgment process for concave hulls is extremely complex compared to convex hulls. When using traditional modeling methods for modeling, there is a problem of difficult collision judgment process. Summary of the Invention

[0004] Based on this, in view of the above technical problems, it is necessary to provide an approximate method, apparatus, computer device, readable storage medium, and program product for constructing a ball set collision model that can reduce the difficulty of the collision judgment process.

[0005] In a first aspect, the present application provides an approximate method for constructing a ball set collision model, including:

[0006] Obtain the inner normal of each of the multiple surface structures of the target object;

[0007] For a first inner normal among the inner normals as the modeling starting point, based on the position of the first center of the ball on the first inner normal, construct a first sphere with the largest radius and not colliding with any of the surface structures;

[0008] For a second inner normal among the inner normals other than the first inner normal, based on the position of the second center of the ball on the second inner normal, construct a second sphere with the largest radius and not colliding with any of the spheres already constructed;

[0009] When the target object is filled with the spheres already constructed, obtain the ball set of the target object; the ball set is used for collision prediction of the target object.

[0010] In one embodiment, obtaining the inner normal of each of the multiple surface structures of the target object includes:

[0011] Obtain the three-dimensional information of the target object; the three-dimensional information includes the position information of each of the multiple surface structures of the target object;

[0012] For each surface structure, determine the inner normal of the surface structure according to the position information.

[0013] In one embodiment, the surface structure includes triangular patches; the position information includes the vertex position information of each of the multiple vertices of the triangular patches; the inner normal is characterized by an inner normal vector and a normal starting point; for each of the surface structures, determining the inner normal of the surface structure according to the position information includes:

[0014] For each of the triangular patches, perform normal vector analysis on the vertex position information to determine an initial inner normal vector of the triangular patch;

[0015] Normalize the initial inner normal vector to determine the inner normal vector of the triangular patch;

[0016] Perform average value statistics on the vertex position information to determine the normal starting point of the triangular patch.

[0017] In one embodiment, the surface structure includes an edge; the position information includes the position information of the edge; for each of the surface structures, determining the inner normal of the surface structure according to the position information includes:

[0018] For each of the edges, obtain the adjacent inner normal vectors of the multiple triangular patches adjacent to the edge;

[0019] Perform average value statistics on the adjacent inner normal vectors to determine the inner normal vector of the edge, and determine the position information as the normal starting point of the edge.

[0020] In one embodiment, the method for constructing an approximation of the spherical set collision model further includes:

[0021] Obtain a distance threshold;

[0022] For a first inner normal among the inner normals that serves as a modeling starting point, based on the distance threshold, determine a first sphere center position on the first inner normal;

[0023] The distance between the first sphere center position and the first normal starting point of the first inner normal is the distance threshold.

[0024] In one embodiment, based on the first sphere center position on the first inner normal, constructing a first sphere with the largest radius and not colliding with any of the surface structures includes:

[0025] Based on an initial radius and the first sphere center position on the first inner normal, construct a first initial sphere;

[0026] In the case where the first initial sphere does not collide with any of the surface structures, add the radius step to the initial radius to obtain an updated initial radius;

[0027] Return to the step of constructing the first initial sphere based on the initial radius and the position of the first sphere center on the first inner normal until the first initial sphere constructed in the current round collides with at least one of the surface structures;

[0028] Take the first initial sphere constructed in the previous round as the first sphere corresponding to the first inner normal.

[0029] In one embodiment, for a second inner normal among the inner normals other than the first inner normal, construct a second sphere with the largest radius that does not collide with any of the already constructed spheres based on the position of the second sphere center on the second inner normal, including:

[0030] For each second inner normal among the inner normals other than the first inner normal, construct a second initial sphere based on the initial radius and the position of the second sphere center on the second inner normal;

[0031] In the case where the second initial sphere does not collide with any of the already constructed spheres, add the radius step to the initial radius to obtain an updated initial radius;

[0032] Return to the step of constructing the second initial sphere based on the initial radius and the position of the second sphere center on the second inner normal until the second initial sphere constructed in the current round collides with at least one of the already constructed spheres;

[0033] Take the second initial sphere constructed in the previous round as the second sphere corresponding to the second inner normal.

[0034] In a second aspect, the present application further provides an approximate device for constructing a sphere set collision model, including:

[0035] An inner normal acquisition module for acquiring the inner normals of each of the multiple surface structures of the target object;

[0036] A first sphere construction module for, for a first inner normal among the inner normals that serves as a modeling starting point, constructing a first sphere with the largest radius that does not collide with any of the surface structures based on the position of the first sphere center on the first inner normal;

[0037] A second sphere construction module for, for a second inner normal among the inner normals other than the first inner normal, constructing a second sphere with the largest radius that does not collide with any of the already constructed spheres based on the position of the second sphere center on the second inner normal;

[0038] A sphere set determination module, configured to obtain a sphere set of the target object when each of the constructed spheres fills the target object; the sphere set is used for collision prediction of the target object.

[0039] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps of the method described above are implemented.

[0040] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, and when the computer program is executed by a processor, the steps of the method described above are implemented.

[0041] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the steps of the method described above are implemented.

[0042] For the above-mentioned approximate method, device, computer device, readable storage medium and program product for constructing a sphere set collision model, the inner normal vectors of the respective surface structures of the target object are obtained. For the first inner normal vector as the modeling starting point among the inner normal vectors, based on the first sphere center position on the first inner normal vector, a first sphere with the largest radius and not colliding with any surface structure is constructed, and the first sphere for modeling the target object can be determined as the modeling support for the target object. Then, for the second inner normal vectors other than the first inner normal vector among the inner normal vectors, based on the second sphere center position on the second inner normal vector, a second sphere with the largest radius and not colliding with any of the constructed spheres is constructed, and each of the largest spheres except the first sphere can be determined. When each of the constructed spheres fills the target object, a sphere set of the target object is obtained, and a maximum non-collision sphere model of the target object can be formed. Among them, the sphere set is used for collision prediction of the target object. Since the three-dimensional model of the target object includes multiple spheres, and the sphere is the simplest convex hull in model construction, the above method can be used to perform collision prediction on the target object, thereby reducing the difficulty of collision prediction. Description of the Drawings

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following will briefly introduce the drawings required for use in the description of the embodiments of the present application or related technologies. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other related drawings can be obtained based on these drawings.

[0044] Figure 1 It is an application environment diagram of the approximate method for constructing a sphere set collision model in an embodiment;

[0045] Figure 2 A schematic flowchart of an approximation method for constructing a ball set collision model in an embodiment;

[0046] Figure 3 A schematic flowchart of an approximation step for constructing a ball set collision model in an embodiment;

[0047] Figure 4 A schematic diagram of sphere coverage of an approximation method for constructing a ball set collision model in an embodiment;

[0048] Figure 5 A model diagram of an approximation method for constructing a ball set collision model in an embodiment;

[0049] Figure 6 A model diagram of sphere approximation for a collaborative robot manipulator in another embodiment;

[0050] Figure 7 A structural block diagram of an approximation device for constructing a ball set collision model in an embodiment;

[0051] Figure 8 An internal structure diagram of a computer device in an embodiment. Detailed implementation manners

[0052] In order to make the objectives, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0053] The approximation method for constructing a ball set collision model provided by the embodiments of the present application can be applied to, for example Figure 1In the application environment shown. Among them, the terminal 102 communicates with the image acquisition device 104 through the network. Among them, the terminal 102 can be but is not limited to various personal computers, laptop computers, smart phones, tablet computers, Internet of Things devices, and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart vehicle-mounted devices, projection devices, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The image acquisition device 104 can be integrated in the terminal or can be a separate device, and is used to collect the image information of the target object, so that the terminal can analyze the target object based on the image information and determine the inner normal of each of the multiple surface structures of the target object. Specifically, in the process of constructing an approximation of the sphere set collision model, the terminal 102 obtains the inner normal of each of the multiple surface structures of the target object collected by the image acquisition device 104; for the first inner normal that serves as the starting point for modeling among each inner normal, based on the first center position of the sphere on the first inner normal, a first sphere with the largest radius and that does not collide with any surface structure is constructed; for the second inner normal other than the first inner normal among each inner normal, based on the second center position of the sphere on the second inner normal, a second sphere with the largest radius and that does not collide with any of the already constructed spheres is constructed; when the already constructed spheres fill the target object, a sphere set of the target object is obtained; the sphere set is used to perform collision prediction on the target object.

[0054] In an exemplary embodiment, as Figure 2 shown, a method for constructing an approximation of a sphere set collision model is provided. Taking the method applied to the Figure 1 terminal in as an example for description, it includes:

[0055] Step S202, obtaining the inner normal of each of the multiple surface structures of the target object.

[0056] Among them, the target object refers to the object to be predicted during the collision prediction process. For example, it can be a collaborative robot or an obstacle. It can be understood that the number of target objects is not unique and can be determined according to the actual situation at that time. The surface structure refers to the shape and characteristics of the surface of the target object. In this embodiment, the surface structure refers to the vertices, edges of the target object, and the triangular patches of the three-dimensional model to which the target object belongs. The inner normal refers to the vector perpendicular to the tangent plane at a certain point on the curved surface. In three-dimensional space, the inner normal is the perpendicular vector at a certain point on the curved surface, and it is perpendicular to the tangent plane of the curved surface at that point. The direction of the inner normal usually points to the inside of the curved surface, so it is named "inner normal".

[0057] Specifically, in order to determine the sphere set of the target object, it is necessary to first determine the surface structures of the target object, and then determine the inner normal vectors of the surface structures. It can be understood that the process of obtaining the inner normal vectors of the multiple surface structures of the target object can be an active acquisition or a passive reception. In a specific embodiment, the surface structure includes triangular patches, the position information includes the vertex position information of each of the multiple vertices of the triangular patches, and the inner normal vector is characterized by an inner normal vector and a normal starting point. In this embodiment, the terminal can perform a normal vector analysis on the vertex position information for each triangular patch to determine the initial inner normal vector of the triangular patch, perform a normalization process on the initial inner normal vector to determine the inner normal vector of the triangular patch, and perform an average value statistics on the vertex position information to determine the normal starting point of the triangular patch. In another specific embodiment, the surface structure includes edges, and the position information includes the position information of the edges. In this embodiment, the terminal can, for each edge, obtain the adjacent inner normal vectors of the multiple triangular patches adjacent to the edge, perform an average value statistics on the adjacent inner normal vectors to determine the inner normal vector of the edge, and determine the position information as the normal starting point of the edge.

[0058] Step S204: For the first inner normal vector among the inner normal vectors that serves as the modeling starting point, based on the first sphere center position on the first inner normal vector, construct a first sphere with the largest radius and that does not collide with any surface structure.

[0059] Among them, the modeling starting point, also known as the initial condition of modeling, is the reference point or initial state when starting to establish a mathematical model, physical model, or computer model. The first inner normal vector is the inner normal vector among the inner normal vectors that serves as the modeling starting point. Exemplarily, the first inner normal vector can be selected according to a preset condition or randomly selected. The first sphere center position refers to the position of the sphere center located on the first inner normal vector. The first sphere is a sphere with the first sphere center position as the sphere center, the largest radius, and that does not collide with any surface structure.

[0060] Specifically, after determining the inner normal vectors of the multiple surface structures of the target object, it is necessary to first determine the first sphere model in the sphere set of the target object. To ensure that the spheres in the sphere set can ultimately fully fill the target object, the first sphere must be maximized and cannot collide with any surface structure. Therefore, the terminal can, for the first inner normal vector among the inner normal vectors that serves as the modeling starting point, construct a first sphere with the largest radius that does not collide with any surface structure based on the first center position on the first inner normal vector. In a specific embodiment, a first initial sphere is constructed based on the initial radius and the first center position on the first inner normal vector. If the first initial sphere does not collide with any surface structure, the initial radius is added with a radius step size to obtain an updated initial radius, and the step of constructing the first initial sphere based on the initial radius and the first center position on the first inner normal vector is returned until the first initial sphere constructed in the current round collides with at least one surface structure. The first initial sphere constructed in the previous round is taken as the first sphere corresponding to the first inner normal vector.

[0061] In another specific embodiment, a first sphere modeling model can also be established. For the first inner normal vector among the inner normal vectors that serves as the modeling starting point, the first center position on the first inner normal vector is input into the first sphere modeling model, and the first sphere with the largest radius that does not collide with any surface structure is constructed through the first sphere modeling model.

[0062] Step S206: For the second inner normal vectors among the inner normal vectors other than the first inner normal vector, construct a second sphere with the largest radius that does not collide with any of the already constructed spheres based on the second center position on the second inner normal vector.

[0063] Among them, the second inner normal vector is the other inner normal vectors among the inner normal vectors that are selected to be modeled with spheres except for the first inner normal vector. The second center position refers to the position of the center of the sphere located on the second inner normal vector. The second sphere is a sphere with the second center position as the center of the sphere, the largest radius, and that does not collide with any of the already constructed spheres. The already constructed spheres refer to the spheres for which the target object has been modeled with spheres.

[0064] Specifically, after constructing the first sphere with the largest radius and without colliding with any surface structure, other second spheres in the target object except the first sphere can be established. To ensure the accuracy of the sphere set of the target object, it is necessary to ensure that each second sphere does not collide with the spheres that have been constructed before. That is, except for the first sphere, the remaining second spheres are modeled in the same way, but the constructed spheres they are targeted at are different. Therefore, the terminal can construct a second sphere with the largest radius and without colliding with any constructed sphere based on the second center position on the second normal line for each second normal line except the first normal line among the inner normal lines. In a specific embodiment, the terminal can construct a second initial sphere for each second normal line except the first normal line among the inner normal lines based on the initial radius and the second center position on the second normal line. When the second initial sphere does not collide with any constructed sphere, the initial radius is added with the radius step length to obtain an updated initial radius, and the step of constructing the second initial sphere based on the initial radius and the second center position on the second normal line is returned until the second initial sphere constructed in the current round collides with at least one constructed sphere, and the second initial sphere constructed in the previous round is used as the second sphere corresponding to the second normal line.

[0065] In another specific embodiment, a second sphere modeling model can also be established. For each second normal line except the first normal line among the inner normal lines, the second center position on the second normal line is input into the second sphere modeling model, and a second sphere with the largest radius and without colliding with any constructed sphere is constructed through the second sphere modeling model.

[0066] Step S208, when the target object is filled with the constructed spheres, a sphere set of the target object is obtained.

[0067] Among them, the sphere set includes multiple spheres and is used for collision prediction of the target object.

[0068] Specifically, after the first sphere and the second spheres are both constructed and the target object is filled with the constructed spheres, the sphere set of the target object can be obtained. It can be understood that not every inner normal line will go through the step of sphere construction, and moreover, when different first normal lines are selected to construct the first sphere, the second spheres will be different, and the sphere set corresponding to the target object will also be different.

[0069] In the above approximate method for constructing the ball set collision model, the inner normal vectors of multiple surface structures of the target object are obtained. For the first inner normal vector among the inner normal vectors, which serves as the starting point for modeling, based on the position of the first center of the ball on the first inner normal vector, a first sphere with the largest radius and that does not collide with any surface structure is constructed. The first sphere for modeling the target object can be determined as the modeling support for the target object. Subsequently, for the second inner normal vectors among the inner normal vectors, excluding the first inner normal vector, based on the position of the second center of the ball on the second inner normal vector, a second sphere with the largest radius and that does not collide with any of the already constructed spheres is constructed. The maximum spheres except the first sphere can be determined. When the target object is filled with the already constructed spheres, a ball set of the target object can be obtained, and a maximum non-collision sphere model of the target object can be formed. Among them, the ball set is used for collision prediction of the target object. Since the three-dimensional model of the target object includes multiple spheres, and the sphere is the simplest convex hull in model construction, using the above method for collision prediction of the target object can reduce the difficulty of collision prediction.

[0070] In an exemplary embodiment, obtaining the inner normal vectors of multiple surface structures of the target object includes: obtaining the three-dimensional information of the target object; for each surface structure, determining the inner normal vector of the surface structure according to the position information.

[0071] Among them, the three-dimensional information generally refers to the data required to describe an object or a scene in three-dimensional space. In this embodiment, the three-dimensional information includes the position information of multiple surface structures of the target object.

[0072] Specifically, in order to determine the inner normal vectors of multiple surface structures of the target object, the three-dimensional information of the target object can be determined first to determine the specific situation of the three-dimensional model of the target object. Then, according to the position information of multiple surface structures in the three-dimensional information, the inner normal vector of each surface structure is determined according to the position information of each surface structure, ensuring the accuracy of the inner normal vector determination process.

[0073] In an exemplary embodiment, the surface structure includes triangular patches; the position information includes the vertex position information of multiple vertices of the triangular patch; the inner normal vector is represented by an inner normal vector and a starting point of the normal vector; for each surface structure, determining the inner normal vector of the surface structure according to the position information includes: for each triangular patch, performing a normal vector analysis on the vertex position information to determine the initial inner normal vector of the triangular patch; performing a normalization process on the initial inner normal vector to determine the inner normal vector of the triangular patch; performing an average value statistics on the vertex position information to determine the starting point of the normal vector of the triangular patch.

[0074] Among them, a triangular facet is a geometric representation method widely used in computer graphics for simulating the surface of a three-dimensional object, including multiple vertices, and the position information of each vertex is the vertex position information. The inner normal vector is a vector tangent to the surface or plane, and the normal starting point refers to the starting point of the inner normal on the triangular facet. The initial inner normal vector refers to the inner normal vector that has not been normalized yet.

[0075] Specifically, the surface structure includes triangular facets. For each triangular facet, its normal starting point and inner normal vector need to be determined. Since a triangular facet includes three vertices, when determining the initial inner normal vector of the triangular facet, it is necessary to perform a normal vector analysis on the vertex position information of each vertex to determine the initial inner normal vector of the triangular facet, and then normalize the initial inner normal vector to determine the inner normal vector of the triangular facet. The normal starting point is the position of the average point of the three vertices, that is, it is necessary to perform an average value statistics on the vertex position information to determine the normal starting point of the triangular facet.

[0076] In a specific embodiment, for the triangular facet , the vertices are respectively , , calculate the initial inner normal vector : , and the normal starting point is selected as the average point of the three vertices of the triangular facet: . Then, normalize the initial inner normal vector: .

[0077] In this embodiment, by performing an average value statistics on the vertices of the triangular facet to obtain the normal starting point of the triangular facet, and performing a normal vector analysis on the vertex position information to determine the initial inner normal vector of the triangular facet, the accuracy of determining the inner normal of the triangular facet can be improved, and further the accuracy of the sphere set determination can be improved.

[0078] In an exemplary embodiment, the surface structure includes an edge; the position information includes the position information of the edge; for each surface structure, determining the inner normal of the surface structure according to the position information includes: for each edge, obtaining the respective adjacent inner normal vectors of the multiple triangular facets adjacent to the edge; performing an average value statistics on the adjacent inner normal vectors to determine the inner normal vector of the edge, and determining the position information as the normal starting point of the edge.

[0079] Among them, the edge refers to the edge of the target object. For example, the edge can include the vertices and edges of the target object. The adjacent inner normal vectors refer to the mutually adjacent inner normal vectors.

[0080] Specifically, the surface structure includes an edge, and the position information includes the position information of the edge, which is the starting point of the normal line of the edge. When determining the inner normal vector of the edge, it is necessary to first determine the inner normal vectors of the triangular patches adjacent to the edge respectively as adjacent inner normal vectors, and perform an average value statistics on the above adjacent inner normal vectors to determine the inner normal vector of the edge.

[0081] In this embodiment, taking the position information of the edge as the starting point of the normal line of the edge, and performing an average value analysis on the inner normal vectors of the triangular patches adjacent to the edge respectively to determine the inner normal vector of the edge can improve the accuracy of determining the inner normal of the edge, and further improve the accuracy of the sphere set determination.

[0082] In an exemplary embodiment, the sphere set collision model construction approximation method further includes: obtaining a distance threshold; for the first inner normal line that serves as the modeling starting point among each inner normal line, determining the first sphere center position on the first inner normal line based on the distance threshold.

[0083] Wherein, the distance between the first sphere center position and the first normal line starting point of the first inner normal line is the distance threshold. It can be understood that the distance threshold can be preset based on the actual situation and is not limited here.

[0084] Specifically, the terminal can obtain the preset distance threshold, and determine the first inner normal line that serves as the modeling starting point from each inner normal line. In the first inner normal line, the first sphere center position is determined based on the distance threshold. That is to say, the distance between the first sphere center position and the normal line starting point of the first inner normal line is the distance threshold. It can be understood that the distance threshold is not completely fixed and can be determined according to the actual situation. That is, the first sphere center position is not unique either, which can improve the flexibility of the sphere center position determination.

[0085] In an exemplary embodiment, based on the first sphere center position on the first inner normal line, constructing a first sphere with the largest radius and not colliding with any surface structure includes: constructing a first initial sphere based on the initial radius and the first sphere center position on the first inner normal line; in the case where the first initial sphere does not collide with any surface structure, adding the radius step size to the initial radius to obtain an updated initial radius; returning to the step of constructing the first initial sphere based on the initial radius and the first sphere center position on the first inner normal line until the first initial sphere constructed in the current round collides with at least one surface structure; taking the first initial sphere constructed in the previous round as the first sphere corresponding to the first inner normal line.

[0086] Wherein, the initial radius refers to the radius of the sphere set in the initial situation. The first initial sphere is the sphere constructed with the first sphere center position as the center of the sphere. The radius step size refers to the step size of the radius increase and can also be preset.

[0087] Specifically, the terminal can first construct a first initial sphere with the initial radius and the position of the first sphere center on the first inner normal as the radius and the center of the first initial sphere respectively, and determine whether the first initial sphere collides with the surface structure. In the case where the first initial sphere does not collide with any surface structure, the initial radius is superimposed with the radius step length to obtain an updated initial radius. Then, based on the updated initial radius and the position of the first sphere center, a new sphere is reconstructed. The above steps are repeated until the first initial sphere constructed in the current round collides with at least one surface structure, indicating that the volume of the sphere has reached the upper limit. At this time, the first initial sphere constructed in the previous round can be used as the first sphere corresponding to the first inner normal.

[0088] In this embodiment, based on the collision situation between the sphere and the surface structure, the volume of the sphere is superimposed by the radius step length repeatedly, and finally a first sphere with the largest radius and without collision with other surface structures is obtained, which can ensure the stability and accuracy of the sphere construction.

[0089] In an exemplary embodiment, for the second inner normal other than the first inner normal among the inner normals, a second sphere with the largest radius and without collision with any constructed sphere is constructed based on the position of the second sphere center on the second inner normal, including: for the second inner normal other than the first inner normal among the inner normals, a second initial sphere is constructed based on the initial radius and the position of the second sphere center on the second inner normal; in the case where the second initial sphere does not collide with any constructed sphere, the initial radius is superimposed with the radius step length to obtain an updated initial radius; return to the step of constructing the second initial sphere based on the initial radius and the position of the second sphere center on the second inner normal until the second initial sphere constructed in the current round collides with at least one constructed sphere; use the second initial sphere constructed in the previous round as the second sphere corresponding to the second inner normal.

[0090] Wherein, the second initial sphere refers to a sphere constructed with the initial radius as the radius of the sphere and the position of the second sphere center as the center of the sphere.

[0091] Specifically, the terminal can construct a second initial sphere for the second inner normal other than the first inner normal among the inner normals based on the initial radius and the position of the second sphere center on the second inner normal, and determine whether the second initial sphere collides with any constructed sphere. In the case of no collision, the initial radius is superimposed with the radius step length to obtain an updated initial radius, and return to the step of constructing the second initial sphere based on the initial radius and the position of the second sphere center on the second inner normal until the second initial sphere constructed in the current round collides with at least one constructed sphere. Use the second initial sphere constructed in the previous round as the second sphere corresponding to the second inner normal. It can be understood that all spheres other than the first sphere can be used as the second sphere.

[0092] In this embodiment, based on the collision situation between the sphere and the spheres that have been constructed, the volume of the sphere is accumulated step by step by the radius step length, and finally a second sphere with the largest radius and no collision with other constructed spheres is obtained, which can ensure the stability and accuracy of sphere construction.

[0093] In a specific embodiment, as Figure 3 shown, there is also provided an approximate method for constructing a sphere set collision model, including:

[0094] Step 1: Generate a normal set based on a CAD (Computer-Aided Design) model: An STL (Standard Triangle Language File, a file format for describing the surface of a three-dimensional object) file contains a surface mesh . For a triangular facet , the vertices are respectively , , For a set of triangular facets , it is necessary to calculate the normal to solve the maximum spherical coverage. A normal contains a normal starting point and an inward normal vector .

[0095] Step 2: For a triangular facet , the vertices are respectively , , calculate the initial inward normal vector : , and the normal starting point is selected as the average point of the three vertices of the triangular facet: . Then, normalize the initial inward normal vector: .

[0096] Step 3: Determine the inward normal vector of the edge, and normalize : .

[0097] Step 4: Determine whether the termination generation condition is satisfied, and find the center of the maximum coverage sphere and the radius of the sphere in the normal direction:

[0098] Given a normal starting point and an inward normal vector , as well as the representation inside the convex hull, the following are the steps for calculating the sphere with the maximum volume in the normal direction:

[0099] Initialization:

[0100] Minimum radius: ;

[0101] Maximum radius: Determined according to the size of the convex hull;

[0102] Determine the distance threshold and the maximum initial radius :

[0103] Search within the interval to find the maximum radius of the sphere that does not collide with other spheres in the convex hull. For each initial radius, first determine the center position of the sphere. The center position of the sphere: and check whether the spheres in the normal direction intersect with other spheres in the convex hull. And whether it intersects with the surface of the existing obstacles. Iterate the radius step until the maximum radius that does not intersect with other surfaces and spheres is found, denoted as . Re-select a larger distance threshold , calculate the maximum radius. If the radius is greater than the previously recorded maximum radius, update the maximum radius. Update or adjust the search interval until the end condition is met.

[0104] Output result: The maximum center and the maximum radius: , , as Figure 4 shown, which is the process of forming a sphere set by the target object from a three-dimensional model with surface normals. Figure 5 It is the model diagram for approximating the cooperative robot with spheres.

[0105] In a specific embodiment, as Figure 6 shown, a method for constructing an approximation of a sphere set collision model is also provided, including:

[0106] Step S601, obtain the three-dimensional information of the target object;

[0107] Among them, the three-dimensional information includes the position information of each of the multiple surface structures of the target object; the surface structures include triangular patches and edges; the position information includes the vertex position information of each of the multiple vertices of the triangular patch and the position information of the edge; the inner normal is characterized by the inner normal vector and the starting point of the normal;

[0108] Step S602, for each triangular patch, perform normal vector analysis on the vertex position information to determine the initial inner normal vector of the triangular patch;

[0109] Step S603, perform normalization processing on the initial inner normal vector to determine the inner normal vector of the triangular patch, perform average value statistics on the vertex position information to determine the starting point of the normal of the triangular patch;

[0110] Step S604: For each edge, obtain the adjacent inner normal vectors of the multiple triangular patches adjacent to the edge respectively;

[0111] Step S605: Perform an average value statistics on the adjacent inner normal vectors, determine the inner normal vector of the edge, and determine the position information as the normal starting point of the edge;

[0112] Step S606: Obtain a distance threshold. For the first inner normal among the inner normals that serves as the modeling starting point, based on the distance threshold, determine the first sphere center position on the first inner normal;

[0113] Wherein, the distance between the first sphere center position and the first normal starting point of the first inner normal is the distance threshold;

[0114] Step S607: Based on the initial radius and the first sphere center position on the first inner normal, construct the first initial sphere;

[0115] Step S608: Determine whether the first initial sphere collides with any surface structure;

[0116] If not, execute Step S609: Add the radius step size to the initial radius to obtain an updated initial radius;

[0117] Return to the step of Step S607;

[0118] If so, execute Step S610: Take the first initial sphere constructed in the previous round as the first sphere corresponding to the first inner normal;

[0119] Step S611: For the second inner normal among the inner normals other than the first inner normal, based on the initial radius and the second sphere center position on the second inner normal, construct the second initial sphere;

[0120] Step S612: Determine whether the second initial sphere collides with any of the spheres that have been constructed;

[0121] If not, execute Step S613: Add the radius step size to the initial radius to obtain an updated initial radius;

[0122] Return to the step of Step S611;

[0123] If so, execute Step S614: Take the second initial sphere constructed in the previous round as the second sphere corresponding to the second inner normal;

[0124] Step S615: When each of the constructed spheres fills the target object, obtain the sphere set of the target object;

[0125] Wherein, the sphere set is used for collision prediction of the target object.

[0126] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are sequentially shown according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear indication in this article, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or in turn with at least a part of other steps or steps or stages in other steps.

[0127] Based on the same inventive concept, an embodiment of the present application further provides a ball set collision model construction approximation device for implementing the ball set collision model construction approximation method described above. The solution provided by this device to solve the problem is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the ball set collision model construction approximation device provided below can refer to the limitations on the ball set collision model construction approximation method in the above text, and will not be repeated here.

[0128] In an exemplary embodiment, as Figure 7 shown, a ball set collision model construction approximation device 700 is provided, including: an inner normal acquisition module 702, a first sphere construction module 704, a second sphere construction module 706, and a ball set determination module 708, where:

[0129] The inner normal acquisition module 702 is configured to acquire the inner normals of the respective surface structures of the target object.

[0130] The first sphere construction module 704 is configured to, for the first inner normal among the inner normals that serves as the modeling starting point, construct a first sphere with the largest radius and that does not collide with any surface structure based on the first sphere center position on the first inner normal.

[0131] The second sphere construction module 706 is configured to, for the second inner normal among the inner normals other than the first inner normal, construct a second sphere with the largest radius and that does not collide with any of the already constructed spheres based on the second sphere center position on the second inner normal.

[0132] The ball set determination module 708 is configured to obtain the ball set of the target object when each of the already constructed spheres fills the target object; the ball set is used for collision prediction of the target object.

[0133] In one embodiment, the inner normal acquisition module 702 includes: a three-dimensional information acquisition unit that acquires three-dimensional information of a target object; the three-dimensional information includes the position information of each of the multiple surface structures of the target object; an inner normal determination unit that, for each surface structure, determines the inner normal of the surface structure according to the position information.

[0134] In one embodiment, the surface structure includes triangular patches; the position information includes the vertex position information of each of the multiple vertices of the triangular patch; the inner normal is characterized by an inner normal vector and a normal starting point. In the case of this embodiment, the inner normal determination unit is specifically configured to: for each triangular patch, perform a normal vector analysis on the vertex position information to determine the initial inner normal vector of the triangular patch;

[0135] Perform a normalization process on the initial inner normal vector to determine the inner normal vector of the triangular patch;

[0136] Perform an average value statistics on the vertex position information to determine the normal starting point of the triangular patch.

[0137] In one embodiment, the surface structure includes an edge; the position information includes the position information of the edge. In the case of this embodiment, the inner normal determination unit is specifically configured to: for each edge, acquire the adjacent inner normal vectors of the multiple triangular patches adjacent to the edge;

[0138] Perform an average value statistics on the adjacent inner normal vectors to determine the inner normal vector of the edge, and determine the position information as the normal starting point of the edge.

[0139] In one embodiment, the spherical set collision model construction approximation device 700 further includes a first spherical center position determination module, which is specifically configured to: acquire a distance threshold;

[0140] For the first inner normal among the inner normals that serves as the modeling starting point, based on the distance threshold, determine the first spherical center position on the first inner normal;

[0141] The distance between the first spherical center position and the first normal starting point of the first inner normal is the distance threshold.

[0142] In one embodiment, the first sphere construction module 704 is specifically configured to: construct a first initial sphere based on the initial radius and the first spherical center position on the first inner normal;

[0143] In the case where the first initial sphere does not collide with any surface structure, add the radius step size to the initial radius to obtain an updated initial radius;

[0144] Return to the step of constructing the first initial sphere based on the initial radius and the first spherical center position on the first inner normal until the first initial sphere constructed in the current round collides with at least one surface structure;

[0145] Use the first initial sphere constructed in the previous round as the first sphere corresponding to the first inner normal line.

[0146] In one embodiment, the second sphere construction module 706 is specifically configured to: for each second inner normal line other than the first inner normal line among the inner normal lines, construct a second initial sphere based on the initial radius and the position of the second sphere center on the second inner normal line;

[0147] In the case where the second initial sphere does not collide with any of the already constructed spheres, add the radius step size to the initial radius to obtain an updated initial radius;

[0148] Return to the step of constructing the second initial sphere based on the initial radius and the position of the second sphere center on the second inner normal line until the second initial sphere constructed in the current round collides with at least one of the already constructed spheres;

[0149] Use the second initial sphere constructed in the previous round as the second sphere corresponding to the second inner normal line.

[0150] Each module in the above spherical set collision model construction approximation device can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or be independent of it, or can be stored in the memory of the computer device in software form, so as to facilitate the processor to call and execute the operations corresponding to the above respective modules.

[0151] In an exemplary embodiment, a computer device is provided. The computer device can be a terminal, and its internal structure diagram can be as Figure 8As shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, near field communication (NFC), or other technologies. When the computer program is executed by the processor, it realizes an approximate method for constructing a ball set collision model. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covered on the display screen, or a button, a trackball, or a touchpad set on the computer device housing, or an external keyboard, touchpad, or mouse, etc.

[0152] Those skilled in the art can understand that Figure 8 the structure shown in the figure is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements.

[0153] In one embodiment, a computer device is provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps of the above method are realized.

[0154] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the steps of the above method are realized.

[0155] In one embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the steps of the above method are realized.

[0156] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.

[0157] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., and are not limited thereto. The processors involved in the embodiments provided in this application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, artificial intelligence (AI) processors, etc., and are not limited thereto.

[0158] The technical features of the above embodiments can be combined arbitrarily. For the sake of concise description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope recorded in this application.

[0159] The above-described embodiments merely represent several implementation manners of this application. The description is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of this application. It should be noted that for those of ordinary skill in the art, without departing from the concept of this application, several deformations and improvements can still be made, and these all belong to the protection scope of this application. Therefore, the protection scope of this application shall be subject to the appended claims.

Claims

1. A method for constructing a ball set collision model, characterized in that: The method comprises: Acquire three-dimensional information of the target object; the three-dimensional information includes position information of each of a plurality of surface structures of the target object; the surface structure includes triangular facets and edges; the position information includes position information of the edges; For each of the surface structures, determining an internal normal of the surface structure according to the respective position information of the plurality of surface structures of the target object; the internal normal is represented by an internal normal vector and a normal starting point; For a first inner normal line among the inner normal lines that serves as a modeling starting point, based on a first sphere center position on the first inner normal line, construct a first sphere with a maximum radius that does not collide with any of the surface structures; For each of the second inner normals except the first inner normal, based on the second sphere center position on the second inner normal, construct a second sphere with the largest radius that does not collide with any constructed sphere; When each of the constructed spheres fills the target object, a sphere set of the target object is obtained; the sphere set is used to perform collision prediction on the target object; The step of determining the inner normal of each of the surface structures according to the respective position information of the plurality of surface structures of the target object comprises: For each of the edges, obtaining adjacent inner normal vectors of a plurality of triangular facets adjacent to the edge; An average value of each of the adjacent inner normal vectors is calculated to determine the inner normal vector of the edge, and the position information of the edge is determined as the normal starting point of the edge.

2. The method according to claim 1, characterized in that The position information also includes vertex position information of each of the multiple vertices of the triangular facet; and for each of the surface structures, determining the internal normal of the surface structure according to the position information of each of the multiple surface structures of the target object further includes: For each of the triangular face patches, performing normal vector analysis on the position information of each vertex to determine an initial internal normal vector of the triangular face patch; Normalizing the initial internal normal vector to determine the internal normal vector of the triangle; The average value of each vertex position information is calculated to determine the normal starting point of the triangle face.

3. The method according to claim 1, characterized in that The method further comprises: Get the distance threshold; For a first internal normal line among the internal normal lines, which is used as a modeling starting point, determining a first sphere center position on the first internal normal line based on the distance threshold; The distance between the first sphere center position and the first normal starting point of the first inner normal is the distance threshold.

4. The method according to claim 1, characterized in that: The step of constructing a first sphere having a maximum radius and not colliding with any of the surface structures based on the first sphere center position on the first inner normal line comprises: Constructing a first initial sphere based on an initial radius and a first sphere center position on the first inner normal line; When the first initial sphere does not collide with any of the surface structures, the initial radius is superimposed with the radius step to obtain an updated initial radius; Returning to the step of constructing a first initial sphere based on the initial radius and the first sphere center position on the first inner normal, until the first initial sphere constructed in the current round collides with at least one of the surface structures; The first initial sphere constructed in the previous round is used as the first sphere corresponding to the first internal normal.

5. The method according to claim 4, characterized in that The step of constructing a second sphere having the largest radius and not colliding with any constructed sphere based on the second sphere center position on the second sphere center line of each of the inner normal lines except the first inner normal line comprises: For a second inner normal line other than the first inner normal line among the inner normal lines, construct a second initial sphere based on an initial radius and a second sphere center position on the second inner normal line; When the second initial sphere does not collide with any constructed sphere, the initial radius is superimposed with the radius step to obtain an updated initial radius; Returning to the step of constructing a second initial sphere based on the initial radius and the second sphere center position on the second inner normal, until the second initial sphere constructed in the current round collides with at least one of the constructed spheres; The second initial sphere constructed in the previous round is used as the second sphere corresponding to the second internal normal.

6. A ball set collision model construction device, characterized in that: The device comprises: A three-dimensional information acquisition unit, used to acquire three-dimensional information of a target object; the three-dimensional information includes position information of each of a plurality of surface structures of the target object; the surface structures include triangular facets and edges; the position information includes position information of the edges; An internal normal determining unit, configured to determine, for each of the surface structures, an internal normal of the surface structure according to respective position information of a plurality of surface structures of the target object; the internal normal is represented by an internal normal vector and a normal starting point; A first sphere construction module is used to construct a first sphere with the largest radius and not colliding with any of the surface structures based on the first sphere center position on the first inner normal line among the inner normal lines as the modeling starting point; A second sphere construction module is used to construct a second sphere with the largest radius and not colliding with any constructed sphere based on the second sphere center position on the second inner normal line among the inner normal lines except the first inner normal line; A ball set determination module, used to obtain a ball set of the target object when each of the constructed spheres fills the target object; the ball set is used to perform collision prediction on the target object; The internal normal determination unit is specifically used for: For each of the edges, obtaining adjacent inner normal vectors of a plurality of triangular facets adjacent to the edge; An average value of each of the adjacent inner normal vectors is calculated to determine the inner normal vector of the edge, and the position information of the edge is determined as the normal starting point of the edge.

7. The device according to claim 6, characterized in that The position information also includes vertex position information of each of the multiple vertices of the triangular face; the internal normal determination unit is further used to: For each of the triangular face patches, performing normal vector analysis on the position information of each vertex to determine an initial internal normal vector of the triangular face patch; Normalizing the initial internal normal vector to determine the internal normal vector of the triangle; The average value of each vertex position information is calculated to determine the normal starting point of the triangle face.

8. The device according to claim 6, characterized in that The device also includes a first ball center position determination module, which is specifically used to: Get the distance threshold; For a first internal normal line among the internal normal lines, which is used as a modeling starting point, determining a first sphere center position on the first internal normal line based on the distance threshold; The distance between the first sphere center position and the first normal starting point of the first inner normal is the distance threshold.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Multi-type collision detection method and system of BIM lightweight model

    CN116305386A