A method and system for collision detection between soft tissue and instruments in virtual surgery

By constructing a dual-level bounding box structure and ray tracing algorithm, combined with Sphere, OBB bounding box and triangular patch detection, the real-time and accuracy problems of soft tissue and instrument collision detection in virtual surgery are solved, achieving efficient collision detection results.

CN120411359BActive Publication Date: 2026-04-14NANJING TECH UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING TECH UNIV
Filing Date
2025-04-16
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing collision detection algorithms for soft tissues and instruments in virtual surgery struggle to meet the requirements of real-time performance and accuracy for complex models, especially in collision detection of deformable bodies, where there are issues with insufficient detection efficiency and accuracy.

Method used

A soft tissue mesh model and a proxy model for instruments are constructed. A dual-level bounding box structure and ray tracing algorithm are adopted. By dividing the dead zone with the shortest distance, the intersection detection of Sphere, OBB bounding boxes and triangular patches is used to perform coarse inspection, fine inspection and force feedback detection, thereby improving the detection efficiency and accuracy.

Benefits of technology

It improves the real-time performance and accuracy of collision detection between soft tissues and instruments in virtual surgery, meeting the practical needs of virtual surgery.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120411359B_ABST
    Figure CN120411359B_ABST
Patent Text Reader

Abstract

The application discloses a kind of collision detection method and system between soft tissue and instrument in virtual surgery, including constructing soft tissue grid model with triangular facet and tetrahedral particle and constructing the proxy model of instrument;Respectively construct the double level bounding box structure of soft tissue grid model and proxy model, and using ray tracing algorithm, obtain the binary hierarchical tree of soft tissue grid model;The shortest distance between the soft tissue grid model and the proxy model is obtained, and the collision detection of the soft tissue grid model and the proxy model is carried out based on the shortest distance and the set dead zone relationship.In the collision detection between soft tissue grid model and proxy model, the binary hierarchical tree of soft tissue grid model is obtained based on ray tracing algorithm, so the time for constructing the binary hierarchical tree of soft tissue grid model can be reduced, the system construction efficiency is improved, and different collision detection methods are used according to specific situation, the detection efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of virtual surgery technology, and in particular relates to a method and system for detecting collisions between soft tissues and instruments in virtual surgery. Background Technology

[0002] Virtual reality (VR) is an interdisciplinary science and technology that primarily achieves its goals by creating virtual environments that combine the virtual and real worlds. High-quality virtual environments need to possess immersion, interactivity, and imaginative elements. Collision detection is a key research area in virtual environments, impacting their realism and immersion. The accuracy and real-time performance of collision detection algorithms are crucial for improving the realism of virtual environments.

[0003] Collisions between deformable bodies can be categorized into two types: those between rigid bodies and deformable bodies, and those between deformable bodies themselves. Relatively mature algorithms exist for collision detection between rigid bodies, commonly including bounding box methods, spatial segmentation methods, and spatial distance methods. While these methods have limitations when applied to collision detection of soft tissues, they can be adapted for collision detection of deformable bodies through targeted improvements. Among these methods, bounding box detection methods have gained widespread application due to their simplicity and efficiency. Commonly used bounding box detection methods include bounding spheres, axis-aligned bounding boxes (AABB), and oriented bounding boxes (OBB). Smith et al. proposed a deformable body collision detection method based on AABB bounding boxes, but this method requires recalculating all bounding boxes after each collision detection, thus failing to meet real-time requirements when handling complex models. Wu et al. used a single bounding box and triangular facets for collision detection, employing a mass-spring model to realize soft tissue deformation; however, this method could not achieve real-time detection results when dealing with complex objects. ElBadrawy et al. implemented collision detection between clothing and skin using the inclusion field method, but this method has many limitations regarding the properties of deformable objects. In recent years, researchers have improved the bounding box method by optimizing algorithms, changing data organization, and improving hardware configurations to better meet the needs of deformable object collision detection. However, there is still much room for improvement in the accuracy and real-time performance of collision detection algorithms for virtual surgery. Summary of the Invention

[0004] To address the problems existing in the prior art, this invention proposes a collision detection method and system between soft tissue and instruments in virtual surgery.

[0005] The technical solution of the present invention is as follows:

[0006] A collision detection method between soft tissue and instruments in virtual surgery includes:

[0007] A soft tissue mesh model with triangular facets and tetrahedral particles is constructed, and a proxy model of the instrument is constructed.

[0008] A dual-level bounding box structure is constructed for the soft tissue mesh model and the proxy model respectively, and a ray tracing algorithm is used to obtain the binary hierarchical tree of the soft tissue mesh model. The dual-level bounding box structure includes an inner OBB bounding box and an outer Sphere bounding box.

