Ball set collision model construction approximation method and device, computer equipment, readable storage medium and program product
By constructing the ball collection model of the target object, the sphere model is used to make a collision prediction, which solves the problem of complexity of the concave bag in the traditional modeling method, and reduces the difficulty of collision judgment.
Patent Information
- Application Number
- CN202411875762.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-12-19
AI Technical Summary
When traditional modeling methods make object collision judgment, especially the collision judgment process of concave packs is complicated, which makes collision judgment difficult.
A set of approximation methods of a ball collection collision model are proposed. By obtaining the internal method line of multiple surface structures of the target object, a sphere that has the largest radius and does not collide with any surface structure to form a ball collection of target objects for collision prediction.
The difficulty of the collision judgment process is reduced, and effective collision prediction of the target object is achieved through a simple sphere model.
Smart Images

Figure CN119339032A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of modeling technology, and in particular to an approximate method, device, computer equipment, readable storage medium and program product for constructing a ball set collision model. Background Art
[0002] With the development of modeling technology, methods based on modeling technology have emerged to predict the collision process of objects. Actual objects can be modeled into three-dimensional models, and collisions of objects can be predicted to avoid losses caused by collisions.
[0003] Traditional modeling methods generally convert objects into three-dimensional models including convex hulls and concave hulls, and perform collision judgment on each convex hull in the object with other convex hulls or concave hulls. However, the collision judgment process of the concave hull is extremely complicated compared to that of the convex hull. Using traditional modeling methods for modeling has the problem of difficulty in the collision judgment process. Summary of the invention
[0004] Based on this, it is necessary to provide an approximate method, device, computer equipment, readable storage medium and program product for constructing a ball set collision model that can reduce the difficulty of the collision judgment process in response to the above technical problems.
[0005] In a first aspect, the present application provides an approximate method for constructing a ball set collision model, comprising:
[0006] Obtaining respective internal normals of multiple surface structures of the target object;
[0007] 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;
[0008] 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;
[0009] 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.
[0010] In one embodiment, obtaining internal normals of a plurality of surface structures of the target object includes:
[0011] 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;
[0012] For each of the surface structures, an inner normal of the surface structure is determined according to the position information.
[0013] In one embodiment, the surface structure includes a triangular face; the position information includes vertex position information of each of the plurality of vertices of the triangular face; the internal normal is represented by an internal normal vector and a normal starting point; and for each of the surface structures, determining the internal normal of the surface structure according to the position information includes:
[0014] 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;
[0015] Normalizing the initial internal normal vector to determine the internal normal vector of the triangle;
[0016] The average value of each vertex position information is calculated to determine the normal starting point of the triangle face.
[0017] In one embodiment, the surface structure includes an edge; the position information includes position information of the edge; and for each of the surface structures, determining the inner normal of the surface structure according to the position information comprises:
[0018] For each of the edges, obtaining adjacent inner normal vectors of a plurality of triangular facets adjacent to the edge;
[0019] 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 is determined as the normal starting point of the edge.
[0020] In one embodiment, the ball set collision model construction approximation method further includes:
[0021] Get the distance threshold;
[0022] 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;
[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 line, constructing a first sphere with the largest radius and not colliding with any of the surface structures comprises:
[0025] Constructing a first initial sphere based on an initial radius and a first sphere center position on the first inner normal line;
[0026] 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;
[0027] 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;
[0028] The first initial sphere constructed in the previous round is used as the first sphere corresponding to the first internal normal.
[0029] In one embodiment, for a second inner normal other than the first inner normal among the inner normals, based on the second sphere center position on the second inner normal, constructing a second sphere with the largest radius that does not collide with any constructed sphere includes:
[0030] 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;
[0031] 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;
[0032] 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;
[0033] The second initial sphere constructed in the previous round is used as the second sphere corresponding to the second internal normal.
[0034] In a second aspect, the present application also provides an approximate device for constructing a ball set collision model, comprising:
[0035] An internal normal acquisition module, used to acquire internal normals of multiple surface structures of the target object;
[0036] 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;
[0037] 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;
[0038] The ball set determination module is used to obtain the 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.
[0039] In a third aspect, the present application further provides a computer device, wherein the computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the above method are implemented.
[0040] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0041] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0042] The above-mentioned ball set collision model construction approximate method, device, computer equipment, readable storage medium and program product obtain the internal normals of each of the multiple surface structures of the target object, and for the first internal normal as the modeling starting point among the internal normals, based on the first sphere center position on the first internal normal, construct the first sphere with the largest radius and not colliding with any surface structure, so that the first sphere modeled by the target object can be determined as the modeling support of the target object, and then for the second internal normal except the first internal normal among the internal normals, based on the second sphere center position on the second internal normal, construct the second sphere with the largest radius and not colliding with any constructed sphere, so that each maximum sphere except the first sphere can be determined, and when each constructed sphere fills the target object, the ball set of the target object is obtained, and the maximum non-collision sphere model of the target object can be formed, wherein the ball set is used to predict the collision 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 the model construction, the above-mentioned method is used to predict the collision of the target object, which can reduce the difficulty of collision prediction. BRIEF 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 drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0044] Figure 1 A diagram of an application environment for a ball set collision model construction approximation method in one embodiment;
[0045] Figure 2 A schematic diagram of a process for constructing an approximate method for a ball set collision model in one embodiment;
[0046] Figure 3 A schematic flow chart of the steps for constructing an approximate ball set collision model in one embodiment;
[0047] Figure 4 A schematic diagram of sphere coverage for an approximate method for constructing a ball set collision model in one embodiment;
[0048] Figure 5 A model diagram of an approximate method for constructing a ball set collision model in one embodiment;
[0049] Figure 6 A model diagram of a sphere approximation of a collaborative robot mechanical arm in another embodiment;
[0050] Figure 7 A block diagram of a device for constructing an approximation of a ball set collision model in one embodiment;
[0051] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0052] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with 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 ball set collision model construction approximation method provided in the embodiment of the present application can be applied to 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 not limited to various personal computers, laptops, smart phones, tablets, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted devices can be virtual reality (VR) devices, augmented reality (AR) devices, smart glasses, etc. The image acquisition device 104 can be integrated in the terminal or can be a separate device for collecting image information of the target object so that the terminal can analyze the target object based on the image information and determine the internal normals of multiple surface structures of the target object. Specifically, in the process of approximating the construction of the ball set collision model, the terminal 102 obtains the internal normals of multiple surface structures of the target object captured by the image acquisition device 104; for the first internal normal among each internal normal that serves as the starting point of modeling, based on the first sphere center position on the first internal normal, a first sphere with the largest radius that does not collide with any surface structure is constructed; for the second internal normal among each internal normal except the first internal normal, based on the second sphere center position on the second internal normal, a second sphere with the largest radius that does not collide with any constructed sphere is constructed; when each constructed sphere fills the target object, a ball set of the target object is obtained; the ball set is used to predict the collision of the target object.
[0054] In an exemplary embodiment, Figure 2 As shown in the figure, an approximate method for constructing a ball set collision model is provided, which can be applied to Figure 1 The following is an example of a terminal in the example, including:
[0055] Step S202: acquiring internal normals of a plurality of surface structures of the target object.
[0056] Among them, the target object refers to the object to be predicted in 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 the time. The surface structure refers to the morphology and characteristics of the surface of the target object. In this embodiment, the surface structure refers to the vertices, edges, and triangular faces of the three-dimensional model to which the target object belongs. The internal normal refers to the vector that is perpendicular to the tangent plane at a point on the surface. In three-dimensional space, the internal normal is a vertical vector at a point on the surface, which is perpendicular to the tangent plane of the surface at that point. The direction of the internal normal usually points to the inside of the surface, hence the name "internal normal".
[0057] Specifically, in order to determine the ball set of the target object, it is necessary to first determine the surface structures of the target object, and then determine the internal normals of each surface structure. It can be understood that the process of obtaining the internal normals of each of the multiple surface structures of the target object can be actively obtained or passively received. In a specific embodiment, the surface structure includes a triangular face, the position information includes the vertex position information of each of the multiple vertices of the triangular face, and the internal normal is represented by an internal normal vector and a normal starting point. In the case of this embodiment, the terminal can analyze the normal vector of each vertex position information for each triangular face, determine the initial internal normal vector of the triangular face, normalize the initial internal normal vector, determine the internal normal vector of the triangular face, perform average statistics on the position information of each vertex, and determine the normal starting point of the triangular face. In another specific embodiment, the surface structure includes an edge, and the position information includes the position information of the edge. In the case of this embodiment, the terminal can obtain the adjacent internal normal vectors of each of the multiple triangular faces adjacent to the edge for each edge, perform average statistics on each adjacent internal normal vector, determine the internal 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 line among the inner normal lines that serves as the modeling starting point, based on the first sphere center position on the first inner normal line, construct a first sphere with the largest radius 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, a physical model or a computer model. The first internal normal is the internal normal that serves as the modeling starting point among the internal normals. Exemplarily, the first internal normal can be selected according to preset conditions or randomly selected. The first center position refers to the position of the center of the ball located on the first internal normal. The first sphere is a sphere with the first center position as the center, the largest radius, and does not collide with any surface structure.
[0060] Specifically, after determining the internal normals of each 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. In order to ensure that the spheres in the sphere set can finally fully fill the target object, the first sphere must be maximized and cannot collide with any surface structure. Therefore, the terminal can construct a first sphere with the largest radius and not colliding with any surface structure based on the first center position on the first internal normal for the first internal normal as the modeling starting point. In a specific embodiment, based on the initial radius and the first center position on the first internal normal, the first initial sphere is constructed. When the first initial sphere does not collide with any surface structure, the initial radius is superimposed with the radius step 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 internal normal is returned until the first initial sphere constructed in the current round collides with at least one surface structure, and the first initial sphere constructed in the previous round is used as the first sphere corresponding to the first internal normal.
[0061] In another specific embodiment, a first sphere modeling model may be established. For the first inner normal among the inner normals serving as the modeling starting point, the first sphere center position on the first inner normal is input into the first sphere modeling model. The first sphere with the largest radius and which does not collide with any surface structure is constructed through the first sphere modeling model.
[0062] Step S206: for each inner normal 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.
[0063] The second inner normal is the inner normal other than the first inner normal selected as the inner normal for sphere modeling. The second sphere center position refers to the position of the sphere center located on the second inner normal. The second sphere is a sphere with the second sphere center position as the sphere center, the largest radius, and does not collide with any constructed sphere. The constructed sphere refers to the sphere that has been constructed by the target object.
[0064] Specifically, after constructing the first sphere with the largest radius and not colliding with any surface structure, the other second spheres in the target object except the first sphere can be established. In order to ensure the accuracy of the sphere set of the target object, it is necessary to ensure that each second sphere will not collide with the previously constructed sphere, that is, except for the first sphere, all other second spheres are modeled in the same way, but for different constructed spheres. Therefore, the terminal can 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 for the second inner normal line except the first inner normal line among the inner normal lines. In a specific embodiment, the terminal can construct a second initial sphere for the second inner normal except the first inner normal among each inner normal based on the initial radius and the second center position on the second inner normal. When the second initial sphere does not collide with any constructed sphere, the initial radius is superimposed on the radius step 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 inner normal 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 inner normal.
[0065] In another specific embodiment, a second sphere modeling model may also be established. For each second inner normal except the first inner normal, the second sphere center position on the second inner normal is input into the second sphere modeling model. The second sphere modeling model is used to construct a second sphere with the largest radius that does not collide with any constructed sphere.
[0066] Step S208, when each constructed sphere fills the target object, a sphere set of the target object is obtained.
[0067] The ball set includes multiple spheres, which are used to predict the collision of the target object.
[0068] Specifically, after the first sphere and the second sphere have been constructed, and each constructed sphere fills the target object, the sphere set of the target object can be obtained. It can be understood that not every internal normal line will perform the sphere construction step, and when different first internal normal lines are selected to construct the first sphere, the second sphere will also be different, and the sphere set corresponding to the target object will also be different.
[0069] In the above-mentioned ball set collision model construction approximation method, the internal normals of the multiple surface structures of the target object are obtained, and for the first internal normal as the modeling starting point among the internal normals, based on the first sphere center position on the first internal normal, a first sphere with the largest radius and not colliding with any surface structure is constructed, so that the first sphere modeled by the target object can be determined as the modeling support of the target object, and then for the second internal normal except the first internal normal among the internal normals, based on the second sphere center position on the second internal normal, a second sphere with the largest radius and not colliding with any constructed sphere is constructed, so that each maximum sphere except the first sphere can be determined, and when each constructed sphere fills the target object, a ball set of the target object is obtained, and the maximum non-collision sphere model of the target object can be formed, wherein the ball set is used to perform collision prediction on the target object. Since the three-dimensional model of the target object includes multiple spheres, and the sphere is the simplest convex hull in the model construction, the above-mentioned method is used to perform collision prediction on the target object, which can reduce the difficulty of collision prediction.
[0070] In an exemplary embodiment, obtaining internal normals of a plurality of surface structures of a target object includes: obtaining three-dimensional information of the target object; and determining, for each surface structure, an internal normal of the surface structure according to position information.
[0071] The three-dimensional information generally refers to data required to describe an object or scene in a three-dimensional space. In this embodiment, the three-dimensional information includes position information of multiple surface structures of the target object.
[0072] Specifically, in order to determine the internal normals 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, and then the internal normal of each surface structure can be determined according to the position information of each of the multiple surface structures in the three-dimensional information to ensure the accuracy of the internal normal determination process.
[0073] In an exemplary embodiment, the surface structure includes a triangular face; the position information includes the vertex position information of each of the multiple vertices of the triangular face; the internal normal is represented by an internal normal vector and a normal starting point; for each surface structure, the internal normal of the surface structure is determined according to the position information, including: for each triangular face, performing a normal vector analysis on the position information of each vertex to determine the initial internal normal vector of the triangular face; normalizing the initial internal normal vector to determine the internal normal vector of the triangular face; and performing average value statistics on the position information of each vertex to determine the normal starting point of the triangular face.
[0074] Among them, a triangle is a geometric representation method widely used in computer graphics to simulate the surface of a three-dimensional object, including multiple vertices, and the position information of each vertex is the vertex position information. The internal normal vector is a vector tangent to the surface or plane, and the normal starting point refers to the starting point of the internal normal on the triangle. The initial internal normal vector refers to the internal normal vector that has not been normalized.
[0075] Specifically, the surface structure includes triangular patches. For each triangular patch, its normal starting point and internal normal vector need to be determined. Since the triangular patch includes three vertices, when determining the initial internal normal vector of the triangular patch, it is necessary to perform normal vector analysis on the position information of each vertex, so as to determine the initial internal normal vector of the triangular patch, and then normalize the initial internal normal vector to determine the internal normal vector of the triangular patch. The normal starting point is the position of the average point of the three vertices, that is, it is necessary to perform average value statistics on the vertex position information to determine the normal starting point of the triangular patch.
[0076] In a specific embodiment, for a triangular patch The vertices are , , calculate the initial internal normal vector : , the starting point of the normal line is the average point of the three vertices of the triangle: . Afterwards, the initial internal normal vector is normalized: .
[0077] In this embodiment, by performing average value statistics on the vertices of the triangle patch to obtain the normal starting point of the triangle patch, performing normal vector analysis on the vertex position information, and determining the initial internal normal vector of the triangle patch, the accuracy of determining the internal normal of the triangle patch can be improved, thereby improving the accuracy of determining the ball set.
[0078] In an exemplary embodiment, the surface structure includes edges; the position information includes position information of the edges; for each surface structure, the internal normal of the surface structure is determined according to the position information, including: for each edge, obtaining adjacent internal normal vectors of multiple triangular facets adjacent to the edge; performing average statistics on each adjacent internal normal vector to determine the internal normal vector of the edge, and determining the position information as the starting point of the normal of the edge.
[0079] The edge refers to the edge of the target object, for example, the edge may include the vertex and the edge of the target object. The adjacent internal normal vectors refer to the internal normal vectors that are adjacent to each other.
[0080] Specifically, the surface structure includes edges, and the position information includes the position information of the edges, which is the starting point of the normal of the edge. When determining the internal normal vector of the edge, it is necessary to first determine the internal normal vectors of each of the triangles adjacent to the edge as the adjacent internal normal vectors, and perform average statistics on the above adjacent internal normal vectors to determine the internal normal vector of the edge.
[0081] In this embodiment, the position information of the edge is used as the starting point of the normal of the edge, and the average value analysis is performed on the internal normal vectors of the triangles adjacent to the edge to determine the internal normal vector of the edge. This can improve the accuracy of determining the internal normal of the edge, and further improve the accuracy of determining the ball set.
[0082] In an exemplary embodiment, the ball set collision model construction approximation method further includes: obtaining a distance threshold; and determining the first ball center position on the first internal normal line serving as a modeling starting point among the internal normal lines based on the distance threshold.
[0083] Among them, the distance between the first sphere center position and the first normal starting point of the first inner normal is the distance threshold. It can be understood that the distance threshold can be pre-set based on actual conditions and is not limited here.
[0084] Specifically, the terminal can obtain a preset distance threshold, and determine the first inner normal as the modeling starting point from each inner normal, and determine the first sphere center position in the first inner normal based on the distance threshold, that is, the distance between the first sphere center position and the normal starting point of the first inner normal is the distance threshold. It can be understood that the distance threshold is not completely fixed and can be determined according to actual conditions, that is, the first sphere center position is not unique, which can improve the flexibility of determining the sphere center position.
[0085] In an exemplary embodiment, based on the first sphere center position on the first inner normal, a first sphere with the largest radius that does not collide with any surface structure is constructed, including: constructing the first initial sphere based on the initial radius and the first sphere center position on the first inner normal; when the first initial sphere does not collide with any surface structure, superimposing the radius step on 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 until the first initial sphere constructed in the current round collides with at least one surface structure; and using the first initial sphere constructed in the previous round as the first sphere corresponding to the first inner normal.
[0086] The initial radius refers to the radius of the sphere set in the initial state. The first initial sphere is a sphere constructed with the first sphere center position as the sphere center. The radius step refers to the step length of the radius increase, which can also be pre-set.
[0087] Specifically, the terminal can first construct the first initial sphere based on the initial radius and the first center position on the first inner normal as the radius and center of the first initial sphere respectively, and determine whether the first initial sphere collides with the surface structure. When the first initial sphere does not collide with any surface structure, the initial radius is superimposed on the radius step to obtain an updated initial radius, and then a new sphere is reconstructed based on the updated initial radius and the first center position. The above steps are repeated until the first initial sphere constructed in the current round collides with at least one surface structure, which means 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 between the sphere and the surface structure, the volume of the sphere is repeatedly superimposed through the radius step, and finally a first sphere with the largest radius that does not collide with other surface structures is obtained, which can ensure the stability and accuracy of the sphere construction.
[0089] In an exemplary embodiment, for each inner normal except the first inner normal, a second sphere with the largest radius that does not collide with any constructed sphere is constructed based on the second sphere center position on the second inner normal, including: for each inner normal except the first inner normal, a second initial sphere is constructed based on the initial radius and the second sphere center position on the second inner normal; 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 the 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 constructed sphere; and the second initial sphere constructed in the previous round is used as the second sphere corresponding to the second inner normal.
[0090] The second initial sphere refers to a sphere constructed with the initial radius as the sphere radius and the second sphere center position as the sphere center.
[0091] Specifically, the terminal can construct a second initial sphere based on the initial radius and the second sphere center position on the second internal normal for each internal normal except the first internal normal, and determine whether the second initial sphere collides with any constructed sphere. If no collision occurs, the initial radius is superimposed on the radius step to obtain an updated initial radius, and the step of constructing the second initial sphere based on the initial radius and the second sphere center position on the second internal normal 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 internal normal. It can be understood that all spheres except the first sphere can be used as the second sphere.
[0092] In this embodiment, based on the collision between the sphere and the constructed sphere, the volume of the sphere is repeatedly superimposed by the radius step, and finally a second sphere with the largest radius that does not collide with other constructed spheres is obtained, which can ensure the stability and accuracy of the sphere construction.
[0093] In a specific embodiment, Figure 3 As shown, an approximate method for constructing a ball set collision model is also provided, 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 used to describe the surface of a three-dimensional object) file contains the surface mesh For triangles The vertices are , , For a collection of triangles , you need to calculate the normal to solve the maximum spherical coverage, a normal includes the normal starting point and the inner normal vector .
[0095] Step 2: For the triangle patch The vertices are , , calculate the initial internal normal vector : , the starting point of the normal line is the average point of the three vertices of the triangle: . Afterwards, the initial internal normal vector is normalized: .
[0096] Step 3: Determine the inner normal vector of the edge , and Perform normalization: .
[0097] Step 4: Determine whether the termination generation conditions are met and find the maximum coverage sphere center and sphere radius in the normal direction:
[0098] Given a normal starting point and the inner normal vector , and the representation of the interior of the convex hull, the following are the steps to calculate the maximum volume sphere in the normal direction:
[0099] initialization:
[0100] Minimum radius: ;
[0101] Maximum Radius: Determined by the size of the convex hull;
[0102] Determine the distance threshold and the maximum initial radius :
[0103] In the interval Search inside to find the largest sphere radius that does not collide with other spheres in the convex hull. For each initial radius, first determine the center position of the sphere: And check whether the sphere in the normal direction intersects with other spheres in the convex hull. And whether it intersects with the surface of the existing obstacle. Iteration radius step , until the maximum radius that does not intersect with other faces and the sphere is found, recorded as . Reselect a larger distance threshold , calculate the maximum radius, if the radius is greater than the maximum radius already recorded, update the maximum radius. Update Or adjust the search range until the end condition is met.
[0104] Output results: maximum sphere center and maximum radius: , ,like Figure 4 As shown in FIG. 1 , it is an exemplary process of forming a ball set from a three-dimensional model with surface normals of a target object. Figure 5 This is the model diagram for spherical approximation of the collaborative robot.
[0105] In a specific embodiment, Figure 6 As shown, an approximate method for constructing a ball set collision model is also provided, including:
[0106] Step S601, obtaining three-dimensional information of a target object;
[0107] The three-dimensional information includes the position information of each of the multiple surface structures of the target object; the surface structure includes triangular facets and edges; the position information includes the vertex position information of each of the multiple vertices of the triangular facets and the edge position information; the internal normal is represented by the internal normal vector and the normal starting point;
[0108] Step S602, for each triangle, performing normal vector analysis on the position information of each vertex to determine the initial internal normal vector of the triangle;
[0109] Step S603, normalizing the initial internal normal vector to determine the internal normal vector of the triangle, performing average statistics on the position information of each vertex to determine the normal starting point of the triangle;
[0110] Step S604, for each edge, obtaining adjacent inner normal vectors of a plurality of triangles adjacent to the edge;
[0111] Step S605, performing average statistics on each adjacent internal normal vector to determine the internal normal vector of the edge, and determining the position information as the normal starting point of the edge;
[0112] Step S606, obtaining a distance threshold, and determining the first sphere center position on the first internal normal line serving as the modeling starting point among the internal normal lines based on the distance threshold;
[0113] 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, constructing a first initial sphere based on the initial radius and the first sphere center position on the first inner normal line;
[0115] Step S608, determining whether the first initial sphere collides with any surface structure;
[0116] If not, execute step S609 to add the initial radius to the radius step to obtain an updated initial radius;
[0117] Return to step S607;
[0118] If yes, then execute step S610 to use the first initial sphere constructed in the previous round as the first sphere corresponding to the first internal normal;
[0119] Step S611, constructing a second initial sphere based on the initial radius and the second sphere center position on the second internal normal line for the second internal normal line except the first internal normal line among the internal normal lines;
[0120] Step S612, determining whether the second initial sphere collides with any constructed sphere;
[0121] If not, execute step S613 to superimpose the initial radius with the radius step to obtain an updated initial radius;
[0122] Return to step S611;
[0123] If yes, execute step S614 to use the second initial sphere constructed in the previous round as the second sphere corresponding to the second internal normal;
[0124] Step S615, when each constructed sphere fills the target object, a sphere set of the target object is obtained;
[0125] Among them, the ball set is used to predict the collision of the target object.
[0126] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0127] Based on the same inventive concept, the embodiment of the present application also provides a device for constructing an approximate ball set collision model for implementing the above-mentioned method for constructing an approximate ball set collision model. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above-mentioned method, so the specific limitations in the embodiments of one or more device for constructing an approximate ball set collision model provided below can refer to the limitations of the above-mentioned method for constructing an approximate ball set collision model, and will not be repeated here.
[0128] In an exemplary embodiment, Figure 7 As shown, a ball set collision model construction approximation device 700 is provided, comprising: 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, wherein:
[0129] An internal normal acquisition module 702 is used to acquire internal normals of multiple surface structures of the target object;
[0130] A first sphere construction module 704 is used to construct a first sphere with the largest radius and not colliding with any surface structure based on the first sphere center position on the first inner normal line, which is used as the modeling starting point among the inner normal lines;
[0131] A second sphere construction module 706 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;
[0132] The ball set determination module 708 is used to obtain the ball set of the target object when each constructed sphere fills the target object; the ball set is used to perform collision prediction on the target object.
[0133] In one embodiment, the internal normal acquisition module 702 includes: a three-dimensional information acquisition unit, including acquiring three-dimensional information of the target object; the three-dimensional information includes the position information of each of multiple surface structures of the target object; and an internal normal determination unit, including determining the internal normal of the surface structure according to the position information for each surface structure.
[0134] In one embodiment, the surface structure includes a triangular face; the position information includes vertex position information of each of the multiple vertices of the triangular face; the internal normal is represented by an internal normal vector and a normal starting point. In the case of this embodiment, the internal normal determination unit is specifically used to: for each triangular face, perform normal vector analysis on the position information of each vertex to determine the initial internal normal vector of the triangular face;
[0135] Normalize the initial internal normal vector to determine the internal normal vector of the triangle;
[0136] The average value of each vertex position information is calculated to determine the starting point of the normal of the triangle.
[0137] In one embodiment, the surface structure includes an edge; the position information includes position information of the edge. In the case of this embodiment, the internal normal determination unit is specifically used to: for each edge, obtain the adjacent internal normal vectors of multiple triangular facets adjacent to the edge;
[0138] The average value of each adjacent inner normal vector is calculated to determine the inner normal vector of the edge, and the position information is determined as the normal starting point of the edge.
[0139] In one embodiment, the ball set collision model construction approximation device 700 further includes a first ball center position determination module, specifically used to: obtain a distance threshold;
[0140] For a first internal normal line among the internal normal lines that serves as a modeling starting point, determining a first sphere center position on the first internal normal line based on a distance threshold;
[0141] The distance between the first sphere 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 used to: construct a first initial sphere based on an initial radius and a first sphere center position on a first inner normal line;
[0143] When the first initial sphere does not collide with any surface structure, the initial radius is superimposed with the radius step to obtain an updated initial radius;
[0144] 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 surface structure;
[0145] The first initial sphere constructed in the previous round is used as the first sphere corresponding to the first internal normal.
[0146] In one embodiment, the second sphere construction module 706 is specifically used to: construct a second initial sphere based on the initial radius and the second sphere center position on the second internal normal line for the second internal normal line except the first internal normal line among the internal normal lines;
[0147] 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;
[0148] Returning to the step of constructing a 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;
[0149] The second initial sphere constructed in the previous round is used as the second sphere corresponding to the second internal normal.
[0150] Each module in the above-mentioned ball set collision model construction approximation device can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0151] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 8As shown. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit and an input device. 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. 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 a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be realized through WIFI, a mobile cellular network, near field communication (NFC) or other technologies. When the computer program is executed by the processor, an approximate method for constructing a ball set collision model is implemented. 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, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse.
[0152] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0153] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps of the above method when executing the computer program.
[0154] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above method are implemented.
[0155] In one embodiment, a computer program product is provided, comprising a computer program, which implements the steps of the above method when executed by a processor.
[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 used 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 must comply with relevant regulations.
[0157] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and 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-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present 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), magnetic 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0158] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, 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, they should be considered to be within the scope of this application.
[0159] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A ball set collision model construction approximation method, characterized in that: The method comprises: Obtaining respective internal normals of multiple surface structures of the target object; 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.
2. The method according to claim 1, characterized in that The obtaining of internal normals of the plurality of surface structures of the target object comprises: 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; For each of the surface structures, an inner normal of the surface structure is determined according to the position information.
3. The method according to claim 2, characterized in that The surface structure includes a triangular face; the position information includes vertex position information of each of the multiple vertices of the triangular face; the internal normal is represented by an internal normal vector and a normal starting point; The step of determining, for each of the surface structures, an inner normal of the surface structure according to the position information comprises: 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.
4. The method according to claim 3, characterized in that The surface structure includes an edge; the position information includes position information of the edge; The step of determining, for each of the surface structures, an inner normal of the surface structure according to the position information 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 is determined as the normal starting point of the edge.
5. 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.
6. 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.
7. The method according to claim 6, 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.
8. A ball set collision model construction approximation device, characterized in that: The device comprises: An internal normal acquisition module, used to acquire internal normals of multiple surface structures of the target object; 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; The ball set determination module is used to obtain the 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.
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 7 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 7 are implemented.
Citation Information
Patent Citations
Collision detection algorithm based on progressive circumscribed sphere structure
CN111104749A
Grid and bounding box-based collision detection method
CN112669434A
Multi-type collision detection method and system of BIM lightweight model
CN116305386A
Collision data processing method and apparatus, storage medium, program product, and electronic device
US20230249076A1