Model simulation method, electronic device, storage medium, computer program product

Through the method of continuous collision detection and position adjustment, the penetration problem of the boundary grid and the dynamic grid is solved, an efficient de-penetration effect is achieved, the complexity of the force calculation is avoided, and the overall performance of the simulation system is improved. .

CN118395752BActive Publication Date: 2024-08-23LINGDI (ZHEJIANG) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410850325.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-27
Publication Date
2024-08-23
Estimated Expiration
2044-06-27

AI Technical Summary

Technical Problem

The existing technology is inefficient when dealing with mesh penetration problems. Especially in boundary meshes and dynamic meshes, the calculation of relief forces is not accurate enough, resulting in unsatisfactory simulation results.

Method used

Adjust the positions of points and triangles in the boundary grid through continuous collision detection. Dynamic simulation is performed based on the modified boundary grid to avoid the penetration problem of the dynamic grid. A spatial acceleration structure and a preset distance threshold are used to improve detection efficiency. .

Benefits of technology

It achieves effective solution for penetration without using release force, improves the accuracy and efficiency of the simulation process, simplifies the process of understanding penetration, ensures that the dynamic grid has no penetration, and improves the simulation effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118395752B
    Figure CN118395752B
Patent Text Reader

Abstract

The present application provides a model simulation method, electronic device, storage medium, and computer program product, including: performing continuous collision detection on the initial boundary grid of the current frame scene and the boundary grid of the previous frame target scene to obtain a first result; the first result indicates the point-triangle pairs that collide, and the collision time of each point-triangle pair; adjusting the points and triangles in each point-triangle pair to the position at the collision time of the point-triangle pair, respectively, to obtain the corrected boundary grid of the current frame scene; performing dynamic simulation based on the corrected boundary grid to drive the dynamic grid of the previous frame target scene to move, to obtain the dynamic grid of the current frame scene. The present application solution solves the grid penetration problem existing in the simulation process without involving release force.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of simulation technology, and in particular to a model simulation method, an electronic device, a computer-readable storage medium, and a computer program product. Background Art

[0002] In the field of digital simulation or graphics, if there are intersecting triangles in the mesh, it will greatly affect the final effect of the model simulation. In some scenes with strict requirements on the rendering effect, even a small amount of intersection will cause great defects. Figure 1 , is a schematic diagram of a grid penetration provided by an embodiment of the present application, Figure 1 The hand position of the character model on the left has a mesh penetration problem with the outer thigh, that is, the hand triangle intersects with the outer thigh triangle. The mesh penetration position is magnified as shown in the figure below. Figure 1 Shown in the image on the right.

[0003] The mesh penetration problem is handled differently for different meshes. In a physical simulation system, meshes can be roughly divided into boundary meshes and dynamic meshes. Among them, the boundary mesh is the mesh input by the user. These mesh data are used as boundary conditions in the simulation system. The motion state of these meshes for each frame is specified in advance. The dynamic mesh only specifies the initial position, and the position of each subsequent frame is solved by the simulation system according to the law of dynamics. For example: in a cloth simulation scene, the human body mesh of the skeletal animation drives the cloth mesh to move, completing the entire catwalk animation simulation. Here, the human body mesh is the boundary mesh and the cloth mesh is the dynamic mesh.

[0004] In related solutions, if the boundary meshes input by the user intersect, the user needs to observe the meshes that penetrate each other with the naked eye, and then manually edit each penetration, which is inefficient. However, the simulation system often does not process the boundary meshes, so the penetrating boundary meshes cause the dynamic mesh to penetrate as well, affecting the overall effect of subsequent simulations. Figure 1For example, if the human body mesh penetrates the inner side of the calf, it will make the collision of the pants on the inner side of the calf difficult to handle, causing the mesh of the pants to penetrate further. Among them, the human body mesh is a boundary mesh, and the mesh of the pants is a dynamic mesh. If the dynamic meshes intersect, the release force method will be adopted in the physical simulation, that is, after finding all the intersecting edge-triangle pairs, the release force of the edge-triangle pair is calculated. The direction of the release force tends to untie the intersecting edge-triangle pairs. After adding the release force to the physical simulation system, the triangles of the intersecting parts can be gradually untied or roughly untied in a series of frames. However, the disadvantage of untiing the penetrating mesh by the release force is that it cannot guarantee that the triangles penetrated in the current frame will be untied in the next frame, because the calculation of the release force can only obtain the general trend of direction and size, which may not be accurate enough, and in a physical simulation system, a force often interacts with other forces, making the problem of mesh collision and penetration more complicated. Therefore, the effect of solving the penetration problem of the dynamic mesh by calculating the release force is not ideal.