[0009] The shortest distance between the soft tissue mesh model and the surrogate model is obtained. If the shortest distance exceeds the maximum threshold of a set dead zone, a coarse check is performed based on the binary hierarchical tree, using intersection detection between Spheres in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model. If the shortest distance is within the set dead zone, a first fine check is performed based on the binary hierarchical tree, using intersection detection between OBB bounding boxes in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model. If the shortest distance is less than or equal to the minimum threshold of the set dead zone, a second fine check is performed based on the precise detection of triangular facets in the soft tissue mesh model, and force feedback detection is performed based on tetrahedral particles in the soft tissue mesh model.

[0010] Furthermore, the specific method for constructing a soft tissue mesh model with triangular facets and tetrahedral particles includes:

[0011] Obtain a geometric model of soft tissue composed of triangular facets;

[0012] Obtain the first type of control points and the second type of control points corresponding to the triangular facets in the geometric model;

[0013] Connect the first and second type control points to the edges of the triangular facets in the geometric model to form a geometric model with a refined mesh;

[0014] The geometric model with the refined mesh is coupled with the tetrahedral particle model of soft tissue to obtain a soft tissue mesh model with triangular facets and tetrahedral particles.

[0015] Furthermore, the method for constructing the dual-level bounding box structure of the soft tissue mesh model includes:

[0016] Obtain the convex hull with vertices of the soft tissue mesh model;

[0017] Based on the vertices of the convex hull, the principal direction of the soft tissue mesh model is obtained in PCA space using principal component analysis, and is used as the principal axis of the OBB bounding box;

[0018] Project the vertices of the convex hull onto the principal axis, calculate the distance from the projected vertex to the origin of the principal axis, obtain the maximum and minimum values ​​of the distance, and use the maximum and minimum values ​​of the distance as the boundary of the OBB bounding box;

[0019] The vertices of the OBB bounding box are reconstructed by the principal axis and the boundary of the bounding box, and the vertices of the OBB bounding box are transformed from PCA space to the original space, thus completing the construction of the OBB bounding box.

[0020] The farthest distance between the calculated geometric model and the origin of the principal axis is used as the radius of the Sphere bounding box, thereby constructing the Sphere bounding box.

[0021] Furthermore, the specific method for obtaining the binary hierarchical tree of the soft tissue mesh model using the ray tracing algorithm includes:

[0022] Construct a binary hierarchical tree with multiple empty nodes to generate multiple beams of light;

[0023] The order of node access in a binary hierarchical tree is determined by calculating ray traces. The ray traces include ray direction and ray intersection, and are represented by a set of 32-bit integers and stored in an array or list.

[0024] The root node of the binary hierarchical tree is the double-level bounding box of the soft tissue mesh model. Each node in the binary hierarchical tree represents the intersection point of a ray and the soft tissue mesh model. The left and right child nodes represent the two new directions into which the ray splits at this intersection point, respectively. The process of dividing the double-level bounding box from the parent node to the child node is performed, that is, dividing the double-level bounding box of the parent node along the dividing axis selected based on the convex point distribution into smaller double-level bounding boxes of the corresponding child nodes. After the division is completed, each node represents a double-level bounding box. If it is not a leaf node, the binary hierarchical tree is recursively constructed for its left and right child nodes. The construction of the binary hierarchical tree stops when all rays have been visited or the preset maximum depth is reached.

[0025] Furthermore, for the case where the shortest distance exceeds the maximum threshold of the set dead zone, the specific method for coarse detection based on the binary hierarchical tree, using intersection detection between Sphere bounding boxes in a dual-level bounding box structure of a soft tissue mesh model and a surrogate model, includes:

[0026] For each node in the binary level tree, a coarse check is performed sequentially. This involves traversing all nodes and performing intersection checks between the sphere bounding boxes of each node's double-level bounding boxes. Specifically:

[0027] Obtain the distance S0T0 between the centers of the sphere bounding boxes in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model, and denote the radii R of the sphere bounding boxes in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model as follows: s and R t If S0T0 > R s +R t If the soft tissue mesh model and the surrogate model do not intersect, no collision has occurred; otherwise, if the soft tissue mesh model and the surrogate model do not intersect, a first fine check is required to determine whether a collision has occurred.

[0028] Furthermore, for the case where the shortest distance is within a set dead zone, the specific method for performing the first fine check based on the binary hierarchical tree and using the intersection detection between OBB bounding boxes in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model includes: performing the first fine check sequentially for each node in the binary hierarchical tree, traversing all nodes, and performing intersection detection between OBB bounding boxes in the dual-level bounding boxes of each node, specifically:

[0029] Obtain the distance S1T1 between the center points of the OBB bounding boxes in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model, and denote the minimum radii w in the OBB bounding boxes of the dual-level bounding box structure of the soft tissue mesh model and the surrogate model. s and w t , These represent the principal axis, the first axis perpendicular to the principal axis, and the radius of the second axis perpendicular to the principal axis in the double-layered bounding box structure of the soft tissue mesh model; r t 0 ,r t 1 ,r t 2 These represent the main axis, the first axis perpendicular to the main axis, and the radius of the second axis perpendicular to the main axis in the double-layer bounding box structure of the proxy model.

