A method, device, equipment and storage medium for parallel collision detection
By parallel partitioning and enclosing boxes are created for multi-body isolates in numerical simulation of multi-body separation, combined with the method of overlap and grid intersection, the problem of low collision detection efficiency in the existing technology is solved, and efficient and accurate collision detection is achieved.
Patent Information
- Application Number
- CN202411960154.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-30
AI Technical Summary
The prior art is less efficient for collision detection in multi-body separation numerical simulations, and lacks effective detection algorithms for fluid mechanics simulations.
By using the coordinate information in the mesh file to partition the multi-body isolates in parallel, create a bounding box based on the mesh geometry information in the partitioning results, and complete collision detection by judging the overlap and mesh intersection of the bounding box and the image area.
It effectively improves the efficiency of collision detection and the accuracy of detection results, and improves the user experience.
Smart Images

Figure CN119378452B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of multi-body separation numerical simulation, and in particular to a collision parallel detection method, device, equipment and storage medium. Background Art
[0002] Multi-body separation numerical calculation simulates the interaction and motion state of multiple objects during the separation process, and is widely used in aerospace, mechanical engineering and other fields.
[0003] However, although there are currently many industries that use detection algorithms for collision processes in multi-body separation numerical simulations, they are often inefficient and lack effective detection algorithms for collision processes when simulating fluid mechanics. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a collision parallel detection method, device, equipment and storage medium, which can effectively improve the efficiency of collision detection and the accuracy of detection results, thereby improving user experience. The specific scheme is as follows:
[0005] In a first aspect, the present invention provides a collision parallel detection method, comprising:
[0006] When performing multi-body separation numerical simulation based on fluid mechanics, the grid node coordinate information of the multi-body separation object is determined using the currently simulated grid file, and the multi-body separation object is partitioned in parallel according to the grid node coordinate information to obtain corresponding partition results;
[0007] Determine the number of target bounding boxes in each area based on the mesh geometry information corresponding to each area in the partition result, and trigger a bounding box creation operation in the corresponding area according to the number of target bounding boxes;
[0008] After the creation of the bounding boxes is completed, the image areas corresponding to the bounding boxes in the areas are determined based on the preset rules and the separated object information in the areas, and the bounding boxes to be detected are determined by judging whether there is spatial overlap between the bounding boxes and the bounding boxes in the corresponding image areas;
[0009] By judging whether there is a grid intersection between the target area corresponding to the bounding box to be detected and the corresponding image area, the collision detection result corresponding to the bounding box to be detected is determined, and the collision parallel detection of the multi-body separated objects is completed.
[0010] Optionally, the determining grid node coordinate information of the multi-body separation object by using the currently simulated grid file, and performing parallel partitioning of the multi-body separation object according to the grid node coordinate information, comprises:
[0011] Get the mesh file for multi-body separation numerical simulation;
[0012] Triggering corresponding parallel partitioning operations based on the grid node coordinate information of each multi-body separation in the grid file to obtain corresponding partitioning results;
[0013] The partitioning result includes a plurality of regions, each of which includes the corresponding grid node coordinate information of the multi-body separation, the surface grid unit serial number and the point coordinate information on the surface grid unit.
[0014] Optionally, determining the number of target bounding boxes in each area based on mesh geometry information corresponding to each area in the partition result, and triggering a bounding box creation operation in the corresponding area according to the number of target bounding boxes, includes:
[0015] Obtaining the number of surface grids corresponding to each area in the partition result;
[0016] Determine the number of target bounding boxes in each of the regions based on the number of each of the surface grids and the corresponding number of preset bounding boxes of the multi-body separations;
[0017] The corresponding node coordinate extreme value information is determined according to the mesh geometry information in each of the regions, and the bounding box creation operation is triggered in each of the regions based on the node coordinate extreme value information and the corresponding number of target bounding boxes.
[0018] Optionally, triggering the bounding box creation operation in each of the regions based on the extreme value information of each node coordinate and the corresponding number of target bounding boxes includes:
[0019] Determine the creation range of the bounding box on each spatial rectangular coordinate axis within each of the regions based on the node coordinate extreme value information corresponding to each of the regions;
[0020] Based on each of the bounding box creation ranges, equidistant segmentation is performed, and axis-aligned bounding box creation and bounding box sequence number determination are performed in each of the regions according to the segmentation results, preset bounding box creation rules and the corresponding number of target bounding boxes, so as to complete the bounding box creation operation.
[0021] Optionally, the determining of the image areas corresponding to the bounding boxes in the regions based on the preset rules and the information of the separated objects in the regions includes:
[0022] For any bounding box created in each of the regions, determine whether the point coordinate information on each grid surface in the current bounding box is within the current bounding box to obtain a corresponding point coordinate determination result;
[0023] If the point coordinate judgment result is no, triggering a corresponding bounding box space range modification operation based on the point coordinate information to obtain an updated current bounding box;
[0024] The target multi-body separation stored in the current bounding box is determined according to the separation information in the corresponding area, and the image area corresponding to the current bounding box is determined based on the bounding box in the current space used to store the multi-body separations other than the target multi-body separations.
[0025] Optionally, determining the bounding box to be detected by respectively judging whether each of the bounding boxes overlaps with the bounding box in the corresponding image area in space includes:
[0026] respectively determining whether each of the bounding boxes overlaps with the bounding box in the corresponding image area in space to obtain a corresponding overlap determination result;
[0027] If the result of any of the overlap judgments is no, the operation of determining the bounding box to be detected is not triggered;
[0028] If the result of any of the overlap judgments is yes, the corresponding bounding box is determined to be a bounding box to be detected, and a bounding box sequence number recording operation is triggered to obtain a corresponding bounding box sequence number set to be detected.
[0029] Optionally, determining the collision detection result corresponding to the bounding box to be detected by judging whether there is a grid intersection between the target area corresponding to the bounding box to be detected and the corresponding image area includes:
[0030] For each of the bounding boxes to be detected, determining whether the surface grid line segments in the corresponding target area intersect with the surface grid line segments in the corresponding image area, so as to obtain a corresponding grid intersection determination result;
[0031] If there is a grid intersection judgment result indicating yes, a corresponding grid intersection coordinate determination operation is triggered to determine the collision detection result of the corresponding bounding box to be detected based on the obtained grid intersection coordinate information.
[0032] In a second aspect, the present invention provides a collision parallel detection device, comprising:
[0033] A parallel partitioning module is used to determine the grid node coordinate information of the multi-body separation object using the currently simulated grid file when performing multi-body separation numerical simulation based on fluid mechanics, and to perform parallel partitioning on the multi-body separation object according to the grid node coordinate information to obtain corresponding partitioning results;
[0034] A bounding box creation module, configured to determine the number of target bounding boxes in each area based on the mesh geometry information corresponding to each area in the partition result, and trigger a bounding box creation operation in the corresponding area according to the number of target bounding boxes;
[0035] An overlap judgment module is used to determine the image areas corresponding to the bounding boxes in the areas after the bounding boxes are created, based on preset rules and the information of the separated objects in the areas, and to determine the bounding boxes to be detected by judging whether the bounding boxes overlap with the bounding boxes in the corresponding image areas in space.
[0036] The intersection judgment module is used to determine whether there is a grid intersection between the target area corresponding to the bounding box to be detected and the corresponding image area, so as to determine the collision detection result corresponding to the bounding box to be detected and complete the parallel collision detection of the multi-body separated objects.
[0037] In a third aspect, the present invention provides an electronic device, comprising:
[0038] Memory, used to store computer programs;
[0039] The processor is used to execute the computer program to implement the steps of the aforementioned parallel collision detection method.
[0040] In a fourth aspect, the present invention provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the steps of the aforementioned parallel collision detection method when executed by a processor.
[0041] It can be seen that in the present invention, when performing numerical simulation of multi-body separation based on fluid mechanics, the grid node coordinate information of the multi-body separator is determined by using the currently simulated grid file, and the multi-body separator is partitioned in parallel according to the grid node coordinate information to obtain the corresponding partitioning result; the number of target bounding boxes in each area is determined based on the grid geometry information corresponding to each area in the partitioning result, and the bounding box creation operation is triggered in the corresponding area according to the number of target bounding boxes; after the bounding box creation is completed, the image area corresponding to each bounding box in each area is determined based on the preset rules and the separator information in each area, and the bounding box to be detected is determined by judging whether each bounding box overlaps with the bounding box in the corresponding image area in space; the collision detection result corresponding to the bounding box to be detected is determined by judging whether there is a grid intersection between the target area corresponding to the bounding box to be detected and the corresponding image area, and the parallel collision detection of the multi-body separator is completed. That is, in the present invention, the coordinate information in the grid file is first used to perform parallel partitioning of the multi-body separations, and then the bounding boxes are created based on the grid geometry information in the multiple regions obtained by the partitioning. After that, for each bounding box, it is first determined whether it overlaps with the corresponding image area. If it overlaps, it is again determined whether there is a grid intersection between the area where it is located and the corresponding image area, so as to complete the parallel collision detection of the multi-body separations based on each area. In this way, the efficiency of collision detection and the accuracy of the detection results can be effectively improved, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0043] Figure 1 A flow chart of a parallel collision detection method provided by the present invention;
[0044] Figure 2 A schematic diagram of a parallel partitioning provided by the present invention;
[0045] Figure 3 A schematic diagram of a bounding box overlap detection provided by the present invention;
[0046] FIG4 (a) is a schematic diagram of grid calculation related to a wing and an external attachment provided by the present invention;
[0047] FIG4( b ) is a schematic diagram of grid calculation related to a rack and an external attachment provided by the present invention;
[0048] FIG5 (a) is a side view of the initial position of a wing and a thrown object at an initial moment provided by the present invention;
[0049] FIG5( b ) is a front view schematic diagram of the initial positions of the wing and the thrown object at an initial moment provided by the present invention;
[0050] Figure 6 A schematic diagram of the relative positions of a wing and a thrown object during a collision provided by the present invention;
[0051] Figure 7 A schematic diagram of a collision point between a wing and a thrown object during a collision provided by the present invention;
[0052] Figure 8 A schematic diagram of the separation of a wing and a thrown object after a collision provided by the present invention;
[0053] Fig. 9 A schematic diagram of the structure of a collision parallel detection device provided by the present invention;
[0054] Fig.10 A structural diagram of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0055] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0056] Although there are currently many industries that use collision detection algorithms in multi-body separation numerical simulations, they are often inefficient and lack effective collision detection algorithms for fluid mechanics simulations. To this end, the present invention provides a collision parallel detection solution that can effectively improve the efficiency of collision detection and the accuracy of detection results, thereby improving user experience.
[0057] See also Figure 1 As shown, an embodiment of the present invention discloses a collision parallel detection method, comprising:
[0058] Step S11, when performing multi-body separation numerical simulation based on fluid mechanics, the grid node coordinate information of the multi-body separation is determined using the currently simulated grid file, and the multi-body separation is partitioned in parallel according to the grid node coordinate information to obtain corresponding partition results.
[0059] Specifically, in this embodiment, it is necessary to first read the grid file for the numerical simulation of multi-body separation based on fluid mechanics, and then use the grid file to perform parallel partitioning of the multi-body separator, which can be achieved by dividing the surface grid of the multi-body separator. That is, the grid node coordinate information of the multi-body separator is determined by using the currently simulated grid file, and the multi-body separator is partitioned in parallel according to the grid node coordinate information, including: obtaining the grid file of the numerical simulation of multi-body separation; triggering the corresponding parallel partitioning operation based on the grid node coordinate information of each multi-body separator in the grid file to obtain the corresponding partitioning result; wherein the partitioning result includes multiple regions, and the regions include the corresponding grid node coordinate information of the multi-body separator, the surface grid unit serial number and the point coordinate information on the surface grid unit. When the multi-body separator is an aircraft, the partitioning result can be as follows: Figure 2 As shown, each box (i.e., area) in the figure is a thread, containing an aircraft (i.e. Figure 2 Partial mesh information of the object in red in the figure.
[0060] Step S12: determining the number of target bounding boxes in each area based on the mesh geometry information corresponding to each area in the partitioning result, and triggering a bounding box creation operation in the corresponding area according to the number of target bounding boxes.
[0061] In this embodiment, after the partitioning is completed, it is necessary to establish an axis-aligned bounding box in each of the processes. That is, the number of target bounding boxes in each of the regions is determined based on the mesh geometry information corresponding to each region in the partitioning result, and the bounding box creation operation is triggered in the corresponding region according to the number of target bounding boxes, including: obtaining the number of surface meshes corresponding to each region in the partitioning result; determining the number of target bounding boxes in each of the regions based on the number of surface meshes and the corresponding number of preset bounding boxes of the multi-body separation; determining the corresponding node coordinate extreme value information according to the mesh geometry information in each of the regions, and triggering the bounding box creation operation in each of the regions based on the node coordinate extreme value information and the corresponding number of target bounding boxes. In other words, it is necessary to first determine the ratio of the number of surface meshes between each of the regions and the multi-body separation, and determine the number of target bounding boxes in each of the regions based on the product value of the ratio and the preset number of bounding boxes. Then, the corresponding number of target bounding boxes is used to create the bounding box.
[0062] Furthermore, when creating a bounding box, it is necessary to first determine the creation range and the number of bounding boxes on each spatial rectangular coordinate axis, and then create the bounding box based on the priority between each spatial rectangular coordinate axis. That is, based on the node coordinate extreme value information corresponding to each of the regions, determine the bounding box creation range on each spatial rectangular coordinate axis in each of the regions; perform equidistant segmentation based on each of the bounding box creation ranges, and perform axis-aligned bounding box creation and bounding box sequence number determination in each of the regions based on the segmentation results, preset bounding box creation rules, and the corresponding target bounding box number to complete the bounding box creation operation. Specifically, traverse the grid node coordinate information in each process to obtain the maximum and minimum values of the grid coordinate points in the three coordinate axis directions of x, y, and z in the three-dimensional space p. , , , , , . According to the ratio of the number of surface meshes in the current process to the number of corresponding surface meshes in the whole set, calculate the number of bounding boxes N in a single process box Then, the number N of bounding boxes divided by the bounding box in the x, y, and z directions is determined according to the aforementioned node coordinate extreme value information. box,x 、N box,y 、N box,z , which is calculated according to the ratio of the length of the surface grid in the three-dimensional direction, can be calculated by the following formula:
[0063] ;
[0064] Multiple axis-aligned bounding boxes are created in each process. The bounding boxes are divided into equal distances according to the coordinate value intervals in each direction. The bounding boxes are numbered according to the principle of small coordinate values first and large coordinate values last. The priority of the coordinate direction is x first, y second, and z last (the priority can also be customized based on actual needs). Any coordinate point (x j ,y j ,z j ) where the bounding box number N j It can be expressed as:
[0065] .
[0066] In the formula, y j is the serial number N j The y-axis coordinate value of the j-th point of the bounding box; j is the serial number N j The x-axis coordinate value of the j-th point of the bounding box; j is the serial number N j The z-axis coordinate value of the jth point of the bounding box.j The bounding box of the surface grid can be represented by the extreme value of the point coordinates on the surface grid, in the format of (x min , x max ,y min ,y max , z min , z max ).
[0067] Step S13, after the creation of the bounding box is completed, the image area corresponding to each bounding box in each of the areas is determined based on the preset rules and the separated object information in each of the areas, and the bounding box to be detected is determined by judging whether each of the bounding boxes overlaps with the bounding box in the corresponding image area in space.
[0068] It should be understood that in this embodiment, when performing detection based on each of the areas, it is first roughly detected which bounding boxes have a collision risk, and further fine detection is required, that is, to determine the bounding boxes to be detected. Before the rough detection, it is necessary to first determine the image area of each bounding box that has been created. That is, the image area corresponding to each bounding box in each of the areas is determined based on the preset rules and the information of the separated objects in each of the areas, including: for any bounding box created in each of the areas, judging whether the point coordinate information on each grid surface in the current bounding box is located in the current bounding box to obtain the corresponding point coordinate judgment result; if the point coordinate judgment result is no, triggering the corresponding bounding box space range modification operation based on the point coordinate information to obtain the updated current bounding box; determining the target multi-body separated object stored in the current bounding box according to the corresponding separated object information in the area, and determining the image area corresponding to the current bounding box based on the bounding box in the current space used to store the multi-body separated objects other than the target multi-body separated object. For example, serial number N j The bounding box of the grid surface unit is determined, and the coordinate information of the points on all grid surfaces in the bounding box is traversed. If there is a coordinate point outside the bounding box area, the bounding box boundary value is expanded, that is, the bounding box space range is modified. Collect the bounding box information outside the corresponding grid of the current process as the image area, and Figure 3 For example, if the multi-body separation object in the current process is a red wing, then all the multi-body separation objects contained therein are throwable objects (i.e., thrown objects, which are the Figure 3 The bounding box composed of the surface mesh of the object (the blue object in the figure) is the corresponding image area.
[0069] Further, regarding the determination of the bounding box to be detected, there are: respectively judging whether each of the bounding boxes overlaps with the corresponding bounding box in the image area in space to obtain the corresponding overlap judgment result; if any of the overlap judgment results is no, the determination operation of the bounding box to be detected is not triggered; if any of the overlap judgment results is yes, the corresponding bounding box is determined to be the bounding box to be detected, and the bounding box sequence number recording operation is triggered to obtain the corresponding bounding box sequence number set to be detected. In other words, if there is a bounding box that overlaps with the bounding box in the corresponding image area in space, it is considered that there is a collision risk, and the bounding box needs to be determined as the bounding box to be detected, and its bounding box sequence number needs to be recorded. On the contrary, if any of the overlap judgment results is no, it is determined that the corresponding bounding box does not have a collision risk, and there is no need to determine the bounding box as the bounding box to be detected, that is, there is no need to further perform step S14 detection on the bounding box.
[0070] Step S14, by judging whether there is a grid intersection between the target area corresponding to the bounding box to be detected and the corresponding image area, the collision detection result corresponding to the bounding box to be detected is determined, and the parallel collision detection of the multi-body separated objects is completed.
[0071] Specifically, in this embodiment, the collision detection result corresponding to the bounding box to be detected is determined by judging whether there is a grid intersection between the target area corresponding to the bounding box to be detected and the corresponding image area, including: for each bounding box to be detected, judging whether the surface grid line segments in the corresponding target area intersect with the surface grid line segments in the corresponding image area to obtain the corresponding grid intersection judgment result; if there is a grid intersection judgment result indicating yes, then triggering the corresponding grid intersection coordinate determination operation to determine the collision detection result of the corresponding bounding box to be detected based on the obtained grid intersection coordinate information. That is, in this embodiment, by judging whether the area where the bounding box to be detected is located intersects with the corresponding image area, whether a collision occurs is detected, and determining the collision point, i.e., the intersection point, when yes.
[0072] In a specific implementation, it is detected whether any surface mesh line segment in the current process intersects with the surface mesh in the bounding box of the image area. The surface mesh is usually a triangle or a polygon that can be converted into multiple triangles. The coordinates of the three vertices of the triangle are P0, P1, and P2, and the coordinates of the line segment are O (origin) and point V1. Solve t, , The values of these three scalar parameters can determine whether the line segment and the triangle intersect. The calculation formula used in the detection process is as follows.
[0073] ;
[0074] ;
[0075] ;
[0076] ;
[0077] ;
[0078] ;
[0079] ;
[0080] In the formula, D, E1, E2, S0, S1, S2 are all vectors. , The values of these three scalar parameters satisfy , then it is determined that the line segment intersects the triangle, and the intersection point V2, the coordinates of the intersection point can be calculated by the following formula:
[0081] .
[0082] It can be seen that in an embodiment of the present invention, when performing numerical simulation of multi-body separation based on fluid mechanics, the grid node coordinate information of the multi-body separator is determined using the currently simulated grid file, and the multi-body separator is partitioned in parallel according to the grid node coordinate information to obtain corresponding partitioning results; the number of target bounding boxes in each area is determined based on the grid geometry information corresponding to each area in the partitioning result, and the bounding box creation operation is triggered in the corresponding area according to the number of target bounding boxes; after the bounding box creation is completed, the image area corresponding to each bounding box in each area is determined based on the preset rules and the separator information in each area, and the bounding box to be detected is determined by judging whether each bounding box overlaps with the bounding box in the corresponding image area in space; the collision detection result corresponding to the bounding box to be detected is determined by judging whether there is a grid intersection between the target area corresponding to the bounding box to be detected and the corresponding image area, and the parallel collision detection of the multi-body separator is completed. That is, in the present invention, the coordinate information in the grid file is first used to perform parallel partitioning of the multi-body separations, and then the bounding boxes are created based on the grid geometry information in the multiple regions obtained by the partitioning. After that, for each bounding box, it is first determined whether it overlaps with the corresponding image area. If it overlaps, it is again determined whether there is a grid intersection between the area where it is located and the corresponding image area, so as to complete the parallel collision detection of the multi-body separations based on each area. In this way, the efficiency of collision detection and the accuracy of the detection results can be effectively improved, thereby improving the user experience.
[0083] Below is combined with Figure 4 (a) - Figure 8 The schematic diagram disclosed in the figure specifically illustrates the technical solution of the embodiment of the present invention.
[0084] The WPFS (Wing / Pylon / Finned-Store) wing / pylon / rudder external storage model is a model for CTS (Captive Trajectory System) tests. This model has a wealth of multi-body separation tests. Since wind tunnel experiments generally do not allow collisions to occur, this embodiment simulates the collision and separation process motion data between the external storage and the pylon during separation, and obtains the specific collision point position.
[0085] Specifically, in a specific implementation, the calculation conditions of the incoming flow are: static temperature 236.702K, static pressure 36039.1Pa, Mach number 0.95, calculated angle of attack 0, sideslip angle 0, and physical time step value 0.005s. The calculation grids are shown in Figures 4 (a) and 4 (b). The total number of wing grids is 10.096 million grids, and the number of surface grid cells is 31,780. The total number of surface grids of the external attachment is 1.3801 million, and the number of surface grid cells is 31,100. In the calculation, the wing grid uses 256 cores and the external attachment grid uses 64 cores. The detection steps are as follows:
[0086] 1): Read all the computational grid units of the wing and the external attachment in FIG4 (a) and FIG4 (b), divide the wing surface grid into 256 parts, and assign them to 256 threads for calculation. Divide the external attachment into 64 parts, and assign them to 64 threads for calculation.
[0087] 2): It is estimated that 2000 bounding boxes will be divided for the whole wing. If the number of surface grids in a process is 28,900, the number of bounding boxes in the process is 0.203 / 3.178*2000=128. If the maximum values of the coordinate points of all grid coordinate points in the process in the xyz direction are 10, 1, and 13, respectively, and the minimum values of the coordinate points in the xyz direction are 4, 19, and 1, respectively. It can be determined that the number of bounding boxes divided in the xyz direction is 4, 4, and 8, respectively. The total number of bounding boxes is 128. In this way, the bounding boxes are divided for the grids in each process, and the spatial range of the bounding boxes is determined.
[0088] 3): Loop through the mesh faces in each process. If there is a coordinate point outside the bounding box area, expand the bounding box boundary value. For example, if the spatial range of a bounding box is (1, 2, 4, 5, 2, 3), and there is a point with coordinates (0, 4, 3), then modify the bounding box range to (0, 2, 4, 5, 2, 3). If there is also a point (0, 5, 5), then modify the bounding box range to (0, 2, 4, 5, 2, 5). For the mesh of the wing stored in the process, collect the bounding box information of all external attachments as the image area. For the mesh of the external attachment stored in the process, collect the bounding box information of all wings as the image area.
[0089] 4): Determine whether the bounding box in the current process overlaps with the bounding box in the image area in space. If there is overlap, record the bounding box number. Take the bounding box generated by the current wing grid as an example. The spatial range of the bounding box is (1, 2, 5, 7, 6, 9). If there is a bounding box (1, 3, 6, 9, 7, 8) in the image area where the external attachment is stored, then the wing and external attachment grids stored in the two bounding boxes need to be accurately detected. For the bounding box with a spatial range of (3, 4, 6, 9, 7, 8) in the image area, no accurate detection is required.
[0090] 5): Accurately detect the bounding box that needs to be detected in the previous step. Use the corresponding formula to determine whether the surface mesh line segment in the current process has an intersection with the surface mesh in the image area. If so, calculate the intersection position. The initial moments that can be observed on the side and front of the aircraft during the collision detection process are shown in Figure 5 (a) and Figure 5 (b), respectively. The relative position between the wing and the thrown object at the time of collision is shown in Figure 5 (a). Figure 6 As shown, the collision position is Figure 7 The area where the black box is located in the collision is as follows Figure 8 shown.
[0091] See also Fig. 9 As shown, the embodiment of the present invention also discloses a collision parallel detection device, including:
[0092] A parallel partitioning module 11 is used to determine the grid node coordinate information of the multi-body separation object using the currently simulated grid file when performing multi-body separation numerical simulation based on fluid mechanics, and to perform parallel partitioning on the multi-body separation object according to the grid node coordinate information to obtain corresponding partitioning results;
[0093] A bounding box creation module 12 is used to determine the number of target bounding boxes in each area based on the mesh geometry information corresponding to each area in the partition result, and trigger a bounding box creation operation in the corresponding area according to the number of target bounding boxes;
[0094] The overlap judgment module 13 is used to determine the image areas corresponding to the bounding boxes in the areas after the bounding boxes are created, based on the preset rules and the separated object information in the areas, and to determine the bounding boxes to be detected by respectively judging whether the bounding boxes overlap with the bounding boxes in the corresponding image areas in space;
[0095] The intersection judgment module 14 is used to determine whether there is a grid intersection between the target area corresponding to the bounding box to be detected and the corresponding image area, so as to determine the collision detection result corresponding to the bounding box to be detected and complete the parallel collision detection of the multi-body separated objects.
[0096] Among them, for more specific working processes of the above-mentioned modules, please refer to the corresponding contents disclosed in the aforementioned embodiments, which will not be repeated here.
[0097] It can be seen that in the present invention, the coordinate information in the grid file is first used to perform parallel partitioning of multi-body separations, and then bounding boxes are created based on the grid geometry information in multiple regions obtained by partitioning. After that, for each bounding box, it is first determined whether it overlaps with the corresponding image area. If it overlaps, it is again determined whether there is a grid intersection between the area where it is located and the corresponding image area, so as to complete the parallel collision detection of multi-body separations based on each area. In this way, the efficiency of collision detection and the accuracy of detection results can be effectively improved, thereby improving the user experience.
[0098] In some specific embodiments, the parallel partitioning module 11 may specifically include:
[0099] A file acquisition unit, used to acquire a grid file for multi-body separation numerical simulation;
[0100] A parallel partitioning unit is used to trigger corresponding parallel partitioning operations based on the grid node coordinate information of each multi-body separation in the grid file to obtain corresponding partitioning results; wherein the partitioning results include multiple regions, each of which includes the corresponding grid node coordinate information of the multi-body separation, the surface grid unit serial number and the point coordinate information on the surface grid unit.
[0101] In some specific embodiments, the bounding box creation module 12 may specifically include:
[0102] A grid number acquisition unit, used to acquire the number of surface grids corresponding to each area in the partition result;
[0103] A bounding box number determination unit, configured to determine the number of target bounding boxes in each of the regions based on the number of each surface grid and the corresponding preset number of bounding boxes of the multi-body separated object;
[0104] The bounding box creation unit is used to determine the corresponding node coordinate extreme value information according to the mesh geometry information in each of the areas, and trigger the bounding box creation operation in each of the areas based on the node coordinate extreme value information and the corresponding number of target bounding boxes.
[0105] In some specific embodiments, the bounding box creating unit may specifically include:
[0106] A creation range determination subunit, used for determining a creation range of a bounding box on each spatial rectangular coordinate axis within each of the regions based on the node coordinate extreme value information corresponding to each of the regions;
[0107] The bounding box creation subunit is used to perform equidistant segmentation based on each of the bounding box creation ranges, and to perform axis-aligned bounding box creation and bounding box sequence number determination in each of the areas according to the segmentation results, preset bounding box creation rules and the corresponding number of target bounding boxes, so as to complete the bounding box creation operation.
[0108] In some specific embodiments, the overlap determination module 13 may specifically include:
[0109] A point coordinate judgment unit, for judging, for any bounding box created in each of the regions, whether the point coordinate information on each grid surface in the current bounding box is within the current bounding box, so as to obtain a corresponding point coordinate judgment result;
[0110] A range modification unit, configured to trigger a corresponding bounding box space range modification operation based on the point coordinate information if the point coordinate judgment result is no, so as to obtain an updated current bounding box;
[0111] The image area determination unit is used to determine the target multi-body separation stored in the current bounding box according to the separation information in the corresponding area, and determine the image area corresponding to the current bounding box based on the bounding box in the current space used to store the multi-body separations other than the target multi-body separation.
[0112] In some specific embodiments, the overlap determination module 13 may specifically include:
[0113] An overlap determination unit, used to respectively determine whether each of the bounding boxes overlaps with the bounding box in the corresponding image area in space, so as to obtain a corresponding overlap determination result;
[0114] an operation non-triggering unit, configured to not trigger the to-be-detected bounding box determination operation if any of the overlap determination results is negative;
[0115] The to-be-detected bounding box determining unit is used to determine the corresponding bounding box as the to-be-detected bounding box if any of the overlap judgment results is yes, and trigger the bounding box sequence number recording operation to obtain the corresponding to-be-detected bounding box sequence number set.
[0116] In some specific embodiments, the intersection judgment module 14 may specifically include:
[0117] An intersection determination unit, for determining, for each of the bounding boxes to be detected, whether the surface grid line segments in the corresponding target area intersect with the surface grid line segments in the corresponding image area, so as to obtain a corresponding grid intersection determination result;
[0118] The detection result determination unit is used to trigger a corresponding grid intersection coordinate determination operation if there is a grid intersection judgment result indicating yes, so as to determine a collision detection result of the corresponding bounding box to be detected based on the obtained grid intersection coordinate information.
[0119] Furthermore, an embodiment of the present invention also discloses an electronic device, Fig.10 This is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the diagram cannot be regarded as any limitation on the scope of application of the present invention.
[0120] Fig.10 The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present invention. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the collision parallel detection method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0121] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present invention, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0122] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0123] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, and can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the collision parallel detection method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.
[0124] Furthermore, the present invention also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the aforementioned disclosed parallel collision detection method. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.
[0125] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0126] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0127] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0128] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprise" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device that includes a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0129] The technical solution provided by the present invention is introduced in detail above. Specific examples are used in this article to illustrate the principle and implementation mode of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A collision parallel detection method, characterized in that: include: When performing multi-body separation numerical simulation based on fluid mechanics, the grid node coordinate information of the multi-body separation object is determined using the currently simulated grid file, and the multi-body separation object is partitioned in parallel according to the grid node coordinate information to obtain corresponding partition results; Determine the number of target bounding boxes in each area based on the mesh geometry information corresponding to each area in the partition result, and trigger a bounding box creation operation in the corresponding area according to the number of target bounding boxes; After the creation of the bounding boxes is completed, the image areas corresponding to the bounding boxes in the areas are determined based on the preset rules and the separated object information in the areas, and the bounding boxes to be detected are determined by judging whether there is spatial overlap between the bounding boxes and the bounding boxes in the corresponding image areas; By judging whether there is a grid intersection between the target area corresponding to the bounding box to be detected and the corresponding image area, a collision detection result corresponding to the bounding box to be detected is determined, and the collision parallel detection of the multi-body separated objects is completed; The step of determining the bounding box to be detected by respectively judging whether each of the bounding boxes overlaps with the bounding box in the corresponding image area in space includes: respectively determining whether each of the bounding boxes overlaps with the bounding box in the corresponding image area in space to obtain a corresponding overlap determination result; If the result of any of the overlap judgments is no, the operation of determining the bounding box to be detected is not triggered; If the result of any of the overlap judgments is yes, the corresponding bounding box is determined to be a bounding box to be detected, and a bounding box sequence number recording operation is triggered to obtain a corresponding bounding box sequence number set to be detected; The determining of whether there is a grid intersection between the target area corresponding to the bounding box to be detected and the corresponding image area to determine the collision detection result corresponding to the bounding box to be detected includes: For each of the bounding boxes to be detected, determining whether the surface grid line segments in the corresponding target area intersect with the surface grid line segments in the corresponding image area, so as to obtain a corresponding grid intersection determination result; If there is a grid intersection judgment result indicating yes, a corresponding grid intersection coordinate determination operation is triggered to determine the collision detection result of the corresponding bounding box to be detected based on the obtained grid intersection coordinate information.
2. The parallel collision detection method according to claim 1, characterized in that: The method of determining the grid node coordinate information of the multi-body separation object by using the currently simulated grid file, and performing parallel partitioning on the multi-body separation object according to the grid node coordinate information, comprises: Get the mesh file for multi-body separation numerical simulation; Triggering corresponding parallel partitioning operations based on the grid node coordinate information of each multi-body separation in the grid file to obtain corresponding partitioning results; The partitioning result includes a plurality of regions, each of which includes the corresponding grid node coordinate information of the multi-body separation, the surface grid unit serial number and the point coordinate information on the surface grid unit.
3. The parallel collision detection method according to claim 1, characterized in that: The determining the number of target bounding boxes in each area based on the mesh geometry information corresponding to each area in the partitioning result, and triggering a bounding box creation operation in the corresponding area according to the number of target bounding boxes, includes: Obtaining the number of surface grids corresponding to each area in the partition result; Determine the number of target bounding boxes in each of the regions based on the number of each of the surface grids and the corresponding number of preset bounding boxes of the multi-body separations; The corresponding node coordinate extreme value information is determined according to the mesh geometry information in each of the regions, and the bounding box creation operation is triggered in each of the regions based on the node coordinate extreme value information and the corresponding number of target bounding boxes.
4. The parallel collision detection method according to claim 3, characterized in that: The triggering of the bounding box creation operation in each of the regions based on the extreme value information of the coordinates of each of the nodes and the corresponding number of the target bounding boxes includes: Determine the creation range of the bounding box on each spatial rectangular coordinate axis within each of the regions based on the node coordinate extreme value information corresponding to each of the regions; Based on each of the bounding box creation ranges, equidistant segmentation is performed, and axis-aligned bounding box creation and bounding box sequence number determination are performed in each of the regions according to the segmentation results, preset bounding box creation rules and the corresponding number of target bounding boxes, so as to complete the bounding box creation operation.
5. The parallel collision detection method according to claim 1, characterized in that: The determining of the image areas corresponding to the bounding boxes in the respective regions based on the preset rules and the separated object information in the respective regions comprises: For any bounding box created in each of the regions, determine whether the point coordinate information on each grid surface in the current bounding box is within the current bounding box to obtain a corresponding point coordinate determination result; If the point coordinate judgment result is no, triggering a corresponding bounding box space range modification operation based on the point coordinate information to obtain an updated current bounding box; The target multi-body separation stored in the current bounding box is determined according to the separation information in the corresponding area, and the image area corresponding to the current bounding box is determined based on the bounding box in the current space used to store the multi-body separations other than the target multi-body separation.
6. A collision parallel detection device, characterized in that: include: A parallel partitioning module is used to determine the grid node coordinate information of the multi-body separation object using the currently simulated grid file when performing multi-body separation numerical simulation based on fluid mechanics, and to perform parallel partitioning on the multi-body separation object according to the grid node coordinate information to obtain corresponding partitioning results; A bounding box creation module, configured to determine the number of target bounding boxes in each area based on the mesh geometry information corresponding to each area in the partition result, and trigger a bounding box creation operation in the corresponding area according to the number of target bounding boxes; An overlap judgment module is used to determine the image areas corresponding to the bounding boxes in the areas after the bounding boxes are created, based on preset rules and the information of the separated objects in the areas, and to determine the bounding boxes to be detected by judging whether the bounding boxes overlap with the bounding boxes in the corresponding image areas in space. An intersection judgment module is used to determine whether there is a grid intersection between the target area corresponding to the bounding box to be detected and the corresponding image area, so as to determine the collision detection result corresponding to the bounding box to be detected and complete the collision parallel detection of the multi-body separated objects; Wherein, the overlap judgment module includes: An overlap determination unit, used to respectively determine whether each of the bounding boxes overlaps with the bounding box in the corresponding image area in space, so as to obtain a corresponding overlap determination result; an operation non-triggering unit, configured to not trigger the to-be-detected bounding box determination operation if any of the overlap determination results is negative; a to-be-detected bounding box determining unit, configured to determine the corresponding bounding box as the to-be-detected bounding box if any of the overlap determination results in yes, and trigger a bounding box sequence number recording operation to obtain a corresponding to-be-detected bounding box sequence number set; The intersection judgment module includes: An intersection determination unit, for determining, for each of the bounding boxes to be detected, whether the surface grid line segments in the corresponding target area intersect with the surface grid line segments in the corresponding image area, so as to obtain a corresponding grid intersection determination result; The detection result determination unit is used to trigger a corresponding grid intersection coordinate determination operation if there is a grid intersection judgment result indicating yes, so as to determine a collision detection result of the corresponding bounding box to be detected based on the obtained grid intersection coordinate information.
7. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the parallel collision detection method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the parallel collision detection method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method for continued bounding volume hierarchy traversal on intersection without shader intervention
CN110827387A
Grid and bounding box-based collision detection method
CN112669434A