[0005] In view of this, there is an urgent need for a solution to the penetration problem of boundary grids and dynamic grids to achieve good processing results. Summary of the invention

[0006] The purpose of the embodiments of the present application is to provide a model simulation method, an electronic device, a storage medium, and a computer program product, which are used to solve the grid penetration problem existing in the simulation process without involving release force.

[0007] On the one hand, the present application provides a model simulation method, comprising:

[0008] Performing continuous collision detection on the initial boundary grid of the current frame scene and the boundary grid of the target scene of the previous frame to obtain a first result; the first result indicates the point-triangle pairs that collide and the collision time of each point-triangle pair;

[0009] Respectively adjusting the points and triangles in each point-triangle pair to the positions at the collision time of the point-triangle pair to obtain a corrected boundary mesh of the current frame scene;

[0010] Dynamic simulation is performed based on the corrected boundary grid to drive the dynamic grid of the target scene of the previous frame to move, thereby obtaining the dynamic grid of the scene of the current frame.

[0011] In one embodiment, the method further comprises:

[0012] Output the simulation result of the current frame scene; wherein the simulation result includes the position of the initial boundary grid and the position of the dynamic grid of the current frame scene.

[0013] In one embodiment, the method further comprises:

[0014] The corrected boundary mesh and dynamic mesh of the current frame scene are saved as the latest target scene.

[0015] In one embodiment, the performing continuous collision detection to obtain a first result includes:

[0016] The first result is obtained by performing continuous collision detection on the boundary grid through the spatial acceleration structure.

[0017] In one embodiment, the performing continuous collision detection to obtain a first result includes:

[0018] When performing continuous collision detection, when the distance between any point and any triangle is less than or equal to a preset distance threshold, it is determined that the point and the triangle form a point-triangle pair in which there is a collision; wherein the distance threshold is a preset thickness of the simulation material.

[0019] In one embodiment, the step of adjusting the points and triangles in each point-triangle pair to positions at the collision time of the point-triangle pair includes:

[0020] For each point-triangle pair, adjust the position of the point and triangle using the following formula:

[0021]

[0022]

[0023] Where v is the position of the point at the time of collision; v 0 is the position of the point in the target scene of the previous frame; v 1 is the position of the point in the current frame scene; t h is the collision time; f is the position of the triangle at the collision time; f 0 is the position of the triangle in the target scene of the previous frame; f 1 is the position of the triangle in the scene in the current frame.

[0024] In one embodiment, the method further comprises:

[0025] For the discrete frame scene, discrete collision detection is performed on all grids to obtain a second result; the second result indicates that there are colliding point-triangle pairs;

[0026] The point and triangle in each point-triangle pair indicated by the second result are moved away from each other in the projection direction of the point to the triangle until the point in the point-triangle pair returns to the surface of the triangle, thereby obtaining a corrected mesh of the discrete frame scene.

[0027] In another aspect, the present application provides an electronic device, the electronic device comprising:

[0028] processor;

[0029] a memory for storing processor-executable instructions;

[0030] Wherein, the processor is configured to execute the above-mentioned model simulation method.

[0031] Furthermore, the present application provides a computer-readable storage medium, which stores a computer program, and the computer program can be executed by a processor to complete the above-mentioned model simulation method.

[0032] In addition, the present application provides a computer program product, including a computer program / instruction, which implements the above-mentioned model simulation method when executed by a processor.

[0033] In the solution of the present application, the simulation system performs continuous collision detection on the boundary mesh, and based on the first result obtained by the detection, corrects the point-triangle pairs with collision, obtains the corrected boundary mesh without penetration triangles, and performs dynamic simulation on the basis of the corrected boundary mesh, which can avoid the dynamic mesh from further generating new penetration problems, and obtains the dynamic mesh of the current frame scene without penetration. In this process, the boundary mesh is effectively de-penetrated with the help of the collision time of each point-triangle pair with collision, which does not involve the processing of release force, simplifies the de-penetration process, and can obtain an ideal de-penetration effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solution of the embodiments of the present application, the drawings required for use in the embodiments of the present application are briefly introduced below.