[0030] If S1T1 < w s +w t If the soft tissue mesh model and the surrogate model do not intersect, no collision has occurred; otherwise, if the soft tissue mesh model and the surrogate model do not intersect, a second fine check is required to determine whether a collision has occurred.

[0031] Furthermore, for the case where the shortest distance is less than or equal to the minimum threshold of the set dead zone, the specific method for performing the second fine inspection based on the accurate detection of triangular facets in the soft tissue mesh model includes:

[0032] For triangle facets A and B in the soft tissue model and surrogate model, the following method is used for collision detection of triangle facets A and B:

[0033] Step 1) Determine plane π2 from the vertices of triangle B in the proxy model, and determine whether plane π2 intersects triangle A. Calculate the determinant [A1, A2, A3, B...] i In the determinant, A1, A2, and A3 are the three vertices of triangular face A, and B... i Let A be one of the vertices of triangular facet B. If all three calculated results have the same sign and are not equal to 0, it can be determined that plane π2 and triangular facet A do not intersect. If any determinant has a value of zero or their signs are different, further judgment is required. If all three results are equal to 0, then the two triangular facets are in the same plane, and it is necessary to determine whether the line segments coplanar with them intersect. If only one of the three results is 0 and the other two results have the same sign, then only one vertex of triangular facet A is in plane π2; otherwise, the vertices of triangular facet A are located on opposite sides of plane π2.

[0034] Step 2) Determine plane π1 from the vertices of triangular facet A of the soft tissue model, and use the method in Step 1) to determine whether plane π1 intersects with triangular facet B;

[0035] Step 3) If the results on both sides satisfy that the vertices of triangular facet A are located on both sides of plane π2 and the vertices of triangular facet B are located on both sides of plane π1, then two closed intervals I1 = [m,j] and I2 = [k,l] are formed through the intersection points m and j of the line L between plane π1 and plane π2 and the two sides of triangular facet A, and the intersection points k and l of the line L between plane π1 and plane π2 and the two sides of triangular facet B. If these two closed intervals overlap, then the triangular facets in the two spaces intersect, and the soft tissue collides with the instrument; otherwise, it means that the triangular facets in the two spaces do not intersect, and the soft tissue does not collide with the instrument.

[0036] A collision detection system between soft tissue and instruments in virtual surgery includes a model building module, a dual-level bounding box structure building module, and a collision detection module;

[0037] The model building module is used to build a soft tissue mesh model with triangular facets and tetrahedral particles and to build a proxy model of the instrument.

[0038] The dual-level bounding box structure construction module is used to construct the dual-level bounding box structure of the soft tissue mesh model and the proxy model respectively, and to use a ray tracing algorithm to obtain the binary hierarchical tree of the soft tissue mesh model. The dual-level bounding box structure includes an inner OBB bounding box and an outer Sphere bounding box.

[0039] The collision detection module is used to obtain the shortest distance between the soft tissue mesh model and the proxy model. If the shortest distance exceeds the maximum threshold of a set dead zone, a coarse check is performed based on the binary hierarchical tree, using intersection detection between Spheres in the dual-level bounding box structure of the soft tissue mesh model and the proxy model. If the shortest distance is within the set dead zone, a first fine check is performed based on the binary hierarchical tree, using intersection detection between OBB bounding boxes in the dual-level bounding box structure of the soft tissue mesh model and the proxy model. If the shortest distance is less than or equal to the minimum threshold of the set dead zone, a second fine check is performed based on accurate detection of triangular facets in the soft tissue mesh model, and force feedback detection is performed based on tetrahedral particles in the soft tissue mesh model.

[0040] An electronic device includes a memory and a processor, the memory storing a computer program, the processor being configured to invoke and run the computer program stored in the memory to perform the method as described in any of the preceding methods.

[0041] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the method described in any of the preceding claims.

[0042] Compared with the prior art, the present invention has the following beneficial effects:

[0043] This invention proposes a collision detection method and system between soft tissue and instruments in virtual surgery. The method includes constructing a soft tissue mesh model with triangular facets and tetrahedral particles, and constructing a proxy model for the instruments; constructing a dual-level bounding box structure for both the soft tissue mesh model and the proxy model, and using a ray tracing algorithm to obtain a binary hierarchical tree of the soft tissue mesh model; obtaining the shortest distance between the soft tissue mesh model and the proxy model, and performing collision detection on the soft tissue mesh model and the proxy model based on the relationship between the shortest distance and a set dead zone, considering different scenarios. In collision detection between the soft tissue mesh model and the proxy model, the binary hierarchical tree of the soft tissue mesh model obtained based on the ray tracing algorithm is used, thus reducing the time required to construct the binary hierarchical tree of the soft tissue mesh model and improving system construction efficiency. Furthermore, different collision detection methods are used according to specific scenarios, improving detection efficiency and accuracy.

