Soft tissue cutting simulation method and device and medium
By using position dynamics method to perform soft tissue cutting simulation in the virtual surgical system, complex calculation problems in the prior art are solved, and fast, real-time and accurate simulation effects are achieved.
Patent Information
- Application Number
- CN202311248247.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-23
- Publication Date
- 2025-03-25
AI Technical Summary
The prior art is complex in the calculations and difficult to achieve fast, real-time and accurate simulations when soft tissue cutting is performed in virtual surgical systems.
Soft tissue cutting simulation was performed using a position dynamics (PBD)-based method. By obtaining models of soft tissue and scalpel, collision detection and surface fitting, the cutting plane was determined and the model parameters were updated.
It realizes fast, real-time and accurate simulation of soft tissue cutting, simplifies the complexity of traditional collision detection algorithms, and improves the authenticity and efficiency of the simulation.
Smart Images

Figure CN119694578A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of computer graphics, and in particular to a soft tissue cutting simulation method, device and computer-readable storage medium. Background Art
[0002] With the continuous development of computers, virtual surgery simulation systems are widely used in medicine. Based on medical image data, they use computer graphics to reconstruct virtual human soft tissue models, simulate virtual medical environments, and use surgical systems that interact with each other using interactive devices.
[0003] Real-life surgical operations such as collision, cutting, suturing, and hemostasis can be realistically restored in the virtual surgery system through virtual reality technology. The general construction process of virtual surgery includes modeling, deformation drive, cutting, suturing, etc. After scanning the epidermal model of the soft tissue, a model body is constructed. Commonly used model bodies include tetrahedron models, hexahedron models, metaball models, particle models, etc. The drive is to add physical or geometric drive methods to the model. Traditional methods include: 1) Finite element-based method: using finite elements to simulate the biomechanical properties inside the tissue, which is easy to process in parallel, but the amount of calculation is large. 2) Geometric rule-based method: using geometric principles to simulate the physical properties of the tissue. Compared with the finite element method, this method has a fast calculation speed, but the deformation and cutting authenticity are reduced. 3) Meshless method: suitable for handling large deformations, it is an extension of the finite element method, but it needs to store surface meshes to represent incision information.
[0004] Cutting is an essential part of surgical simulation. The cutting process mainly involves the simulation of surgical instruments such as scalpels, the simulation of soft tissues, and the cutting process of scalpels and soft tissues. Considering that position-based dynamics (PBD) has different forms of constraint functions, it can cover the simulation of various forms of materials such as soft bodies, rigid bodies, liquids, and gases, and it is convenient to expand to the simulation of more other organs of the human body, and to perform surgical operations such as suturing, cutting, and electrocoagulation of tissues under a unified particle framework. At the same time, the modeling method of position dynamics is simpler, has a faster calculation speed, and has higher real-time performance; it still has good stability under a larger time step. The position dynamics method can better simulate the complex biomechanical properties of soft tissues by adding appropriate constraint functions to the soft tissue model. In order to obtain a more realistic soft tissue deformation effect and meet the real-time requirements of the surgical system, the simulation range can be extended to multiple organs, blood vessels, skin, ligaments, muscles, and even more complex environments, providing more possibilities for the subsequent development of virtual surgical systems. Therefore, the present application adopts PBD to simulate soft tissue cutting, and solves the complex calculation problem when using the traditional collision detection between line segments and the collision detection between line segments and triangle patches. Summary of the invention
[0005] In view of the deficiencies in the prior art, the present application provides a soft tissue cutting simulation method, device and computer-readable storage medium that can quickly, real-time and accurately simulate the soft tissue suturing process.
[0006] This application adopts the following technical solutions:
[0007] In a first aspect of an embodiment of the present application, a soft tissue cutting simulation method is provided, the method comprising: obtaining a model of soft tissue and a scalpel, the model of the soft tissue comprising a plurality of vertices and a plurality of tetrahedrons defined by the vertices; performing collision detection on the scalpel and the soft tissue, determining a collision point according to the collision detection result and determining a stage of the cutting process of the tetrahedron in a current frame, the collision point being a point generated when the scalpel passes through the surface of the tetrahedron, the stages comprising a cutting stage and a cutting completion stage; if the stage is the cutting stage, performing a collision detection on the collision tetrahedron; The collision point is subjected to surface fitting to obtain a cutting plane, and the collision tetrahedron is a tetrahedron where the scalpel collides with the soft tissue; if the stage is the cutting completion stage, the collision point on the collision tetrahedron is subjected to surface fitting to obtain a cutting plane, and the collision tetrahedron is finely divided according to the shape of the cutting plane to obtain a plurality of sub-tetrahedrons; in the cutting stage, a first constraint function of the collision point is determined according to the collision point; or, in the cutting completion stage, a second constraint function of the vertices in the plurality of sub-tetrahedrons is determined according to the vertices of the plurality of sub-tetrahedrons;
[0008] Based on the first constraint function or the second constraint function, position dynamics are used to calculate the model parameters of the soft tissue in the current frame; and the soft tissue is displayed according to the model parameters of the soft tissue in the current frame.
[0009] In a second aspect of the embodiments of the present application, a soft tissue cutting simulation device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, a soft tissue cutting simulation method as in any embodiment of the present application is implemented. In a third aspect of the embodiments of the present application, a computer readable storage medium is provided, wherein a computer program is stored on the computer readable storage medium, and when the computer program is executed by the processor, a soft tissue cutting simulation method as in any embodiment of the present application is implemented.
[0010] The present application provides a soft tissue cutting simulation method between a scalpel and soft tissue, and innovatively proposes a collision detection method between a tool and soft tissue. The collision detection between the scalpel and the soft tissue can be realized by only judging whether the particle point on the scalpel is in the soft tissue and determining the collision point between the particle point of the scalpel and the collision tetrahedron, which simplifies the traditional method of simplifying the scalpel into a line segment and performing the complex calculation process of collision detection between the line segment and the triangular facet of the tetrahedron. In addition, for the cutting stage, the present application performs surface fitting on the cutting plane of the tetrahedron, which can not only step-by-step real-time tracking of the cutting dynamics of the scalpel, but also avoid the tetrahedron being cut into too many sub-tetrahedrons or generating some sub-tetrahedrons of poor quality due to real-time cutting. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In order to more clearly illustrate the technical solutions in the embodiments of the present application, 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 some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0012] Figure 1 This is a schematic diagram of a simulation process for cutting soft tissue based on the PBD technology framework in one embodiment of the present application;
[0013] Figure 2 It is a schematic diagram of the process of the position dynamics algorithm;
[0014] Figure 3 This is a schematic diagram of the cutting process of a scalpel and soft tissue in one embodiment of the present application;
[0015] Figure 4 This is a schematic diagram of a process flow for determining the stage of the cutting process of a tetrahedron in the current frame according to the collision detection result in one embodiment of the present application;
[0016] Figure 5 This is a schematic diagram of the collision detection and response process between a scalpel and a tetrahedron in one embodiment of the present application;
[0017] Figure 6 This is a schematic diagram of the model structure of a scalpel in one embodiment of the present application;
[0018] Figure 7 This is a schematic diagram of the intersection of a scalpel and a tetrahedron in one embodiment of the present application;
[0019] Figure 8 A schematic diagram of a flow chart of determining the stage of the soft tissue cutting process in the current frame according to the collision detection result in an embodiment of the present application;
[0020] Fig. 9 This is a schematic diagram of the types of classification according to the cutout morphology of the tetrahedron in one embodiment of the present application;
[0021] Fig. 9A This is a schematic diagram of the fine division of a tetrahedron in a complete cutting type in an embodiment of the present application;
[0022] Fig. 9B This is a schematic diagram of the fine division of a tetrahedron in an incomplete cutting type in an embodiment of the present application;
[0023] Fig.10 This is a schematic diagram of the structure of a soft tissue cutting simulation device in one embodiment of the present application. DETAILED DESCRIPTION
[0024] The technical solution of the present application is further elaborated in detail below in conjunction with the accompanying drawings and specific embodiments of the specification.
[0025] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those generally understood by those skilled in the art of the present application. The terms used herein in the specification of the present application are only for the purpose of describing specific embodiments and are not intended to limit the implementation of the present application. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0026] The various embodiments of the present application can be combined with each other without conflict. In the following description, the expression "some embodiments" is involved, which describes a subset of possible embodiments, but it should be understood that "some embodiments" can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict.
[0027] The order of steps given in the embodiments of the present application is for illustration only. If the steps can be performed in other orders to achieve the same effect, these orders are also within the scope of protection of the present application.
[0028] In the field of computer graphics, the common physical method for simulating object deformation in real time generally updates the acceleration through external forces first, and then integrates to obtain the velocity and position. Position Based Dynamics (PBD) directly corrects the position through constraint functions, and then updates the velocity through the position. The system equations in the PBD algorithm are constructed by a set of constraint function equations, which include multiple constraint function equations (which can be referred to as constraint functions).
[0029] In PBD, position dynamics algorithms involve two important concepts: mass points and constraints. The model of an object includes multiple particle points that make up the object, also known as mass points. The parameters of the particle points include their position, velocity, and mass. The parameters of the constraint function include the positions of these particle points. The constraint function is used to describe the relationship between the particle points that make up the object. The constraint function is a type of function that takes the positions of multiple particle points as variables and is used to solve the mechanical behavior of the deformation model.
[0030] The present application is a simulation method, so the soft tissue therein is simulated soft tissue, that is, it is embodied in the form of a soft tissue model. For the sake of simplicity of description, the simulated soft tissue involved in various processing operations performed in the embodiments of the present application can be referred to as soft tissue, and the simulated scalpel involved in various processing operations performed in the embodiments of the present application can be referred to as a scalpel.
[0031] like Figure 1As shown, it is a schematic diagram of the process of simulating the cutting of soft tissue based on the PBD technology framework in one embodiment of the present application.
[0032] S1: Construct a tetrahedral network model of soft tissue and initialize the model parameters.
[0033] In medicine, firstly, tomography technology (such as magnetic resonance imaging, computer tomography) is used to obtain electromagnetic signals from the human body and collect two-dimensional tomographic images of the human body (Magnetic Resonance Imaging, MRI or Computer Tomography, CT). Then, with the help of a computer, the acquired two-dimensional tomographic images are reconstructed into a three-dimensional geometric model, such as a tetrahedral network model.
[0034] For soft tissue, its model includes a mesh model of multiple vertices and tetrahedrons defined by the vertices. The vertices here are similar to particle points, and its constraint functions mainly include distance constraints between adjacent vertices, dihedral angle constraints between adjacent triangular faces, and volume invariance constraints of each tetrahedron.
[0035] The scalpel can be approximated as a rigid body, and its model generally includes multiple mass points / particle points arranged according to its shape. For example, the scalpel is abstracted as a straight line segment composed of multiple particle points. Since the scalpel is generally under the direct control of the user, the PBD process can be omitted, and the kinematic equation can be directly used to calculate its posture and the position of each particle point in the model.
[0036] The PBD algorithm mainly includes the initial stage and the real-time simulation stage. In the initial stage, Figure 2 In the steps 1-3 of the PBD algorithm flow shown in the figure, the parameters of all the particle points that make up the object are initialized according to the preset model parameters of the object, such as the initial position, initial posture, number of particle points, etc. Among them, the mass is initialized in the form of a reciprocal, on the one hand to avoid division operations in the program, and more importantly, to use w i = 0 more conveniently represents a particle with infinite mass. In the embodiments of the present application, the model parameters may be referred to as parameters of the model, that is, parameters of the particle points in the model, such as the aforementioned position, velocity and mass.
[0037] Then it enters the real-time simulation stage, and executes the process of simulating the deformation of the object according to the environment (including possible operation instructions from the user) in a loop in frames, that is, it is executed once for each frame. Figure 2 The real-time simulation phase can specifically include three parts: prediction, constraint modification, and variable update.
[0038] S2: Based on the positions of each particle point in the previous frame, predict the positions of each particle point in the current frame.
[0039] In the predicted part of the current frame (corresponding to Figure 2 In steps 4-7), the external environment force of the current frame is converted into displacement as much as possible, and the external force that cannot be directly converted into displacement (such as gravity) is retained. Based on the position of each particle point in the previous frame, the position of each particle point in the current frame is predicted by combining the displacement obtained by conversion and the external force that cannot be directly converted.
[0040] S3: Constrain the model and solve the constraints to get the exact position of each particle point.
[0041] The above prediction part often only uses integrals (such as explicit Euler integrals) to directly predict the position of each particle point in the current frame, without considering the mechanical properties of the object and its interaction with the environment. Therefore, it cannot be directly used as the simulation result of the current frame, but the constraint function must be used to correct the position of the particle point. Figure 2 Step 5 in the above example, in the time interval Δt, traverse all the particle points of the model and calculate the external forces f including gravity. ext Calculate and then make a preliminary prediction of the particle's velocity v by explicit Euler integration i The Δt used in PBD is generally the default frame spacing, that is, the time between two adjacent frames under normal circumstances. Step 6: i Damping is performed to simulate the speed decay phenomenon caused by energy dissipation during the motion of the object. Step 7 is to i and the velocity v after damping i , the initial prediction after Δt is solved by explicit Euler integration method to obtain the predicted position of the particle p i This predicted position is not the final result. It is necessary to traverse all constraints in step 8 and solve the constraints to obtain the accurate position of each particle.
[0042] Constraint functions are used to restrict the relationship between particle points. There are two main types: one is a temporary constraint function, which is usually generated temporarily when an object is detected to interact with external objects in the environment; the other is a regular constraint function, which is determined by the mechanical properties of the object. The process of calculating the corrected position that satisfies the constraint function as much as possible based on the constraint function and the current position is called constraint projection, which is the core process of PBD. Constraint correction is essentially an iterative optimization of the position of the particle point based on the constraint function equation group. The specific implementation is generally an iterative execution of the process of using the constraint functions in the constraint function equation group to perform constraint projection in turn until the set number of iterations is reached, so as to find the particle point position that satisfies all the constraint functions in the constraint function equation group as much as possible.
[0043] S4: Simulate the collision detection and collision response between the scalpel and soft tissue.
[0044] In the virtual surgery simulation system, collision detection runs through the entire cutting process. In each time step, the system always performs collision detection on the soft tissue model and the virtual scalpel, and makes different collision responses according to different detection results.
[0045] S5: Add collision constraints and update and correct the positions of each particle point.
[0046] After the constraint correction is completed, the result is the position of each particle point in the current frame, based on which the speed of each particle point in the current frame can be calculated, and then the corresponding variables are updated for display and calculation of the next frame. Figure 2 In step 8, collision constraints are dynamically generated based on the relative positions of the particle points of the current model and the external collision body, which are used to simulate the displacement of the model under the action of the external collision body. After the collision constraints are generated, they will be immediately added to the constraint list and wait for solution. Steps 9-11 are the core of the PBD method. Here, according to the set number of iterations, the Gauss-Seidel method can be used to solve all constraints in the constraint list, and the predicted position pi of the particle can be corrected and updated in real time. Generally speaking, the more iterations, the smaller the system error.
[0047] Update some corresponding Figure 2 In steps 12-15, the displacement of the particle is first calculated based on the predicted position pi and the current position xi, and then the particle velocity vi is inferred, and finally the current position is updated to pi. When the above process is completed, the current particle's vi and xi are used as inputs, and the loop is returned to the beginning to continue the iterative optimization of steps 4-17. The result obtained after the constraint correction is the position of each particle point in the current frame, based on which the velocity of each particle point in the current frame can be calculated, and then the corresponding variables are updated for display and calculation of the next frame.
[0048] S6: Render and display the calculated soft tissue model and scalpel model's position and posture in relevant display software.
[0049] After executing the simulated object deformation process of the current frame, the model parameters in the current frame can be obtained. The model parameters specifically include the updated parameters of each particle point, such as the position of each particle point. Among them, the updated position of each particle point can be used to determine the morphology of the soft tissue in the current frame for display. According to the calculated position and posture of the soft tissue and surgical instruments, they are rendered and displayed in the relevant display software, wherein the surgical instruments include scalpels, surgical forceps, needle holders, tweezers, suture needles, etc.
[0050] It should be noted that the vertices and particle points in this application are actually equivalent in the PBD framework. In order to simplify the description, different names are selected for the particle points in different models, that is, the particle points in the soft tissue model are called vertices, and the particle points in the scalpel model are called particle points.
[0051] Combined with the above preliminary introduction to the soft tissue cutting simulation method based on the PBD algorithm, Figure 3 The soft tissue cutting simulation method provided in the embodiment of the present application is further described in detail. Since object simulation is a real-time process, when the current frame is mentioned below, it means to describe the specific process of object simulation within a frame by taking the current frame as an example. In fact, the process must be executed in each frame.
[0052] In step S4, the collision detection and collision response between the scalpel and the soft tissue are simulated. Please refer to Figure 3 The soft tissue cutting process is the process of collision detection and collision response between the scalpel and the soft tissue. The soft tissue cutting simulation method provided in this application includes the following steps:
[0053] S20: Acquire models of soft tissue and scalpel, wherein the model of soft tissue includes a plurality of vertices and a tetrahedron defined by the vertices, and the vertices of the tetrahedron include model parameters.
[0054] The model of the soft tissue is a mesh model including multiple vertices and tetrahedrons defined by the vertices, and the model of the scalpel includes multiple particle points arranged according to its shape. For detailed information of the model, please refer to the above related description.
[0055] S21: performing collision detection between the scalpel and the soft tissue, determining the collision point according to the collision detection result, and determining the stage of the cutting process of the tetrahedron of the soft tissue in the current frame.
[0056] In a virtual environment, objects often collide with each other due to their movement. In order to ensure the authenticity of the virtual environment and enhance the user's immersion, it is necessary to detect the occurrence of these collisions and the location of the collision points in a timely manner, as well as determine the stage of the tetrahedron cutting process in the current frame, and provide relevant information for the collision response so that the colliding objects can make correct movements and dynamically respond to the real effect. Among them, the collision points include the face intersection points and edge intersection points generated by the scalpel passing through the tetrahedron.
[0057] In the total deformation and cutting time of the physical model, the collision detection time accounts for a large proportion. On the basis of optimizing the deformation modeling and cutting modeling algorithms, the collision detection efficiency should be further improved. In order to improve the collision detection efficiency, in this embodiment, the collision detection is divided into two stages: rough collision detection and fine collision detection during the cutting process.
[0058] like Figure 4 As shown, in one embodiment of the present application, step S21 specifically includes:
[0059] S211: In the rough collision detection, it is detected whether the scalpel collides with the entire soft tissue.
[0060] In the rough collision detection, it can be understood as performing a collision detection between the scalpel and the entire soft tissue in the initial state. The rough collision detection at this stage can be detected by using the hierarchical bounding box method or the spatial decomposition method. For example, when using the bounding box method, two bounding boxes for the scalpel and the entire soft tissue are constructed respectively to determine whether there is an overlapping area between the two bounding boxes in space. If there is no overlapping area, it means that the scalpel has not collided with the entire soft tissue; if there is an overlapping area, it means that the two bounding boxes of the scalpel and the entire soft tissue have collided, and it is necessary to perform a fine collision detection on the overlapping area again, because the bounding box of the scalpel and the bounding box of the entire soft tissue cover a large space, resulting in the two objects that originally did not collide being mistakenly detected as colliding, so further judgment is required, that is, entering the fine collision detection to determine whether the particle points on the scalpel model collide with the tetrahedron in the soft tissue.
[0061] S212: Detect whether the angle between the blade direction of the scalpel and the surface of the soft tissue meets a threshold condition.
[0062] In rough collision detection, in order to prevent the scalpel from accidentally hitting the soft tissue or other surfaces of the scalpel, such as the back of the scalpel hitting the soft tissue and causing miscutting, it is necessary to judge the direction of the scalpel and the angle between the scalpel and the surface of the soft tissue. Detect whether the direction of the scalpel blade is facing the soft tissue, and whether the angle between the direction of the scalpel blade and the surface of the soft tissue meets the threshold condition.
[0063] S213: If the threshold condition is met, start fine collision detection; otherwise, adjust the blade direction or angle to meet the threshold condition.
[0064] When the direction of the scalpel blade is toward the soft tissue and if the threshold condition is met, fine collision detection is started; otherwise, when the direction of the scalpel blade is not toward the soft tissue, the direction of the blade is adjusted; or, when the angle between the scalpel blade and the surface of the soft tissue does not meet the threshold condition, the size of the angle is adjusted to meet the threshold condition. Only when the direction of the scalpel blade is toward the soft tissue and the threshold condition is met that the blade direction is perpendicular to the soft tissue surface angle, or the blade direction and the soft tissue surface angle value are within the range of 0° to 90°, the soft tissue can be cut and fine collision detection can be started. Otherwise, it is necessary to further adjust the blade direction and / or the angle between the blade and the surface of the soft tissue to meet the threshold condition.
[0065] S214: In the precision collision detection, the collision and collision response of the scalpel and the multiple tetrahedrons constituting the soft tissue are detected.
[0066] S215: Determine the collision point and the stage of the tetrahedron cutting process in the current frame according to the collision detection result.
[0067] In precise collision detection, Figure 5 As shown, the process of step S214 mainly includes collision detection and response between the scalpel and the tetrahedron constituting the soft tissue. In order to simulate cutting in three-dimensional space, the model of the scalpel includes multiple particle points arranged according to its shape, such as Figure 6 As shown in FIG. 1 , it is assumed that a scalpel is composed of a plurality of particle points, wherein the particle point at the farthest end of the scalpel model is a knife tip 301, the particle point in the middle is a blade 302, and the proximal end is a handle 303. The model of the soft tissue includes a plurality of vertices and a series of tetrahedrons defined by the vertices. In some embodiments, as Figure 7 The shadow part of the collision tetrahedron shown is the cutting plane, which is the plane formed by the scalpel cutting the collision tetrahedron. The collision tetrahedron is the tetrahedron where the scalpel collides with the soft tissue model. When the operator moves in each frame, at t i and t i+1 In two different animation frames, the trajectory of the particle points forms a quadrilateral. Assuming that the scalpel does not twist, the quadrilateral is flat, otherwise it is curved. The collision points generated by the collision between the scalpel and the collision tetrahedron include the edge intersection points of the collision tetrahedron, the surface intersection points of the collision tetrahedron, and the blade movement path points inside the collision tetrahedron. Figure 7 As shown in the figure, the solid points are the edge intersections of the blade and the collision tetrahedron, the hollow points on the surface of the collision tetrahedron are the face intersections of the blade and the collision tetrahedron, the hollow points inside the collision tetrahedron are the moving path points of the blade inside the collision tetrahedron, and the annular points are the tip path points generated by the collision between the blade tip and the collision tetrahedron. It is worth noting that the number of collision points can be set according to the particle point interval as needed, so as to control the density of the collision points generated by the collision between the scalpel and the tetrahedron, including the number of the tip path points can also be set as needed.
[0068] When performing collision detection between the scalpel and the collision tetrahedron, it is necessary to traverse each particle point on the scalpel. Figure 5 As shown, the steps of precise collision detection include:
[0069] S2141: When the direction of the scalpel blade is toward the soft tissue and the angle between the scalpel blade and the surface of the soft tissue meets the threshold condition, traverse whether the particle point is located inside the soft tissue, and determine the target particle point located inside the soft tissue according to the traversal result.
[0070] Assume that the number of particle points on the scalpel is N, and the index of the particle points on the scalpel starts from 0, and the particle points of the scalpel are traversed one by one until all the particle points on the scalpel are traversed. When traversing and judging each particle point of the scalpel, since the scalpel may not all enter the soft tissue, only the particle points at the distal end of the scalpel may enter the soft tissue. When traversing the particle points, the target particle points located inside the soft tissue are determined according to the traversal results, where the target particle points are the particle points of the scalpel located inside the soft tissue. It is necessary to determine the target particle points inside the soft tissue.
[0071] In some embodiments, based on the particle point interval, it can be determined whether a new particle point has entered the soft tissue to become a target particle point and / or a new target particle point has entered the soft tissue to become a non-target particle point. The particle point interval is the distance between adjacent particle points initially set by the scalpel.
[0072] S2142: In response to the target particle point inside the soft tissue, determine whether the target particle point enters the soft tissue for the first time.
[0073] If some or all of the scalpel's particle points are inside the soft tissue, the particle points inside the soft tissue are called target particle points, and it is judged whether the target particle points enter the soft tissue for the first time. In the adjacent time interval, that is, the position of the target particle point in the previous frame and the position of the target particle point in the current frame are used for judgment. If the particle point in the previous frame is not inside the soft tissue, but in the current frame, the particle point is inside the soft tissue, it can be judged that the particle point is the target particle point and enters the soft tissue for the first time.
[0074] S2143: If the target particle point enters the soft tissue for the first time, determine the collision point generated by the collision between the target particle point and the collision tetrahedron and the index of the collision tetrahedron where the target particle point is located in the current frame according to the position of the target particle point in the previous frame and the current frame.
[0075] If the target particle point enters the soft tissue for the first time, the collision plane and collision point where the target particle point collides with the collision tetrahedron are determined according to the position of the target particle point in the previous frame and the current frame, and the index of the collision tetrahedron where the target particle point is located in the current frame is recorded. The collision plane is the plane where the target particle point collides with the collision tetrahedron. According to the position of the target particle point in the previous frame and the current frame, it can be determined which specific tetrahedron outer surface in the soft tissue the target particle point passes through and the position of the collision point passing through the outer surface of the collision tetrahedron. The index of the collision tetrahedron where the target particle point is currently located is recorded and stored, where the index refers to the order of the tetrahedron, which can also be called the number of the tetrahedron. Each tetrahedron has a number. The vertex information of the tetrahedron can be called out through the index, and this information is recorded in the corresponding array. Among them, the vertex information of the collision tetrahedron includes information such as coordinate position, velocity and mass.
[0076] S2144: If the target particle point does not enter the soft tissue for the first time, determine whether the position of the target particle point in the current frame is still in the collision tetrahedron of the previous frame according to the index of the collision tetrahedron where the target particle point in the previous frame is located.
[0077] S2145: If the position of the target particle point in the current frame is still in the tetrahedron of the previous frame, the coordinates of the target particle point in the current frame are recorded.
[0078] If the position of the target particle point in the current frame is still in the collision tetrahedron of the previous frame, the coordinates of the target particle point in the current frame are recorded and stored to provide position information when the target particle point collides with the tetrahedron in the next frame, which is used to calculate the collision point. If the position of the target particle point in the current frame is still in the collision tetrahedron of the previous frame, the index of the collision tetrahedron where the target particle point is located in the current frame can continue to call the index of the collision tetrahedron of the previous frame, without repeatedly storing the index data of the collision tetrahedron.
[0079] S2146: If the position of the target particle point in the current frame is not in the collision tetrahedron of the previous frame, determine the collision point where the target particle point in the current frame passes through the collision tetrahedron of the previous frame.
[0080] If the position of the target particle point in the current frame is not in the collision tetrahedron of the previous frame, the collision plane and collision point of the collision tetrahedron where the target particle point in the current frame passes through in the previous frame are determined based on the spatial position relationship between the position of the target particle point in the current frame and the collision tetrahedron in the previous frame. If the target particle point in the current frame is not in the tetrahedron of the previous frame, the surface of the collision tetrahedron through which the target particle point passes can be determined based on the volume relationship of the current position of the target particle point relative to the original collision tetrahedron, and whether the target particle point enters the tetrahedron adjacent to the surface. At the same time, the position of the collision point passing through the collision plane can be calculated based on the position relationship of the target particle point in the previous frame and the current frame relative to the positive and negative normal directions of the collision plane.
[0081] Among them, according to the spatial position relationship between the position of the target particle point in the current frame and the collision tetrahedron in the previous frame, determining the collision plane and collision point of the collision tetrahedron where the target particle point in the current frame passes through the previous frame includes: according to the directed volume relationship between the position of the target particle point in the current frame and the collision tetrahedron where the target particle point is located in the previous frame, determining the collision plane and collision point of the collision tetrahedron where the target particle point in the current frame passes through the previous frame; or, according to the centroid coordinate relationship between the position of the target particle point in the current frame and the collision tetrahedron where the target particle point is located in the previous frame, determining the collision plane and collision point of the collision tetrahedron where the target particle point in the current frame passes through the previous frame.
[0082] In one embodiment, according to the directed volume relationship between the target particle point in the current frame and the tetrahedron in the previous frame, it is assumed that the four vertices a, b, c, d of the collision tetrahedron in the previous frame and the target particle point P in the current frame are located inside the collision tetrahedron, and it is determined whether the point P is located inside the collision tetrahedron. First, the directed volume of the collision tetrahedron in the previous frame is calculated, and then the directed volumes of the four sub-tetrahedrons formed by the point P and the four vertices a, b, c, d of the collision tetrahedron are calculated, and it is determined whether the signs of the directed volumes of the collision tetrahedron in the previous frame and the directed volumes of the four sub-tetrahedrons in the current frame are the same. If the signs are the same, the point P is located inside the collision tetrahedron of the previous frame, otherwise, it is located outside the collision tetrahedron of the previous frame, and it is determined that the point P passes through the collision plane and collision point of the collision tetrahedron in the previous frame.
[0083] In another embodiment, according to the relationship between the centroid coordinates of the target particle point and the collision tetrahedron in the previous frame, assuming that the four vertices a, b, c, d of the collision tetrahedron in the previous frame and the target particle point P in the current frame, it is determined whether the point P is located inside the tetrahedron. The centroid coordinates of the point P are calculated, and the centroid coordinates include the four weights of the point P relative to the points a, b, c, and d. If the numerical ranges of the four weights are all within the interval [0,1], the point P is located inside the collision tetrahedron in the previous frame; if one of the weights is not within this range, the distribution of the point P outside the collision tetrahedron in the previous frame can also be determined based on its cross-domain method, for example, it can be determined that the point P passes through the collision plane of the collision tetrahedron in the previous frame.
[0084] S2147: Perform collision response on the collision point, add two temporary nodes to each collision point, and move the two temporary nodes of each collision point by a threshold distance along the positive and negative normal directions perpendicular to the cutting plane.
[0085] The collision point is subjected to collision response. Collision response refers to the processing of the colliding objects. This processing is generally as close as possible to people's understanding of physical laws to avoid obvious abnormal interactions between the colliding objects, such as penetration. Among them, the collision point includes the first collision point and the second collision point. The first collision point is the path point of the scalpel tip, and the second collision point is the intersection point of the scalpel blade with the face and edge of the collision tetrahedron.
[0086] When there is only a second collision point, two temporary nodes are added to each second collision point, and the temporary nodes are moved by the first threshold distance in the positive and negative directions of the normal perpendicular to the cutting plane to simulate the first collision response of the scalpel to the collision tetrahedron. The first threshold distance is a fixed value. The first collision response is the deformation process of the scalpel completely cutting the collision tetrahedron, for example Fig. 9 The type of cutting planes for the first and second collision tetrahedrons in .
[0087] When the collision points include the first collision point and the second collision point, two temporary nodes are added to each second collision point, and the two temporary nodes are moved by a second threshold distance in the positive and negative directions of the normal perpendicular to the cutting plane, respectively. Two cutting planes are fitted based on the first collision point and the temporary nodes, so as to simulate the second collision response of the scalpel to the collision tetrahedron. The second threshold distance is a linear distance. For example, the distance moved by the two temporary nodes in the previous frame is L1=kx1, k is a coefficient, and x1 is the position of the second collision point in the previous frame. Then, the distance moved by the two temporary nodes in the current frame can be L2=kx2, and x2 is the position of the second collision point in the current frame, so that the first collision point and the two cutting planes fitted by the temporary nodes are in a certain angle relationship. The second collision response is the deformation process of the scalpel incompletely cutting the collision tetrahedron. For example Fig. 9The type of cutting planes for the 3rd to 5th collision tetrahedrons in .
[0088] In the process of collision response between the scalpel and the tetrahedron, it is also necessary to determine the stage of the soft tissue cutting process in the current frame, wherein the cutting stage includes the cutting stage and the cutting completion stage.
[0089] like Figure 8 As shown, in step S215, the stage of the soft tissue cutting process in the current frame is determined according to the collision detection result, which specifically includes the following steps:
[0090] S2151: judging whether the multiple target particle points in the current frame are within the collision tetrahedron according to the index of the collision tetrahedron where the multiple target particle points of the scalpel are located;
[0091] S2152: If all the target particle points in the current frame are not within the collision tetrahedron, the cutting process in the current frame is at the cutting completion stage;
[0092] S2153: If a plurality of target particle points in the current frame are partially or completely within the collision tetrahedron, the cutting process in the current frame is in the cutting stage.
[0093] S22: If the cutting process is in the cutting stage, performing surface fitting on the collision points on the collision tetrahedron to obtain a cutting plane, and determining a first constraint function of the collision points according to the collision points.
[0094] If the collision tetrahedron is in the cutting stage, the collision points on the collision tetrahedron are fitted with a surface to obtain a cutting plane, and two planes or surfaces are fitted according to the first collision point and the second collision point respectively to simulate the cutting process.
[0095] Among them, the surface fitting of the collision points of the collision tetrahedron includes the least square method, spline interpolation, RBF interpolation, fitting based on dihedral angle constraints of position dynamics, etc.
[0096] In some embodiments, a dihedral angle constraint function based on position dynamics is used to perform surface fitting on the collision point to obtain a cutting plane. First, multiple triangular facets are constructed according to the collision point, and then an angle β is determined according to the change in the blade direction, and a dihedral angle constraint is performed on the triangular facet based on the angle β.
[0097] Among them, the dihedral angle constraint function is based on a pair of co-lateral triangles △P3P2P1 and △P4P2P1, and the constraint equation is as follows:
[0098] C dihedral (p1,p2,p3,p4)=arccos(n1·n2)-β(1)
[0099]
[0100]
[0101] In the above formula, n1 and n2 are the unit normal vectors of two adjacent triangles; β is the initial angle of the dihedral angle, that is, the angle between n1 and n2. The bending constraint of the dihedral angle constraint function is independent of the stretching constraint. From the above formula, it can be seen that the dihedral angle bending constraint model calculates the unit normal vector of each triangle on the two triangles sharing the edge, which leads to the calculation amount of the dihedral angle bending constraint model.
[0102] When the tetrahedron is in the cutting stage, the β angle value of the dihedral angle can be constrained according to specific circumstances to achieve the effect of surface fitting and smoothing of the cutting plane of the tetrahedron.
[0103] In some embodiments, where the blade direction changes drastically, the blade direction change α is obtained by summing up the angles of the blade direction during the previous frames of cutting and taking the average value. Based on the change α, the angle value of the dihedral angle of the current frame is calculated: β = 180-α, which can eliminate the jagged incision caused by the drastic change in angle. In this way, the cutting surface can follow the change in the direction of the scalpel and avoid the unevenness caused by the sudden change in angle in the adjacent interval time.
[0104] In other embodiments, when the blade direction changes slowly during cutting, the blade direction change α can be considered to be 0, and β can be a constant, β = 180-0 = 180. Therefore, by changing β to modify the dihedral angle constraint function in the above formula (1), the cutting plane of the collision tetrahedron is fitted to achieve a smooth effect, making the cutting effect more realistic and the effect can be adjusted in a personalized manner.
[0105] In addition, in the cutting stage, the first constraint function of the collision point is determined according to the collision point. The first constraint function includes a conventional constraint function, and the actual position of the collision point in the current frame is obtained by using position dynamics calculation.
[0106] The present application performs surface fitting on the collision points of the collision tetrahedron, that is, fitting is performed while cutting, and the collision tetrahedron is finely divided after the cutting is completed. This can not only track the cutting dynamics of the scalpel in real time in a step-by-step manner, but also avoid the collision tetrahedron being cut into too many sub-tetrahedrons or producing some sub-tetrahedrons of poor quality due to real-time cutting. The collision tetrahedron is fitted while cutting in the embodiment of the present application, and different depths of cut surfaces can be generated according to the path points of the scalpel passing through the collision tetrahedron, and the cut surfaces can also be smoothed to avoid jagged cut surfaces, so as to achieve a more realistic effect of simulating incisions.
[0107] S23: If the cutting process is at the cutting completion stage, a surface fitting is performed on the collision points on the collision tetrahedron to obtain a cutting plane, the collision tetrahedron is finely divided according to the shape of the cutting plane to obtain a plurality of sub-tetrahedrons, and a second constraint function of the vertices in the sub-tetrahedron is determined according to the vertices of the sub-tetrahedron.
[0108] When the tetrahedron is in the cutting completion stage, it is necessary to perform fine division of the collision tetrahedron according to the cut shape of the collision tetrahedron to generate multiple sub-tetrahedrons and generate multiple new vertices, and delete the original collision tetrahedron. The shape of the cutting plane can also be called the cut shape. The present application performs fine division of the collision tetrahedron to generate multiple sub-tetrahedrons, and determines the second constraint function of the vertices in the multiple sub-tetrahedrons according to the vertices of the multiple sub-tetrahedrons. The second constraint function includes a collision constraint function. The collision tetrahedron is divided into multiple sub-tetrahedrons to facilitate the simulation of deformation based on the tetrahedral mesh model, because the simulation of deformation requires tensile constraints and volume constraints based on the tetrahedron.
[0109] like Fig. 9 As shown in the figure, the cut shapes of the collision tetrahedron are specifically divided into 5 categories, among which 1 and 2 are complete cut types, and 3, 4, and 5 are partial cut types or incomplete cut types. The cutting plane divides the collision tetrahedron into two parts, assuming that the upper and lower parts are called M1 and M2 respectively. The one on the positive side of the normal line of the cutting plane is the upper part M1, and the other side is the lower part M2.
[0110] According to the principle of the minimum tetrahedron segmentation method, in order to avoid generating too many sub-tetrahedrons, the following describes an embodiment in which the present application uses a knife to segment the collision tetrahedron into five types of tetrahedron segmentation methods based on collision detection:
[0111] For type 1, the characteristic is that the scalpel cuts through three edges of the collision tetrahedron, and these three edges share a vertex. Fig. 9A From the tetrahedron fine division diagram on the left, we can see that the upper part M1 is already a tetrahedron and does not need to be finely divided. The lower part M2 is a 3-prism, which can be divided into 3 sub-tetrahedrons, so it is divided into 4 sub-tetrahedrons in total, generating 6 new vertices.
[0112] For type 2, the characteristic is that the scalpel cuts through the four edges of the collision tetrahedron. Fig. 9A From the schematic diagram of the detailed division of the collision tetrahedron on the right, we can see that the upper part M1 and the lower part M2 are both 3-prisms, which are divided into 3 sub-tetrahedrons respectively, so a total of 6 sub-tetrahedrons are divided, generating 8 new vertices.
[0113] For type 3, the characteristic is that the scalpel cuts through one edge of the collision tetrahedron. Fig. 9BFrom the schematic diagram of the detailed division of the collision tetrahedron on the left, it can be seen that for the two cut parts, two sub-tetrahedrons are generated in the upper and lower parts respectively, and two sub-tetrahedrons are generated in the upper and lower parts of the remaining parts respectively, so a total of six small tetrahedrons are generated, and four new vertices are generated.
[0114] For type 4, the characteristic is that the scalpel cuts through two edges of the collision tetrahedron. Fig. 9B From the schematic diagram of the detailed division of the collision tetrahedron in the middle, we can see that the upper part generates 3 sub-tetrahedrons, and the lower part is divided into 5 sub-tetrahedrons, so a total of 8 sub-tetrahedrons are generated, and 6 new vertices are generated.
[0115] For type 5, the characteristic is that the scalpel cuts through three edges of the collision tetrahedron, and these three edges do not share a vertex. Fig. 9B From the schematic diagram of the detailed division of the collision tetrahedron on the right, we can see that the upper part M1 generates 4 sub-tetrahedrons, and the lower part M2 generates 5 sub-tetrahedrons, so a total of 9 small tetrahedrons are generated, and 8 new vertices are generated.
[0116] S24: Based on the first constraint function or the second constraint function, obtain the model parameters of the soft tissue in the current frame using position-based dynamics updating.
[0117] In order to simulate the real collision response, multiple sub-tetrahedrons are generated when cutting occurs. When the vertex positions of the tetrahedrons in the current frame change, including when the vertex positions of multiple sub-tetrahedrons change, the original constraint function is updated based on position dynamics to generate a first constraint function or a second constraint function. The first constraint function or the second constraint function projects each vertex to a suitable position, realizing the process of deformation calculated by position, and updating the parameters of a series of tetrahedrons in the current frame, that is, obtaining the model parameters of the soft tissue in the current frame; the model parameters of the scalpel are calculated frame by frame based on position dynamics and / or kinematic equations.
[0118] S24: Displaying the soft tissue according to the model parameters of the soft tissue in the current frame.
[0119] After executing the simulated object deformation process of the current frame, the model parameters of the object in the current frame can be obtained. The model parameters of the object specifically include the vertex parameters of the updated tetrahedron, wherein the positions of each updated vertex can be used to determine the shape of the soft tissue in the current frame for display. In each frame, after completing the calculation and update of the model parameters of the soft tissue and the scalpel, the model can be rendered based on the updated soft tissue, scalpel position and posture, and then output to the display device for display.
[0120] See also Fig.10As shown, it is a schematic diagram of the structure of a soft tissue cutting simulation device provided according to an embodiment of the present application. The object simulation device provided in the embodiment of the present application includes a memory 502 and a processor 501, and the memory 502 stores a computer program executable by the processor 501. When the computer program is executed by the processor 501, a soft tissue cutting simulation method as in any embodiment of the present application is implemented.
[0121] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, each process of the soft tissue cutting simulation method embodiment described above is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium, such as a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0122] The present application provides a method for detecting collision between a scalpel and soft tissue. The method only needs to determine whether a particle point on the scalpel is in the soft tissue, and determine the collision point between the particle point of the scalpel and the collision tetrahedron to realize collision detection between the scalpel and the tetrahedron. This simplifies the traditional method of simplifying the scalpel into a line segment and performing complex calculations for collision detection between the line segment and the triangular facets of the tetrahedron, thereby achieving a technical effect of faster collision detection and less calculation.
[0123] It should be noted that other sorting schemes that can be easily thought of by those skilled in the art within the technical scope disclosed in the present invention should also be within the protection scope of the present invention and will not be described in detail here.
[0124] Exemplarily, the computer program may be divided into one or more modules / units, one or more modules / units are stored in a memory and executed by a processor to implement the present invention. One or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, and the instruction segments are used to describe the execution process of the computer program.
[0125] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0126] An embodiment of the present application provides a computer program product. When the computer program product runs on a mobile terminal, the mobile terminal can implement the steps in the above-mentioned method embodiments when executing the computer program product.
[0127] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0128] As used in the specification of the present application and the appended claims, in the description of the specification of the present application and the appended claims, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0129] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0130] In the embodiments provided by the present invention, it should be understood that the disclosed apparatus / terminal equipment and method can be implemented in other ways. For example, the apparatus / terminal equipment embodiments described above are merely illustrative.
[0131] The present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of each of the above-mentioned method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, the computer-readable medium does not include electric carrier signals and telecommunication signals.
[0132] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.
Claims
1. A soft tissue cutting simulation method, characterized in that: The method comprises: Acquire a model of soft tissue and a scalpel, wherein the model of the soft tissue includes a plurality of vertices and a plurality of tetrahedrons defined by the vertices; Performing collision detection on the scalpel and the soft tissue, determining a collision point and a stage of the cutting process of the tetrahedron in the current frame according to the collision detection result, wherein the collision point is a point generated when the scalpel passes through the surface of the tetrahedron, and the stages include a cutting stage and a cutting completion stage; If the stage is the cutting stage, performing surface fitting on the collision point on the collision tetrahedron to obtain a cutting plane, wherein the collision tetrahedron is a tetrahedron where the scalpel collides with the soft tissue; If the stage is the cutting completion stage, performing surface fitting on the collision points on the collision tetrahedron to obtain a cutting plane, and performing fine segmentation on the collision tetrahedron according to the shape of the cutting plane to obtain a plurality of sub-tetrahedrons; In the cutting stage, a first constraint function of the collision point is determined according to the collision point; or, in the cutting completion stage, a second constraint function of the vertices in the plurality of sub-tetrahedrons is determined according to the vertices of the plurality of sub-tetrahedrons; Based on the first constraint function or the second constraint function, using position dynamics calculation to obtain the model parameters of the soft tissue in the current frame; The soft tissue is displayed according to the model parameters of the soft tissue in the current frame.
2. The soft tissue cutting simulation method according to claim 1, characterized in that: The model of the scalpel includes a plurality of particle points, and performing collision detection on the scalpel and the soft tissue and determining the collision point according to the collision detection result includes: Performing collision detection on the scalpel and the soft tissue, and when the blade direction of the scalpel faces the soft tissue and the surface angle between the blade of the scalpel and the soft tissue meets a threshold condition, traversing the plurality of particle points to see whether they are located inside the soft tissue; Determine a target particle point located inside the soft tissue according to the traversal result, wherein the target particle point is a particle point of the scalpel located inside the soft tissue; The collision point between the scalpel and the collision tetrahedron is determined according to the position of the target particle point in the previous frame and the current frame.
3. The soft tissue cutting simulation method according to claim 2, characterized in that: The collision detection between the scalpel and the soft tissue further includes: When performing collision detection on the scalpel and the soft tissue, detecting whether the direction of the blade of the scalpel is toward the soft tissue, and detecting whether the surface angle between the blade of the scalpel and the soft tissue meets a threshold condition; When the direction of the blade of the scalpel is not toward the soft tissue, adjusting the direction of the blade; or, When the angle between the blade of the scalpel and the surface of the soft tissue does not meet a threshold condition, the size of the angle is adjusted to meet the threshold condition.
4. The soft tissue cutting simulation method according to claim 2, characterized in that: Determining the collision point between the scalpel and the surface of the collision tetrahedron comprises the following steps: In response to the target particle point inside the soft tissue, determining whether the target particle point enters the soft tissue for the first time; If the target particle point enters the soft tissue for the first time, the collision plane and the collision point where the scalpel collides with the collision tetrahedron are determined according to the positions of the target particle point in the previous frame and the current frame, and the index of the collision tetrahedron where the target particle point is located in the current frame is recorded; If the target particle point does not enter the soft tissue for the first time, determining whether the position of the target particle point in the current frame is still in the collision tetrahedron of the previous frame according to the index of the collision tetrahedron where the target particle point is located in the previous frame; If the position of the target particle point in the current frame is still in the collision tetrahedron of the previous frame, the position of the target particle point in the current frame is recorded; otherwise, according to the spatial position relationship between the position of the target particle point in the current frame and the collision tetrahedron of the previous frame, the collision plane and collision point where the target particle point in the current frame passes through the collision tetrahedron of the previous frame are determined.
5. The soft tissue cutting simulation method according to claim 4, characterized in that: The step of determining the collision plane and the collision point of the collision tetrahedron where the target particle point in the current frame passes through the collision plane of the previous frame according to the spatial position relationship between the position of the target particle point in the current frame and the collision tetrahedron where the previous frame is located comprises: According to the directed volume relationship between the position of the target particle point in the current frame and the collision tetrahedron in the previous frame, determining the collision plane and the collision point where the target particle point in the current frame passes through the collision tetrahedron in the previous frame; or, According to the relationship between the position of the target particle point in the current frame and the centroid coordinates of the collision tetrahedron in the previous frame, the collision plane and the collision point of the collision tetrahedron in the previous frame where the target particle point in the current frame passes are determined.
6. The soft tissue cutting simulation method according to claim 4, characterized in that: The collision point includes a first collision point and a second collision point, the first collision point is a path point of the scalpel tip, the second collision point is a face intersection point and an edge intersection point of the scalpel blade with the collision tetrahedron, and the step of obtaining the collision point between the scalpel and the collision tetrahedron also includes performing a collision response based on the collision point, and the collision response process includes: When the collision point has only a second collision point, two temporary nodes are added to each of the second collision points, and the temporary nodes are respectively moved by a first threshold distance in the positive and negative directions of the normal perpendicular to the cutting plane to simulate a first collision response of the scalpel to the collision tetrahedron, wherein the first collision response is a deformation process in which the scalpel completely cuts the collision tetrahedron; When the collision points include a first collision point and a second collision point, two temporary nodes are added to each of the second collision points, and the two temporary nodes are respectively moved a second threshold distance along the positive and negative directions of the normal perpendicular to the cutting plane, and two cutting planes are respectively fitted according to the first collision point and the temporary nodes to simulate the second collision response of the scalpel to the collision tetrahedron, wherein the second collision response is the deformation process of the scalpel incompletely cutting the collision tetrahedron.
7. The soft tissue cutting simulation method according to claim 4, characterized in that: Determining the stage of the cutting process of the tetrahedron in the current frame according to the collision detection result includes the following steps: According to the index of the collision tetrahedron where the multiple target particle points are located, determining whether the multiple target particle points in the current frame are within the collision tetrahedron; If the plurality of target particle points in the current frame are not within the collision tetrahedron, the cutting process in the current frame is in the cutting completion stage; otherwise, the cutting process in the current frame is in the cutting stage.
8. The soft tissue cutting simulation method according to claim 1, characterized in that: In the cutting stage, performing surface fitting on the collision points on the collision tetrahedron to obtain a cutting plane includes: In the cutting stage, the cutting plane is obtained by performing surface fitting on the collision points on the collision tetrahedron using the dihedral angle constraint function of position dynamics.
9. A soft tissue cutting simulation device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the soft tissue cutting simulation method according to any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the soft tissue cutting simulation method according to any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Dynamic trajectory planning method for mobile robot under constraint of elastic band
CN120023834A
A dynamic trajectory planning method for mobile robots under elastic band constraints
CN120023834B