[0035] Figure 1 A schematic diagram of grid penetration provided by an embodiment of the present application;

[0036] Figure 2 A schematic diagram of an application scenario of a model simulation method provided in an embodiment of the present application;

[0037] Figure 3 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application;

[0038] Figure 4 A schematic diagram of a flow chart of a model simulation method provided in one embodiment of the present application;

[0039] Figure 5 A schematic diagram of position adjustment of a point-triangle pair provided in an embodiment of the present application;

[0040] Figure 6A schematic diagram of the de-penetration effect provided by an embodiment of the present application;

[0041] Figure 7 A block diagram of a model simulation device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0042] The technical solutions in the embodiments of the present application will be described below in conjunction with the drawings in the embodiments of the present application.

[0043] Similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0044] Figure 2 Schematic diagram of application scenarios of the model simulation method provided in the embodiment of the present application. Figure 2 As shown, the application scenario includes a client 20 and a server 30; the client 20 can be a user terminal such as a host, a mobile phone, a tablet computer, etc., which is used to input a boundary grid to the server 30; the server 30 can be a host, a server, a server cluster or a cloud computing center, which can perform collision detection on the boundary grid and correct the grid according to the detection result, so as to avoid the problem of grid penetration during the model simulation process.

[0045] like Figure 3 As shown, this embodiment provides an electronic device 1, including: at least one processor 11 and a memory 12, Figure 3 A processor 11 is taken as an example. The processor 11 and the memory 12 are connected via a bus 10. The memory 12 stores instructions that can be executed by the processor 11. The instructions are executed by the processor 11 so that the electronic device 1 can execute all or part of the process of the method in the following embodiment. In one embodiment, the electronic device 1 can be the above-mentioned server 30, which is used to execute the model simulation method.

[0046] The memory 12 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable red-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk or optical disk.

[0047] The present application also provides a computer-readable storage medium, which stores a computer program. The computer program can be executed by the processor 11 to complete the model simulation method provided by the present application.

[0048] The present application also provides a computer program product, including a computer program / instruction, which implements the model simulation method provided by the present application when executed by a processor.

[0049] See also Figure 4 , is a flow chart of a model simulation method provided in an embodiment of the present application, such as Figure 4 As shown, the method may include the following steps 410 to 430.

[0050] Step 410: Perform continuous collision detection on the initial boundary grid of the current frame scene and the boundary grid of the target scene of the previous frame to obtain a first result; the first result indicates the point-triangle pairs that collide and the collision time of each point-triangle pair.

[0051] In the process of model simulation frame by frame, the initial boundary mesh of each frame can be obtained, and the initial boundary mesh is the boundary mesh input by the user. In the model simulation, the scene contains data such as mesh and material. The user can indicate the initial boundary mesh by inputting the coordinates of the vertices of each triangle in the boundary mesh. In this solution, the mesh can be composed of multiple triangles. Of course, this solution can be applied to meshes composed of other polygons.

[0052] The target scene of the previous frame is the model simulation result of the previous frame. The target scene includes a boundary mesh and a dynamic mesh, and there is no mesh penetration problem in the boundary mesh and the dynamic mesh.

[0053] When processing the current frame scene, the boundary grid (initial boundary grid) of the current frame scene has been obtained, and continuous collision detection (CCD, Continuous Collision Detection) can be performed on the initial boundary grid of the current frame scene and the boundary grid of the previous frame target scene.

[0054] The essence of the collision detection process is to determine whether each pair of triangles in the boundary grid meets the intersection condition. If the boundary grid contains n triangles, which are in one position in the previous frame and in another position in the current frame, then it is necessary to calculate whether each triangle has a moment of distance of 0 with other triangles during the period from the previous frame to the current frame. In theory, n(n-1) / 2 triangle pairs need to be determined. When determining the distance between two triangles, the distance between the two triangles is generally not calculated directly, but decomposed into 9 edge-edge distances between the three sides of one triangle and the three sides of another triangle, 3 point-triangle distances between the three points of the first triangle and the second triangle, and 3 point-triangle distances between the three points of the second triangle and the first triangle. Therefore, the two triangles can be judged by 15 distances whether penetration (intersection) occurs. During the period from the previous frame to the current frame, if any of these 15 distances is zero, it means that penetration has occurred between the two triangles.