[0044] The collision detection method of this invention utilizes ray tracing to determine the access order of the complete binary tree and uses a fast convex hull algorithm to obtain the convex hull of the soft tissue mesh model in the construction of the double-level bounding box structure and the binary hierarchical tree of the soft tissue mesh model. This avoids redundant vertices inside the model from participating in the calculation, reduces the construction time of the double-level bounding box, and meets the real-time requirements of collision detection algorithms for virtual surgery.

[0045] The collision detection method of this invention adopts a pipeline-based collision detection method. Based on the comparison between the shortest distance between the soft tissue mesh model and the surrogate model and the set dead zone, three collision detection scenarios are defined. For the case where the shortest distance exceeds the maximum threshold of the set dead zone, coarse detection is performed using intersection detection between Spheres in a double-layer bounding box structure. For the case where the shortest distance is within the set dead zone, a first fine detection is performed using intersection detection between OBB bounding boxes in a double-layer bounding box structure. For the case where the shortest distance is less than or equal to the minimum threshold of the set dead zone, a second fine detection is performed based on the precise detection of triangular facets in the soft tissue mesh model, and force feedback detection is performed based on tetrahedral particles in the soft tissue mesh model. Therefore, the detection efficiency and accuracy are improved, which has practical significance and good application prospects. Attached Figure Description

[0046] Figure 1 This is a flowchart illustrating the collision detection method between soft tissue and instruments in a virtual surgery embodiment.

[0047] Figure 2 This is a Loop subdivision map of any grid in the embodiment;

[0048] Figure 3 This is a flowchart illustrating the construction process of a dual-level bounding box based on ray tracing in the embodiment.

[0049] Figure 4 This is a flowchart of the collision detection process based on the pipeline structure in the embodiment. Detailed Implementation

[0050] The present invention will be further illustrated below with reference to the accompanying drawings and specific embodiments. It should be understood that these embodiments are for illustrative purposes only and are not intended to limit the scope of the invention. After reading this invention, any modifications of the invention in various equivalent forms by those skilled in the art will fall within the scope defined by the appended claims.

[0051] Example 1:

[0052] This invention discloses a collision detection method between soft tissue and instruments in virtual surgery, wherein the soft tissue has deformable properties and the instruments have rigid properties, such as... Figure 1 and Figure 4 As shown, the specific steps include the following:

[0053] Construct a soft tissue mesh model with triangular facets and tetrahedral particles, and construct a proxy model for the instrument;

[0054] A dual-level bounding box structure is constructed for the soft tissue mesh model and the surrogate model respectively. A ray tracing algorithm is used to obtain the binary hierarchical tree of the soft tissue mesh model. The dual-level bounding box structure includes an inner OBB bounding box and an outer Sphere bounding box.

[0055] The shortest distance between the soft tissue mesh model and the surrogate model is obtained. For cases where the shortest distance exceeds the maximum threshold of the set dead zone, a coarse check is performed based on a binary hierarchical tree, using intersection detection between Spheres in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model. For cases where the shortest distance is within the set dead zone, a first fine check is performed based on a binary hierarchical tree, using intersection detection between OBB bounding boxes in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model. For cases where the shortest distance is less than or equal to the minimum threshold of the set dead zone, a second fine check is performed based on the accurate detection of triangular facets in the soft tissue mesh model, and force feedback detection is performed based on tetrahedral mass points in the soft tissue mesh model.

[0056] Example 2:

[0057] This embodiment, based on Embodiment 1, further designs a specific method for constructing a soft tissue mesh model with triangular facets and tetrahedral particles, as follows: Figure 2 As shown, it includes:

[0058] Obtain a geometric model of soft tissue composed of triangular facets;

[0059] Obtain the first and second type control points corresponding to the triangular facets in the geometric model;

[0060] Connect the first and second type control points to the edges of the triangular facets in the geometric model to form a geometric model with a refined mesh;

[0061] By coupling a geometric model with a refined mesh with a tetrahedral particle model of soft tissue, a soft tissue mesh model with triangular facets and tetrahedral particles is obtained.

[0062] Specifically, the above-mentioned soft tissue mesh model can be constructed using the following method:

[0063] Obtain the geometric model of the soft tissue composed of triangular facets. Obtain the first and second type control points corresponding to each triangular facet in the geometric model. For a given triangular facet, there are three corresponding first type control points, distributed along the three sides of the facet. The calculation method for the coordinates of any one of these three first type control points is as follows:

[0064]

[0065] In the formula, P represents the coordinates of the first type of control point; A, B, C, and D are the coordinates of the four vertices of the triangle adjacent to the first type of control point, respectively.

[0066] For a given triangular facet, it has three corresponding second-type control points, which are its three vertices. If the triangular facet is a regular triangular facet, that is, the vertices of the triangular facet are all composed of control points with a valence of 4 or 6, and the valence is the edge connecting the first-type control points and the second-type control points, then the calculation method for the coordinates of any one of the three newly generated second-type control points is as follows:

[0067]

[0068] In the formula, E is the second type of control point; V is the vertex of the original triangle; Q is the mean of the sum of the coordinate axes of the vertices that share a common edge with vertex V; Q1, Q2, Q3, Q4, Q5, and Q6 are the vertices that share a common edge with vertex V, respectively.

[0069] If the triangular facet is irregular, meaning that not all vertices of the facet are composed of control points with a value of 4 or 6, then the coordinates of any one of these three second-type control points are calculated as follows:

[0070]

[0071]

[0072] In the formula, Q n For intermediate parameters relating to n vertices that share an edge with vertex V; V i It is the i-th original control vertex that is connected to V by an edge;

[0073] When n=3 When n > 3

[0074] Obtain the first type of control points for each edge of the triangular mesh model, and calculate the corresponding second type of control points for each vertex. Use the calculated first and second type control points as new vertices, connect the new vertices to the edge points in the new mesh that contain the corresponding vertices of the original mesh, and connect the three edges of the triangular cells in the original mesh to the edge points in the new mesh. Repeat the above steps of calculating control points and connecting them until the required subdivision level is reached, and a new mesh model with a refined mesh geometric model is obtained.

[0075] Example 3:

[0076] This embodiment is further designed based on embodiment two, as follows: Figure 3 As shown, the method for constructing the dual-level bounding box structure of the soft tissue mesh model in this example includes:

[0077] Obtain the convex hull with vertices of the soft tissue mesh model;

[0078] Based on the vertices of the convex hull, the principal component analysis method is used in the PCA space to obtain the principal direction of the soft tissue mesh model, which is then used as the principal axis of the OBB bounding box. Specifically, the covariance matrix of the vertices of the convex hull can be obtained, and the principal axis of the OBB bounding box can be determined by the direction with the maximum variance.

[0079] Project the vertices of the convex hull onto the principal axis, calculate the distance from the projected vertex to the origin of the principal axis (the origin of the principal axis can be the center point of the geometric model), obtain the maximum and minimum values ​​of the distance, and use the maximum and minimum values ​​of the distance as the boundary of the OBB bounding box.

[0080] The vertices of the OBB bounding box are reconstructed by the principal axis and the boundary of the bounding box, and the vertices of the OBB bounding box are transformed from PCA space to the original space, thus completing the construction of the OBB bounding box.

[0081] The farthest distance between the calculated geometric model and the origin of the principal axis is used as the radius of the Sphere bounding box, thereby constructing the Sphere bounding box.

[0082] Example 4:

[0083] This embodiment is further designed based on embodiment three, as follows: Figure 3 As shown, the specific method for obtaining the binary hierarchical tree of the soft tissue mesh model using the ray tracing algorithm in this example includes:

[0084] Construct a binary hierarchical tree with multiple empty nodes to generate multiple beams of light;

[0085] The order of node access in a binary hierarchical tree is determined by calculating ray traces. Ray traces include ray direction and ray intersection, and are represented by a set of 32-bit integers and stored in an array or list.

[0086] The root node of the binary hierarchical tree is the double-level bounding box of the soft tissue mesh model. Each node in the binary hierarchical tree represents the intersection point of a ray and the soft tissue mesh model. The left and right child nodes represent the two new directions into which the ray splits at this intersection point, respectively. The process of dividing the double-level bounding box from the parent node to the child node is performed, that is, dividing the double-level bounding box of the parent node along the dividing axis selected based on the convex point distribution into smaller double-level bounding boxes of the corresponding child nodes. After the division is completed, each node represents a double-level bounding box. If it is not a leaf node, that is, there are still unvisited rays, the binary hierarchical tree is recursively built for its left and right child nodes. When all rays have been visited or the preset maximum depth is reached, the construction of the binary hierarchical tree stops.

[0087] Example 5:

[0088] This embodiment, based on Embodiment 4, further designs the following: For cases where the shortest distance exceeds the maximum threshold of the set dead zone, a coarse detection method is used based on a binary hierarchical tree, employing intersection detection between Sphere bounding boxes in a dual-level bounding box structure of a soft-tissue mesh model and a surrogate model. The specific method includes:

[0089] For each node in the binary level tree, a coarse check is performed sequentially. This involves traversing all nodes and performing intersection checks between the sphere bounding boxes of each node's double-level bounding boxes. Specifically:

[0090] Obtain the distance S0T0 between the centers of the sphere bounding boxes in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model. Let R be the radii of the sphere bounding boxes in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model. s and R t If S0T0 > R s +R t If the soft tissue mesh model and the surrogate model do not intersect, no collision has occurred; otherwise, if the soft tissue mesh model and the surrogate model do not intersect, a first fine check is required to determine whether a collision has occurred.

[0091] Example 6:

