Background
The soft tissue deformation calculation model mainly comprises a spring mass point model, a finite element model and a non-grid model. Lim et al (Lim Y.J, De S. Real time relationship of non-linear tissue response using the point alignment-based method of properties [ J ]. Computer Methods in Applied Mechanics and engineering.2007,196 (31): 3011-3024) adopt a lattice-free method based on distribution points to establish a soft tissue deformation model of a deformation physical model of soft tissue, which has higher calculation efficiency than a finite element method but poorer stability. Li et al (Yan-Dong L I, Zhu L, Xiu-Fen YE, et al, Modeling and Simulation of Soft Tissue Deformation Based on Local Dynamic Model [ J ]. Computer Science, 2013, 40(10): 283-. The application number is CN201110213387.5, the name is soft tissue deformation simulation method based on non-grid Galerkin and mass point spring coupling, the method makes up the defect that the Galerkin method is not suitable for solving large-scale problems, but seamless coupling among multiple models is difficult to realize. Chen Weidong and the like (Chen Weidong, Chen Pan, Zhu Qiguang, research on deformation modeling and force feedback algorithm based on an improved spring-mass point model [ J ]. biomedicine engineering journal, 2015(5):989 + 996.) propose a new variable diamond topological structure model on the basis of the spring-mass point model, realize the deformation simulation of different organs by the model by changing the length, the spring coefficient and the initial included angle of a diamond-shaped edge spring, and compromise is performed on the two aspects of calculation precision and real-time property.
In summary, the simulation of soft tissue deformation plays an important role in virtual surgery research, and the simulation technology thereof is receiving more and more attention. In order to simulate the soft tissue deformation realistically in real time in the virtual surgery, many problems still need to be solved in the aspect of the soft tissue physical deformation model.
In the traditional refining method, a grid refining algorithm is used for carrying out global refining on an original three-dimensional grid model, so that the requirement of improving the simulation precision is met. However, a great disadvantage of the conventional refining method is that the data size is increased in a geometric progression during the grid refining, and the requirement of simulation instantaneity is difficult to meet.
Disclosure of Invention
Aiming at the defects of the prior art, the invention provides a soft tissue deformation simulation method based on self-adaptive mesh refinement of softness, wherein a mesh refinement method is used for encrypting a triangular mesh in a soft tissue operation deformation area, so that the sense of reality of deformation simulation is improved, and an original triangular mesh model with lower precision is reserved in a non-operation area, so that the calculation efficiency is improved.
In order to achieve the purpose, the technical scheme of the invention is as follows: a soft tissue deformation simulation method based on self-adaptive mesh refinement of softness comprises the following steps:
step S1: detecting a collision point between the soft tissue model and an external force by using a collision detection algorithm, and addressing according to the stress point to use a mass point closest to the collision point as an external force action point;
step S2: calculating the conduction range of the external force, and determining the thinning area range of the deformation grid;
step S3: calculating the softness of the soft tissue model in the thinning area of the deformed grid, and calculating a grid thinning threshold according to the softness;
step S4: determining grids in a thinning area according to a grid thinning threshold, and further thinning a certain grid surface patch in the thinning area if the side length of the surface patch is greater than the grid thinning threshold;
step S5: marking a surface patch which does not need to be refined as a dead surface, marking a mesh which needs to be refined as a live surface, calculating normal vectors and three-dimensional coordinates of a new vertex and a related old vertex by adopting a loop refining method, and connecting the vertices according to a corresponding topological connection rule to finish mesh refinement;
step S6: the heterogeneous grids are transited by utilizing a crack elimination algorithm;
step S7: and repeating the steps S4-S6 until the grids all meet the requirements.
Further, the step S2 is specifically: and presetting a threshold, and when the stress of the external force action point is smaller than the threshold, assuming that the action force can not be conducted to the next mass point any more, and determining the boundary of the refining area by the force conduction range.
Further, the threshold is set to 0.01N.
Further, the step S3 specifically includes:
step S31: according to the acceleration difference between adjacent particles of the soft tissue model and the self curvature of the deformation area, the softness of the soft tissue in the deformation grid refining area is calculated:
adjacent particlesi、jThe acceleration difference between them is:
the curvature of the deformation area is calculated by the normal difference of the triangular patch where each vertex is located, and the normal difference of the triangular patch where adjacent particles i and j are located is as follows:
wherein the content of the first and second substances,
,x
iand x
jRepresenting the coordinates of particle i and particle j respectively,
a i and
a j representing the acceleration of the particle i and the particle j respectively,
arepresenting particle acceleration, n
i And n
j Respectively, the normal lines of the triangular patches where the particle i and the particle j are located are represented, n represents the particle normal line, and softness S is calculated as follows:
wherein the content of the first and second substances,
,
,
the maximum acceleration difference of the particle is represented,
represents the maximum extremum of the normal difference;
step S32: calculating the maximum threshold of the side length of the triangular patch of the refined region
:
Wherein S isiAnd SjRespectively representing the softness of the particle i and the softness of the particle j;
step S33: set the minimum side length of the triangular patch
。
Further, the air conditioner is provided with a fan,
。
further, the step S6 is specifically: inserting a new point on the edge of the grid to be refined, and generating a crack on the edge adjacent to the transition grid;
and then connecting the new point on the edge with the opposite vertex of the adjacent transition mesh to divide the transition mesh into two, so that the refined area and the unrefined area are smoothly connected.
Compared with the prior art, the invention has the beneficial effects that:
(1) the mesh refining method is applied to the soft tissue organ model, when the soft tissue is deformed, the mesh is refined in the deformation area, not only can the geometric characteristics of the deformation area be shown, but also the deformation process can be simulated more truly;
(2) the triangular mesh is encrypted in the soft tissue operation deformation area by using a mesh refinement method, so that the reality of deformation simulation is improved. And the original triangular mesh model with lower precision is reserved in the non-operation area, so that the calculation efficiency is improved.
Detailed Description
The invention is further explained below with reference to the drawings and the embodiments.
As shown in fig. 1, a soft tissue deformation simulation method based on adaptive mesh refinement of softness includes the following steps:
step S1: detecting a collision point between the soft tissue model and an external force by using a collision detection algorithm, and addressing according to the stress point to use a mass point closest to the collision point as an external force action point;
step S2: calculating the conduction range of the external force, and determining the thinning area range of the deformation grid;
step S3: calculating the softness of the soft tissue model in the thinning area of the deformed grid, and calculating a grid thinning threshold according to the softness;
step S4: determining grids in a thinning area according to a grid thinning threshold, and further thinning a certain grid surface patch in the thinning area if the side length of the surface patch is greater than the grid thinning threshold;
step S5: marking a surface patch which does not need to be refined as a dead surface, marking a mesh which needs to be refined as a live surface, calculating normal vectors and three-dimensional coordinates of a new vertex and a related old vertex by adopting a loop refining method, and connecting the vertices according to a corresponding topological connection rule to finish mesh refinement;
step S6: the heterogeneous grids are transited by utilizing a crack elimination algorithm;
step S7: and repeating the steps S4-S6 until the grids all meet the requirements.
When the soft tissue is operated, no matter the soft tissue is pulled or pressed by an instrument, the contacted surface is a region with concentrated stress and a place with larger deformation, so the stress of mass points is taken as the criterion of local refinement. In this embodiment, the step S2 specifically includes: and presetting a threshold, and when the stress of the external force action point is smaller than the threshold, assuming that the action force can not be conducted to the next mass point any more, and determining the boundary of the refining area by the force conduction range.
The smaller the threshold, the larger the refined region. As shown in FIG. 2, assuming that an external force is applied to the position of mass point 0 in the figure, the displacement of mass point 0 will generate a pulling force on the mass point in the 1-neighborhood, and then may be transmitted to the 2-neighborhood, the 3-neighborhood, etc., and the force is less transmitted to the outside until the force is less than the threshold value, so that the calculation is not performed.
In the present embodiment, the threshold is set to 0.01N.
If the particle motion condition of the soft tissue is clear when the soft tissue is stressed, the most vivid deformation effect is represented by 'softness', and the softness is related to the fineness degree of the grid. Thereby establishing the relationship of the forced movement-softness-fine degree of the grid of the stomach inner wall of the soft tissue.
Second law of Newton
It can be known that the object generates acceleration when being subjected to force movement, and the acceleration is in direct proportion to the force, so the acceleration of the mass point is used to represent the force-receiving movement state of the mass point in the grid. From the analysis, it is known that softness is related to the motion of the grid, and the difference in acceleration between adjacent particles in the grid requires softness.
In this embodiment, the step S3 specifically includes:
step S31: according to the acceleration difference between adjacent particles of the soft tissue model and the self curvature of the deformation area, the softness of the soft tissue in the deformation grid refining area is calculated:
adjacent particlesi、jThe acceleration difference between them is:
except for acceleration difference of particle motion, the curvature of the deformation region needs certain softness, the curvature of the deformation region is calculated by the normal difference of a triangular patch where each vertex is located, and the normal difference of the triangular patches where adjacent particles i and j are located is as follows:
wherein the content of the first and second substances,
,x
iand x
jRepresenting the coordinates of particle i and particle j respectively,
a i and
a j representing the acceleration of the particle i and the particle j respectively,
arepresenting particle acceleration, n
i And n
j Respectively, the normal lines of the triangular patches where the particle i and the particle j are located are represented, n represents the particle normal line, and softness S is calculated as follows:
wherein the content of the first and second substances,
,
,
the maximum acceleration difference of the particle is represented,
represents the maximum extremum of the normal difference; the maximum value is set to avoid one of themThe factors are infinitely amplified to influence the calculation of the softness of the area so as to better control the mesh refining process;
step S32: the triangular mesh needs to be finer as the softness is larger, and the side length of the triangle is smaller as the mesh is finer. Therefore, the side length threshold of the triangular mesh can be determined according to the softness value calculated above
Calculating the maximum threshold of the side length of the triangular patch in the refined region
:
Wherein S isiAnd SjRespectively representing the softness of the particle i and the softness of the particle j;
step S33: set the minimum side length of the triangular patch
Only the maximum side length for refining the triangular patch is specified to be insufficient, so that in order to avoid the phenomenon of excessive refinement of the refinement, the triangular patches with some edges close to the threshold and some edges short are generated, a plurality of triangles with small areas and poor quality in the region are caused, the simulation efficiency is influenced, the quality for refining the triangular patch is controlled, and therefore the minimum side length is set
。
In the present embodiment, setting
。
Because the balanced adaptive refining strategy may cause excessive crack migration and refining, and the refining levels of adjacent surfaces change after the unbalanced adaptive refining strategy performs different refining for multiple times, the refining levels of the adjacent surfaces are different from each other finally, so that the refining quality is influenced, the invention provides an improved crack elimination algorithm on the basis of the two strategies, and the working schematic diagram of the improved crack elimination algorithm is shown in fig. 3(a), fig. 3(b) and fig. 3 (c). The unrefined meshes that are adjacent to the edge of the mesh being refined are referred to as transition meshes.
In this embodiment, the step S6 specifically includes: inserting a new point on the edge of the grid to be refined, and generating a crack on the edge adjacent to the transition grid; and then connecting the new point on the edge with the opposite vertex of the adjacent transition mesh to divide the transition mesh into two, so that the refined area and the unrefined area are smoothly connected. The same method is also used in the areas with different refinement levels to realize good transition of the grids between different refinement levels, so that the model grid is smoother, and a better visual effect is achieved.
The specific experiment is realized on a computer with Intel (R) core (TM) i7-5500U CPU 2.40GHz and 8G RAM, display card ATI Radeon R9M 375 and display memory 2G by taking OpenGL open source graphic library as a basis, VS2010 as a development platform and C + + as a development language. For better comparison, two models are set in the experiment, one is a soft tissue model with a mass point number of 715 and is used for the mesh adaptive refining experiment, as shown in fig. 4, and the other is a model after the model is globally refined, as shown in fig. 5.
In the experiment, the total mass of the model mass point is set to be 75, the elastic coefficient of the spring is 3, the damping coefficient is 0.5, the time step is 0.01, and the iteration times are 10 times. The mouse was used to control the surgical instrument to stretch the soft tissue model and the globally refined model of 715 particles, the results of which are shown in fig. 6-8.
FIG. 6 is a drawing of the effect of the soft tissue model to realize the once refinement of the adaptive mesh, the stressed particles on the soft tissue are obtained by collision detection and stress point addressing, the force transmission range is calculated by taking the particles as the center, the range is taken as the region for mesh refinement, and the mesh is refined according to the calculated mesh side length threshold, so that the deformation simulation of the soft tissue adaptive mesh refinement is realized, and the deformation effect is more real as can be seen from the drawing. FIG. 7 is a drawing of the effect of the tensile deformation of the global soft tissue refinement model under the action of a large force, and the deformation effect is relatively real. Fig. 8 is an effect diagram of the soft tissue model for realizing the secondary refinement of the tensile deformed grid under the action of a large force, and it can be seen from the diagram that the soft tissue generates large deformation, but the precision of the deformed area grid is improved due to the grid refinement, so that the deformation effect equivalent to the globally refined model is achieved.
The above are preferred embodiments of the present invention, and all changes made according to the technical scheme of the present invention that produce functional effects do not exceed the scope of the technical scheme of the present invention belong to the protection scope of the present invention.