[0055] For the problem of detecting whether two triangles intersect, this solution only processes the distance between points and triangles, because the distance between point-triangle pairs is more stringent for judging triangle penetration. In other words, for two triangles, if there is a point-triangle pair with a distance of zero, then there must be a corresponding edge-edge pair with a distance of zero. Through continuous collision detection, a first result can be obtained, which indicates that there are colliding point-triangle pairs and the collision time of each point-triangle pair. The point and triangle in the point-triangle pair collide at the collision time, and then penetration occurs after the collision time.

[0056] In one embodiment, when executing step 410, continuous collision detection can be performed on the boundary grid through a spatial acceleration structure to obtain a first result. Here, the spatial acceleration structure can be a hierarchical bounding box, a spatial hashing algorithm, and the like.

[0057] Through this measure, when processing n triangles, there is no need to judge the distances of n(n-1) / 2 triangle pairs, and triangle pairs with a long distance can be excluded in advance, thereby greatly reducing the amount of calculation and improving detection efficiency.

[0058] In one embodiment, considering that the material of the model simulation actually has thickness, when performing continuous collision detection on the boundary grid, when the distance between any point and any triangle is less than or equal to a preset distance threshold, it can be determined that the point and the triangle form a point-triangle pair that has a collision. The distance threshold is the preset thickness of the simulation material. In this case, during continuous collision detection, the time point when the distance between any point and any triangle is equal to the distance threshold is the collision time of the point-triangle pair formed by the point and the triangle.

[0059] By this measure, the characteristics of the simulated material can be taken into account and more accurate simulation results can be obtained.

[0060] Step 420: respectively adjust the point and triangle in each point-triangle pair to the position at the collision time of the point-triangle pair to obtain a corrected boundary mesh of the current frame scene.

[0061] After obtaining the first result, for each point-triangle pair indicated by the first result, the point can be adjusted to the position at the collision time of the point-triangle pair, and the triangle can be adjusted to the position at the collision time of the point-triangle pair. After adjusting the positions of the points and triangles in all point-triangle pairs indicated by the first result, the corrected boundary mesh of the current frame scene can be obtained. The corrected boundary mesh includes all triangles that have been de-penetrated and triangles that do not have penetration. It should be noted that the collision times of multiple point-triangle pairs indicated by the first result may be different.

[0062] In one embodiment, when executing step 420, for each point-triangle pair, the position of the point and the triangle may be adjusted by the following formulas (1) and (2):

[0063] (1)

[0064] (2)

[0065] Where v is the position of the point at the time of collision; v 0 is the position of the point in the target scene of the previous frame; v 1 is the position of the point in the current frame scene; t h is the collision time; f is the position of the triangle at the collision time; f 0 is the position of the triangle in the target scene of the previous frame; f 1 is the position of the triangle in the current frame scene. Here, the collision time is a normalized value between 0 and 1. If the collision time is 0, it corresponds to the time point of the previous frame, and if the collision time is 1, it corresponds to the time point of the current frame.

[0066] See also Figure 5, is a schematic diagram of position adjustment of a point-triangle pair provided in an embodiment of the present application, such as Figure 5 As shown, the dotted circle represents the points of the triangle, v 0 is the position of the point in the target scene of the previous frame, v 1 is the position of the point in the current frame scene. From the previous frame target scene to the current frame scene, the point moves from v 0 Movement to v 1 ; The dotted line represents a triangle (the triangle is perpendicular to Figure 5 plane, and therefore appears as a line), f 0 is the position of the triangle in the target scene in the previous frame, f 1 is the position of the triangle in the current frame scene. From the previous frame target scene to the current frame scene, the triangle moves from f0 to f 1 The thickness of the triangle is h. Therefore, when the triangle moves to position f and the point moves to position v, the distance between the point and the triangle is equal to h. At this time, the point collides with the triangle. Further, the point penetrates the triangle and moves to position v. 1 This solution uses continuous collision detection to determine the collision time when the point is at a distance h from the triangle, and then moves the point in the current frame scene from position v 1 Adjust to position v, and move the triangle in the current frame scene from position f 1 The point is adjusted to position f, thus solving the problem of the point penetrating the triangle.

[0067] Step 430: Perform dynamic simulation based on the corrected boundary grid to drive the dynamic grid of the target scene of the previous frame to move, and obtain the dynamic grid of the scene of the current frame.