[0092] This embodiment, based on Embodiment 5, further designs the following: For the case where the shortest distance is within a set dead zone, the specific method for performing the first fine check based on a binary hierarchical tree and using intersection detection between OBB bounding boxes in a dual-level bounding box structure of a soft-tissue mesh model and a surrogate model includes: performing the first fine check sequentially on each node in the binary hierarchical tree, traversing all nodes, and performing intersection detection between OBB bounding boxes in the dual-level bounding boxes of each node; specifically:

[0093] Obtain the distance S1T1 between the center points of the OBB bounding boxes in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model. Let w be the minimum radius of the OBB bounding boxes in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model. s and w t , These represent the principal axis, the first axis perpendicular to the principal axis, and the radius of the second axis perpendicular to the principal axis in the double-layered bounding box structure of the soft tissue mesh model; r t 0 ,r t 1 ,r t 2 These represent the main axis, the first axis perpendicular to the main axis, and the radius of the second axis perpendicular to the main axis in the double-layer bounding box structure of the proxy model.

[0094] If S1T1 < w s +w t If the soft tissue mesh model and the surrogate model do not intersect, no collision has occurred; otherwise, if the soft tissue mesh model and the surrogate model do not intersect, a second fine check is required to determine whether a collision has occurred.

[0095] Example 7:

[0096] This embodiment, based on Embodiment Six, further designs the following: For cases where the shortest distance is less than or equal to the minimum threshold of the set dead zone, the specific method for performing a second fine inspection based on the accurate detection of triangular facets in the soft tissue mesh model includes:

[0097] For triangle facets A and B in the soft tissue model and surrogate model, the following method is used for collision detection of triangle facets A and B:

[0098] Step 1) Determine plane π2 from the vertices of triangle B in the proxy model, and determine whether plane π2 intersects triangle A. Calculate the determinant [A1, A2, A3, B...] i In the determinant, A1, A2, and A3 are the three vertices of triangular face A, and B... iLet A be one of the vertices of triangular facet B. If all three calculated results have the same sign and are not equal to 0, it can be determined that plane π2 and triangular facet A do not intersect. If any determinant has a value of zero or their signs are different, further judgment is required. If all three results are equal to 0, then the two triangular facets are in the same plane, and it is necessary to determine whether the line segments coplanar with them intersect. If only one of the three results is 0 and the other two results have the same sign, then only one vertex of triangular facet A is in plane π2; otherwise, the vertices of triangular facet A are located on opposite sides of plane π2.

[0099] Step 2) Determine plane π1 from the vertices of triangular facet A of the soft tissue model, and use the method in Step 1) to determine whether plane π1 intersects with triangular facet B;

[0100] Step 3) If the results on both sides satisfy that the vertices of triangle A are located on opposite sides of plane π2 and the vertices of triangle B are located on opposite sides of plane π1, then it means that one of the triangles may have a vertex that passes through the interior of the other triangle, and the other two vertices are on the other side of the triangle that was passed through. Further judgment is needed:

[0101] Two closed intervals, I1 = [m,j] and I2 = [k,l], are formed by the intersection points m and j of the line L between planes π1 and π2 and the two sides of triangular facet A, and the intersection points k and l of the line L between planes π1 and π2 and the two sides of triangular facet B. If these two closed intervals overlap, the triangular facets in the two spaces intersect, and the soft tissue collides with the instrument; otherwise, it means that the triangular facets in the two spaces do not intersect, and the soft tissue does not collide with the instrument.

[0102] Example 8:

[0103] The present invention provides a collision detection system between soft tissue and instruments in virtual surgery, wherein the soft tissue has deformable characteristics and the instruments have rigid body characteristics, including a model building module, a dual-level bounding box structure building module and a collision detection module.

[0104] The model building module is used to construct soft tissue mesh models with triangular facets and tetrahedral particles and to build proxy models for instruments.

[0105] The dual-level bounding box structure construction module is used to construct the dual-level bounding box structure of the soft tissue mesh model and the surrogate model respectively, and to use the ray tracing algorithm to obtain the binary hierarchical tree of the soft tissue mesh model. The dual-level bounding box structure includes an inner OBB bounding box and an outer Sphere bounding box.

[0106] The collision detection module is used to obtain the shortest distance between the soft tissue mesh model and the surrogate model. For cases where the shortest distance exceeds the maximum threshold of the set dead zone, a coarse check is performed based on a binary hierarchical tree, using intersection detection between Spheres in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model. For cases where the shortest distance is within the set dead zone, a first fine check is performed based on a binary hierarchical tree, using intersection detection between OBB bounding boxes in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model. For cases where the shortest distance is less than or equal to the minimum threshold of the set dead zone, a second fine check is performed based on the accurate detection of triangular facets in the soft tissue mesh model, and force feedback detection is performed based on tetrahedral particles in the soft tissue mesh model.

[0107] Example 9:

[0108] An electronic device includes a memory and a processor. The memory stores a computer program, and the processor is used to invoke and run the computer program stored in the memory to perform the methods of any of the above embodiments.