[0068] After obtaining the corrected boundary mesh, dynamic simulation can be performed based on the corrected boundary mesh, thereby driving the dynamic mesh of the target scene in the previous frame to move and obtain the dynamic mesh of the current frame scene. Since the corrected boundary mesh has solved the penetration problem, the dynamic mesh of the current frame scene will not have the penetration problem during dynamic simulation.

[0069] Through the above measures, the present solution uses the simulation system to continuously detect collisions on the boundary mesh, and based on the first result obtained from the detection, corrects the point-triangle pairs with collisions, obtains the corrected boundary mesh without penetration triangles, and performs dynamic simulation on the basis of the corrected boundary mesh, which can avoid the dynamic mesh from further generating new penetration problems, and obtains the dynamic mesh of the current frame scene without penetration. In this process, the boundary mesh is effectively de-penetrated with the help of the collision time of each point-triangle pair with collisions, which does not involve the processing of releasing forces, simplifies the de-penetration process, and can obtain an ideal de-penetration effect.

[0070] In one embodiment, after obtaining the dynamics grid of the current frame scene, the simulation result of the current frame scene may be output, wherein the simulation result includes the position of the initial boundary grid of the current frame scene and the position of the dynamics grid.

[0071] In this case, when the user inputs an initial boundary mesh with a penetration problem, the position of the initial boundary mesh is retained when outputting the simulation results, and the position of the de-penetrated dynamic mesh is output, so that the user still sees the data he or she inputs, and the internal de-penetration improves the display effect of the dynamic mesh. When the user does not perceive that the boundary mesh has been corrected, more penetration problems are avoided and the collision conditions of the simulation are improved.

[0072] In one embodiment, after obtaining the corrected boundary grid and dynamic grid of the current frame scene, the corrected boundary grid and dynamic grid can be saved as the latest target scene. In other words, the position of the corrected boundary grid and the position of the dynamic grid are saved so that when processing the next frame scene, the latest target scene can be used for de-penetration processing.

[0073] Since simulation is an iterative process, each time the corrected boundary mesh and dynamic mesh of the current frame scene are obtained, they are saved as the latest target scene, so that there is no triangle penetration problem in each target scene. Therefore, when the penetration resolution is performed with the help of the latest target scene, it is performed based on the position of the last mesh without penetration, ensuring that there is no penetration problem between triangles after the penetration resolution.

[0074] By applying this solution to model simulation, after the boundary mesh is resolved, a non-penetrated dynamic mesh can be obtained by dynamic simulation. This process does not involve the calculation of release forces, and does not need to consider the complex interaction of multiple forces in the simulation system. It can simply and effectively avoid the penetration of the dynamic mesh caused by the penetration problem of the boundary mesh itself.

[0075] See also Figure 6 , is a schematic diagram of the de-penetration effect provided by an embodiment of the present application, Figure 6 On the left and right, the arcs are the boundary mesh and the strips are the dynamic mesh. Figure 6 On the left, the boundary mesh is not de-penetrated, causing the dynamic mesh to get stuck at the boundary mesh penetration. The dynamics at the penetration are unpredictable, and further penetration is prone to occur. Figure 6 On the right, the boundary mesh is de-penetrated so that the dynamic mesh is free from the penetrating boundary mesh and can move along the gap without penetrating the dynamic mesh itself.

[0076] In one embodiment, it may be necessary to process a discrete frame scene during simulation. In this case, only a single frame scene is processed, and the previous frame target scene cannot be used for de-penetration processing. In this case, a single discrete frame scene may also have a mesh penetration problem. For the discrete frame scene, discrete collision detection (DCD, DiscreteCollisionDetection) can be performed on all triangles to obtain a second result. The second result indicates that there are colliding point-triangle pairs.

[0077] Each point-triangle midpoint and triangle indicated by the second result are moved away from each other in the projection direction of the point onto the triangle until the point-triangle midpoint returns to the surface of the triangle.

[0078] The point can be pulled back a distance x1 in the opposite direction of penetration along the projection direction, and the triangle can be pulled back a distance x2 in the opposite direction of penetration along the projection direction, so that the point returns to the surface of the triangle. If the thickness of the triangle is not considered, the sum of x1 and x2 is the depth of the point penetrating into the triangle. If the thickness of the triangle h is considered, the sum of x1 and x2 is equal to the sum of the depth of the point penetrating into the triangle and the thickness of the triangle h. In one embodiment, x1 can be equal to x2, in which case the point and triangle that penetrated are each corrected by half the distance.

[0079] After de-penetration processing is performed on all point-triangle pairs indicated by the second result, a corrected mesh of the discrete frame scene can be obtained, wherein the corrected mesh includes all meshes of the discrete frame scene, that is, boundary meshes and dynamic meshes.

[0080] Through this measure, when processing a single discrete frame scene, the point-triangle pairs with collisions can be determined based on discrete collision detection, and then de-penetration processing can be performed.

[0081] Figure 7 is a block diagram of a model simulation method device according to an embodiment of the present invention, such as Figure 7 As shown, the device may include:

[0082] The detection module 710 is used to perform continuous collision detection on the initial boundary grid of the current frame scene and the boundary grid of the target scene of the previous frame to obtain a first result; the first result indicates the point-triangle pairs that collide and the collision time of each point-triangle pair;

[0083] An adjustment module 720, used to adjust the points and triangles in each point-triangle pair to the positions at the collision time of the point-triangle pair, to obtain a corrected boundary mesh of the current frame scene;

[0084] The simulation module 730 is used to perform dynamic simulation based on the corrected boundary grid to drive the dynamic grid of the target scene of the previous frame to move and obtain the dynamic grid of the scene of the current frame.

[0085] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned model simulation method, which will not be repeated here.

[0086] In several embodiments provided in the present application, the disclosed devices and methods may also be implemented in other ways. The device embodiments described above are merely schematic, for example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to the multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram may represent a module, a program segment or a part of a code, and a module, a program segment or a part of a code contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the box may also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they may sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or the flowchart, and the combination of boxes in the block diagram and / or the flowchart, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0087] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0088] If the function is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.

Claims

1. A model simulation method, characterized in that: include: Perform continuous collision detection on the initial boundary grid of the current frame scene and the boundary grid of the target scene of the previous frame to obtain a first result; The first result indicates the point-triangle pairs that collide, and the collision time of each point-triangle pair; Respectively adjusting the points and triangles in each point-triangle pair to the positions at the collision time of the point-triangle pair to obtain a corrected boundary mesh of the current frame scene; The step of adjusting the points and triangles in each point-triangle pair to positions at the collision time of the point-triangle pair comprises: For each point-triangle pair, adjust the position of the point and triangle using the following formula: Where v is the position of the point at the time of collision; v 0 is the position of the point in the target scene of the previous frame; v 1 is the position of the point in the current frame scene; t h is the collision time; f is the position of the triangle at the collision time; f 0 is the position of the triangle in the target scene of the previous frame; f 1 is the position of the triangle in the current frame scene; Performing dynamic simulation based on the corrected boundary grid to drive the dynamic grid of the target scene of the previous frame to move, thereby obtaining the dynamic grid of the scene of the current frame; Output the simulation result of the current frame scene; wherein the simulation result includes the position of the initial boundary grid and the position of the dynamic grid of the current frame scene.

2. The method according to claim 1, characterized in that The method further comprises: The corrected boundary mesh and dynamic mesh of the current frame scene are saved as the latest target scene.

3. The method according to claim 1, characterized in that The performing of continuous collision detection to obtain a first result includes: The first result is obtained by performing continuous collision detection on the boundary grid through the spatial acceleration structure.

4. The method according to claim 1 or 3, characterized in that: The performing of continuous collision detection to obtain a first result includes: When performing continuous collision detection, when the distance between any point and any triangle is less than or equal to a preset distance threshold, it is determined that the point and the triangle form a point-triangle pair in which there is a collision; wherein the distance threshold is a preset thickness of the simulation material.

5. The method according to claim 1, characterized in that The method further comprises: For the discrete frame scene, discrete collision detection is performed on all grids to obtain a second result; the second result indicates that there are colliding point-triangle pairs; The point and triangle in each point-triangle pair indicated by the second result are moved away from each other in the projection direction of the point to the triangle until the point in the point-triangle pair returns to the surface of the triangle, thereby obtaining a corrected mesh of the discrete frame scene.

6. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing processor-executable instructions; Wherein, the processor is configured to execute the model simulation method described in any one of claims 1-5.

7. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and the computer program can be executed by a processor to complete the model simulation method described in any one of claims 1-5.

8. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the model simulation method described in any one of claims 1 to 5 is implemented.