[0109] A computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of any of the above embodiments.

[0110] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for detecting collisions between soft tissue and instruments in virtual surgery, characterized in that, include: A soft tissue mesh model with triangular facets and tetrahedral particles is constructed, and a proxy model of the instrument is constructed. A dual-level bounding box structure is constructed for the soft tissue mesh model and the proxy model respectively, and a ray tracing algorithm is used to obtain the binary hierarchical tree of the soft tissue mesh model. The dual-level bounding box structure includes an inner OBB bounding box and an outer Sphere bounding box. The shortest distance between the soft tissue mesh model and the surrogate model is obtained. If the shortest distance exceeds the maximum threshold of a set dead zone, a coarse check is performed based on the binary hierarchical tree, using intersection detection between Spheres in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model. If the shortest distance is within the set dead zone, a first fine check is performed based on the binary hierarchical tree, using intersection detection between OBB bounding boxes in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model. If the shortest distance is less than or equal to the minimum threshold of the set dead zone, a second fine check is performed based on the precise detection of triangular facets in the soft tissue mesh model, and force feedback detection is performed based on tetrahedral particles in the soft tissue mesh model.

2. The collision detection method between soft tissue and instruments in virtual surgery according to claim 1, characterized in that, The specific method for constructing a soft tissue mesh model with triangular facets and tetrahedral mass points includes: Obtain a geometric model of soft tissue composed of triangular facets; Obtain the first type of control points and the second type of control points corresponding to the triangular facets in the geometric model; Connect the first and second type control points to the edges of the triangular facets in the geometric model to form a geometric model with a refined mesh; The geometric model with the refined mesh is coupled with the tetrahedral particle model of soft tissue to obtain a soft tissue mesh model with triangular facets and tetrahedral particles.

3. The collision detection method between soft tissue and instruments in virtual surgery according to claim 2, characterized in that, The method for constructing the dual-level bounding box structure of the soft tissue mesh model includes: Obtain the convex hull with vertices of the soft tissue mesh model; Based on the vertices of the convex hull, the principal direction of the soft tissue mesh model is obtained in PCA space using principal component analysis, and is used as the principal axis of the OBB bounding box; Project the vertices of the convex hull onto the principal axis, calculate the distance from the projected vertex to the origin of the principal axis, obtain the maximum and minimum values ​​of the distance, and use the maximum and minimum values ​​of the distance as the boundary of the OBB bounding box; The vertices of the OBB bounding box are reconstructed by the principal axis and the boundary of the bounding box, and the vertices of the OBB bounding box are transformed from PCA space to the original space, thus completing the construction of the OBB bounding box. The farthest distance between the calculated geometric model and the origin of the principal axis is used as the radius of the Sphere bounding box, thereby constructing the Sphere bounding box.

4. The collision detection method between soft tissue and instruments in virtual surgery according to claim 3, characterized in that, The specific method for obtaining the binary hierarchical tree of the soft tissue mesh model using the ray tracing algorithm includes: Construct a binary hierarchical tree with multiple empty nodes to generate multiple beams of light; The order of node access in a binary hierarchical tree is determined by calculating ray traces. The ray traces include ray direction and ray intersection, and are represented by a set of 32-bit integers and stored in an array or list. The root node of the binary hierarchical tree is the double-level bounding box of the soft tissue mesh model. Each node in the binary hierarchical tree represents the intersection point of a ray and the soft tissue mesh model. The left and right child nodes represent the two new directions into which the ray splits at this intersection point, respectively. The process of dividing the double-level bounding box from the parent node to the child node is performed, that is, dividing the double-level bounding box of the parent node along the dividing axis selected based on the convex point distribution into smaller double-level bounding boxes of the corresponding child nodes. After the division is completed, each node represents a double-level bounding box. If it is not a leaf node, the binary hierarchical tree is recursively constructed for its left and right child nodes. The construction of the binary hierarchical tree stops when all rays have been visited or the preset maximum depth is reached.

5. The collision detection method between soft tissue and instruments in virtual surgery according to claim 4, characterized in that, For the case where the shortest distance exceeds the maximum threshold of the set dead zone, the specific method for coarse detection based on the binary hierarchical tree and using intersection detection between Sphere bounding boxes in a dual-level bounding box structure of a soft tissue mesh model and a surrogate model includes: For each node in the binary level tree, a coarse check is performed sequentially. This involves traversing all nodes and performing intersection checks between the sphere bounding boxes of each node's double-level bounding boxes. Specifically: Obtain the distance S0T0 between the centers of the sphere bounding boxes in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model, and denote the radii R of the sphere bounding boxes in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model as follows: s and R t If S0T0 > R s +R t If the soft tissue mesh model and the surrogate model do not intersect, no collision has occurred; otherwise, if the soft tissue mesh model and the surrogate model do not intersect, a first fine check is required to determine whether a collision has occurred.

6. The collision detection method between soft tissue and instruments in virtual surgery according to claim 5, characterized in that, For the case where the shortest distance is within the set dead zone, the specific method for performing the first fine check based on the binary hierarchical tree and using the intersection detection between OBB bounding boxes in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model includes: performing the first fine check sequentially for each node in the binary hierarchical tree, traversing all nodes, and performing intersection detection between OBB bounding boxes in the dual-level bounding boxes of each node, specifically: Obtain the distance S1T1 between the center points of the OBB bounding boxes in the dual-level bounding box structure of the soft tissue mesh model and the surrogate model, and denote the minimum radii w in the OBB bounding boxes of the dual-level bounding box structure of the soft tissue mesh model and the surrogate model. s and w t , These represent the main axis, the first axis perpendicular to the main axis, and the radius of the second axis perpendicular to the main axis in the double-layer bounding box structure of the soft tissue mesh model, respectively. These represent the main axis, the first axis perpendicular to the main axis, and the radius of the second axis perpendicular to the main axis in the double-layer bounding box structure of the proxy model. If S1T1 < w s +w t If the soft tissue mesh model and the surrogate model do not intersect, no collision has occurred; otherwise, if the soft tissue mesh model and the surrogate model do not intersect, a second fine check is required to determine whether a collision has occurred.

7. The collision detection method between soft tissue and instruments in virtual surgery according to claim 6, characterized in that, For the case where the shortest distance is less than or equal to the minimum threshold of the set dead zone, the specific method for performing the second fine inspection based on the accurate detection of triangular facets in the soft tissue mesh model includes: For triangle facets A and B in the soft tissue model and surrogate model, the following method is used for collision detection of triangle facets A and B: Step 1) Determine plane π2 from the vertices of triangle B in the proxy model, and determine whether plane π2 intersects triangle A. Calculate the determinant [A1, A2, A3, B...] i In the determinant, A1, A2, and A3 are the three vertices of triangular face A, and B... i Let A be one of the vertices of triangular facet B. If all three calculated results have the same sign and are not equal to 0, it can be determined that plane π2 and triangular facet A do not intersect. If any determinant has a value of zero or their signs are different, further judgment is required. If all three results are equal to 0, then the two triangular facets are in the same plane, and it is necessary to determine whether the line segments coplanar with them intersect. If only one of the three results is 0 and the other two results have the same sign, then only one vertex of triangular facet A is in plane π2; otherwise, the vertices of triangular facet A are located on opposite sides of plane π2. Step 2) Determine plane π1 from the vertices of triangular facet A of the soft tissue model, and use the method in Step 1) to determine whether plane π1 intersects with triangular facet B; Step 3) If the results on both sides satisfy that the vertices of triangular facet A are located on both sides of plane π2 and the vertices of triangular facet B are located on both sides of plane π1, then two closed intervals I1 = [m,j] and I2 = [k,l] are formed through the intersection points m and j of the line L between plane π1 and plane π2 and the two sides of triangular facet A, and the intersection points k and l of the line L between plane π1 and plane π2 and the two sides of triangular facet B. If these two closed intervals overlap, then the triangular facets in the two spaces intersect, and the soft tissue collides with the instrument; otherwise, it means that the triangular facets in the two spaces do not intersect, and the soft tissue does not collide with the instrument.

8. A collision detection system between soft tissue and instruments in virtual surgery, characterized in that, It includes a model building module, a dual-level bounding box structure building module, and a collision detection module; The model building module is used to build a soft tissue mesh model with triangular facets and tetrahedral particles and to build a proxy model of the instrument. The dual-level bounding box structure construction module is used to construct the dual-level bounding box structure of the soft tissue mesh model and the proxy model respectively, and to use a ray tracing algorithm to obtain the binary hierarchical tree of the soft tissue mesh model. The dual-level bounding box structure includes an inner OBB bounding box and an outer Sphere bounding box. The collision detection module is used to obtain the shortest distance between the soft tissue mesh model and the proxy model. If the shortest distance exceeds the maximum threshold of a set dead zone, a coarse check is performed based on the binary hierarchical tree, using intersection detection between Spheres in the dual-level bounding box structure of the soft tissue mesh model and the proxy model. If the shortest distance is within the set dead zone, a first fine check is performed based on the binary hierarchical tree, using intersection detection between OBB bounding boxes in the dual-level bounding box structure of the soft tissue mesh model and the proxy model. If the shortest distance is less than or equal to the minimum threshold of the set dead zone, a second fine check is performed based on accurate detection of triangular facets in the soft tissue mesh model, and force feedback detection is performed based on tetrahedral particles in the soft tissue mesh model.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor being configured to invoke and run the computer program stored in the memory to perform the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method as described in any one of claims 1 to 7 above.

Citation Information

Patent Citations

  • Grid and bounding box-based collision detection method

    CN112669434A

  • Fast retrieval method based on space division and model voxelization

    WO2024138878A1