Three-dimensional geological model Boolean operation method, device, electronic device and storage medium

By combining the surface area with the container partitioning method and the half-edge mapping table, the problem of slow construction of binary space partition trees in Boolean operations of three-dimensional geological models is solved, and efficient processing of Boolean operations of complex geological models is achieved.

CN119091070BActive Publication Date: 2025-09-19CHINA UNIV OF GEOSCIENCES (WUHAN)
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411217320.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2025-09-19
Estimated Expiration
2044-09-02

AI Technical Summary

Technical Problem

Among the existing Boolean operation methods for three-dimensional geological models, the construction speed of binary space partition trees is slow, especially when processing complex geological models. This results in a large number of triangles and complex geometric shapes, which affects the operation efficiency.

Method used

The surface area combined with container partitioning method is adopted to obtain the hierarchical bounding boxes of the original and to-be-combined 3D geological models, determine the intersection relationship of triangles, and use the half-edge mapping table to process the internal and external relationship of non-intersecting triangles and perform Boolean operations.

Benefits of technology

The computational efficiency of Boolean operations in three-dimensional geological models has been improved, which can better handle complex geometric shapes and distributions, reduce unnecessary computational overhead, and improve computational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119091070B_ABST
    Figure CN119091070B_ABST
Patent Text Reader

Abstract

The present invention provides a three-dimensional geological model Boolean operation method, device, electronic device, and storage medium, relating to the technical field of three-dimensional geological models. The method comprises: obtaining multiple three-dimensional geological model hierarchical bounding boxes based on the original three-dimensional geological model, and obtaining multiple to-be-combined model hierarchical bounding boxes based on the to-be-combined model; when the three-dimensional geological model hierarchical bounding box intersects with the to-be-combined model hierarchical bounding box, if the triangle is an intersecting triangle, determining the internal and external relationship of the intersecting triangle by determining the internal and external relationship between the intersecting triangle and the to-be-combined model; when the triangle is a non-intersecting triangle, determining the internal and external relationship of the non-intersecting triangle using a preset half-edge mapping table; and performing a Boolean operation on the internal and external relationships of all intersecting triangles and / or non-intersecting triangles to obtain a Boolean operation result. The present invention improves the efficiency of Boolean operations on three-dimensional geological models.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of three-dimensional geological models, and in particular to a three-dimensional geological model Boolean operation method, device, electronic device and storage medium. Background Art

[0002] A 3D geological model is a model used to describe and simulate the internal structure and characteristics of a geologic structure. It is based on the comprehensive analysis and interpretation of geological, survey, and geophysical data. Boolean operations on 3D geological models utilize Boolean logic principles to generate a new 3D geological model by combining, clipping, and intersecting existing 3D geological models.

[0003] Currently, the main approach is to construct a binary space partition tree for each model undergoing Boolean operations. By traversing and manipulating the nodes of the binary space partition tree and calculating the Boolean relationships between the models, a new three-dimensional geological model is generated. The construction of a binary space partition tree is slow, and the overhead is particularly high when processing complex geological models. Due to the complex structure of the binary space partition tree, the partitioning planes must be carefully selected, resulting in low efficiency when performing Boolean operations on three-dimensional geological models. Due to the massive amount of geological data and the complexity of geological structures, the constructed three-dimensional geological models also exhibit a large number of triangles and complex geometric shapes, which can lead to poor performance when processing complex geometries and distributions. Summary of the Invention

[0004] The present invention aims to solve at least one of the above problems.

[0005] To solve the above problems, the present invention provides a three-dimensional geological model Boolean operation method, device, electronic device and storage medium.

[0006] In a first aspect, the present invention provides a three-dimensional geological model Boolean operation method, comprising:

[0007] Acquire an original three-dimensional geological model and a model to be combined, wherein both the original three-dimensional geological model and the model to be combined are three-dimensional geological models represented by triangular meshes;

[0008] Based on the surface area combined with the container division method, a plurality of three-dimensional geological model hierarchical bounding boxes are obtained according to the original three-dimensional geological model, and a plurality of to-be-combined model hierarchical bounding boxes are obtained according to the to-be-combined model;

[0009] When the three-dimensional geological model hierarchical bounding box intersects with the to-be-combined model hierarchical bounding box, determining whether each triangle corresponding to the three-dimensional geological model hierarchical bounding box is an intersecting triangle or a non-intersecting triangle;

[0010] When the triangle is the intersecting triangle, the internal and external relationship of the intersecting triangle is obtained by determining the internal and external relationship between the intersecting triangle and the model to be combined;

[0011] When the triangle is a non-intersecting triangle, the internal and external relationship of the non-intersecting triangle is obtained by using a preset half-edge mapping table;

[0012] A Boolean operation result is obtained by performing a Boolean operation on the original three-dimensional geological model and the model to be combined through the internal and external relationships of all the intersecting triangles and / or the internal and external relationships of the non-intersecting triangles.

[0013] Optionally, the original three-dimensional geological model includes vertex information of a plurality of triangles, and obtaining a plurality of three-dimensional geological model hierarchical bounding boxes according to the original three-dimensional geological model includes:

[0014] Obtaining a corresponding axis-aligned bounding box according to vertex information of each triangle;

[0015] Obtaining a plurality of partition positions and partition axes through the axis-aligned bounding box;

[0016] Splitting the axis-aligned bounding box according to the plurality of split positions and the split axes to obtain a target left subtree bounding box and a target right subtree bounding box;

[0017] A plurality of new division positions and new division axes are respectively obtained through the target left subtree bounding box and the target right subtree bounding box. The target left subtree bounding box and the target right subtree bounding box are divided multiple times based on the multiple new division positions and the new division axes until a maximum number of bounding boxes is reached, thereby generating a plurality of the three-dimensional geological model hierarchical bounding boxes of the original three-dimensional geological model.

[0018] Optionally, the step of dividing the axis-aligned bounding box according to the plurality of division positions and the division axes to obtain a target left subtree bounding box and a target right subtree bounding box includes:

[0019] Splitting the axis-aligned bounding box according to each of the split positions and the split axis to obtain a plurality of original left subtree bounding boxes and an original right subtree bounding box, wherein the original left subtree bounding box includes the number of left subtree triangles and the area of ​​the left subtree bounding box, and the original right subtree bounding box includes the number of right subtree triangles and the area of ​​the right subtree bounding box;

[0020] Obtaining a current cost according to the number of triangles in the left subtree, the area of ​​the left subtree bounding box, the number of triangles in the right subtree, the area of ​​the right subtree bounding box, and the area of ​​the axis-aligned bounding box;

[0021] The current cost is:

[0022]

[0023] Among them, Cost is the current cost, C T is the minimum cost, S P is the area of ​​the axis-aligned bounding box, N L is the number of triangles in the left subtree, N R is the number of triangles in the right subtree, S L is the area of ​​the left subtree bounding box, S R is the area of ​​the right subtree bounding box;

[0024] The target left subtree bounding box and the target right subtree bounding box are determined according to the current cost.

[0025] Optionally, determining the target left subtree bounding box and the target right subtree bounding box according to the current cost includes:

[0026] When the current cost is less than the minimum cost, the minimum cost is updated using the current cost, and the corresponding original left subtree bounding box and the original right subtree bounding box are used as the target left subtree bounding box and the target right subtree bounding box.

[0027] Optionally, obtaining the internal and external relationship of the intersecting triangles by determining the internal and external relationship between the intersecting triangles and the model to be combined includes:

[0028] Splitting the intersecting triangle to obtain a plurality of partial triangles, wherein the sum of the areas of all the partial triangles is the area of ​​the intersecting triangle;

[0029] Based on the dot product operation method, the internal and external relationships of the intersecting triangles are obtained according to the internal and external relationships of each of the partial triangles and the model to be combined.

[0030] Optionally, the splitting of the intersecting triangles to obtain a plurality of partial triangles includes:

[0031] Obtaining the positional relationship of the intersecting triangles in space, and obtaining a subdivision plane according to the positional relationship;

[0032] Obtaining intersecting line segments of the intersecting triangles according to the subdividing plane;

[0033] The intersecting triangle is split according to the intersecting line segments to obtain a plurality of partial triangles.

[0034] Optionally, the Boolean operation includes a Boolean union operation, a Boolean difference operation, and a Boolean intersection operation. The Boolean operation includes a Boolean union operation, a Boolean difference operation, and a Boolean intersection operation. The Boolean operation result is obtained by performing the Boolean operation on the original three-dimensional geological model and the model to be combined based on the internal and external relationships of all the intersecting triangles and / or the internal and external relationships of the non-intersecting triangles, including:

[0035] The Boolean operation result is obtained by performing the Boolean union operation, the Boolean difference operation, or the Boolean intersection operation on the original three-dimensional geological model and the model to be combined through the internal and external relationships of all the intersecting triangles and / or the internal and external relationships of the non-intersecting triangles.

[0036] In a second aspect, the present invention provides a three-dimensional geological model Boolean operation device, comprising: a model acquisition module, configured to acquire an original three-dimensional geological model and a model to be combined, wherein both the original three-dimensional geological model and the model to be combined are three-dimensional geological models represented by triangular meshes;

[0037] A hierarchical bounding box acquisition module is configured to obtain a plurality of hierarchical bounding boxes of three-dimensional geological models based on the original three-dimensional geological model and a plurality of hierarchical bounding boxes of models to be combined based on the models to be combined based on the surface area combined with the container partitioning method;

[0038] An intersection judgment module is used to judge whether each triangle corresponding to the hierarchical bounding box of the three-dimensional geological model is an intersecting triangle or a non-intersecting triangle when the hierarchical bounding box of the three-dimensional geological model intersects with the hierarchical bounding box of the model to be combined;

[0039] An intersecting triangle internal and external relationship acquisition module, configured to obtain the intersecting triangle internal and external relationship by determining the internal and external relationship between the intersecting triangle and the model to be combined when the triangle is the intersecting triangle;

[0040] a non-intersecting triangle internal and external relationship acquisition module, configured to obtain the non-intersecting triangle internal and external relationship through a preset half-edge mapping table when the triangle is a non-intersecting triangle;

[0041] The Boolean operation result acquisition module is used to perform Boolean operation on the original three-dimensional geological model and the model to be combined through the internal and external relationships of all the intersecting triangles and / or the internal and external relationships of the non-intersecting triangles to obtain a Boolean operation result.

[0042] In a third aspect, the present invention provides an electronic device comprising a memory and a processor;

[0043] The memory is used to store computer programs;

[0044] The processor is configured to implement the three-dimensional geological model Boolean operation method as described in the first aspect when executing the computer program.

[0045] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the three-dimensional geological model Boolean operation method as described in the first aspect is implemented.

[0046] The beneficial effects of the Boolean operation of the three-dimensional geological model of the present invention are:

[0047] The Boolean operation method for 3D geological models disclosed herein obtains an original 3D geological model and a model to be combined, and constructs hierarchical bounding boxes for each model based on surface area and a container partitioning method, thereby facilitating subsequent calculations. When the hierarchical bounding box of the 3D geological model intersects with the hierarchical bounding box of the model to be combined, the method determines whether each triangle corresponding to the hierarchical bounding box of the 3D geological model is an intersecting triangle or a non-intersecting triangle. When the bounding boxes intersect, the method further determines whether the triangles intersect, thereby improving computational efficiency. When the triangles are intersecting triangles, the internal-external relationship of the intersecting triangles is determined by determining the internal-external relationship between the intersecting triangles and the model to be combined, thereby better handling complex geometric shapes. When the triangles are non-intersecting triangles, the internal-external relationship of the non-intersecting triangles is determined using a preset half-edge mapping table, efficiently completing the determination of the internal-external relationship of non-intersecting triangles and reducing unnecessary computational overhead. A Boolean operation is performed on the original 3D geological model and the model to be combined, obtaining a Boolean operation result based on the internal-external relationships of all intersecting triangles and / or the non-intersecting triangles, thereby improving computational efficiency and effectively handling complex geometric shapes and distributions. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A schematic flow chart of a Boolean operation method for a three-dimensional geological model according to an embodiment of the present invention;

[0049] Figure 2 is a schematic diagram of a triangle outside an intersection model according to an embodiment of the present invention;

[0050] Figure 3 A schematic diagram of a triangle in an intersection model according to an embodiment of the present invention;

[0051] Figure 4 A schematic diagram of a half-edge structure according to an embodiment of the present invention;

[0052] Figure 5 Schematic diagram of a triangle neighborhood diffusion search process according to an embodiment of the present invention;

[0053] Figure 6This is a schematic structural diagram of a Boolean operation device for a three-dimensional geological model according to an embodiment of the present invention;

[0054] Figure 7 The figure is a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0055] To make the above-mentioned objects, features, and advantages of the present invention more clearly understood, specific embodiments of the present invention are described in detail below with reference to the accompanying drawings. Although certain embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as being limited to the embodiments described herein. Instead, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.

[0056] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.

[0057] The term "including" and its variations used in this document are open inclusions, that is, "including but not limited to"; the term "based on" means "based at least in part on"; the term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one other embodiment"; the term "some embodiments" means "at least some embodiments"; the term "optionally" means "optional embodiments". The relevant definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc. mentioned in the present invention are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0058] It should be noted that the modifications of "one" and "multiple" mentioned in the present invention are illustrative rather than restrictive. Those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0059] The names of the messages or information exchanged between multiple devices in the embodiments of the present invention are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0060] In response to the problems existing in the above-mentioned related technologies, this embodiment provides a three-dimensional geological model Boolean operation method, device, electronic device and storage medium.

[0061] like Figure 1As shown, an embodiment of the present invention provides a three-dimensional geological model Boolean operation method, including:

[0062] Step 110: Acquire an original three-dimensional geological model and a model to be combined, wherein both the original three-dimensional geological model and the model to be combined are three-dimensional geological models represented by triangular meshes.

[0063] Specifically, a three-dimensional graphics system is constructed based on OpenGL (Open Graphics Library) to generate the three-dimensional geological model; the three-dimensional geological model data is imported into an image processing unit, such as a shader, for rendering. To load a three-dimensional geological model, it is necessary to load the mesh object of the three-dimensional geological model. The vertex information of the triangle is extracted from the loaded mesh object. Each triangle is usually composed of three vertices, forming an array list of triangles. This list will be used for subsequent bounding box calculations. The three-dimensional geological model is a three-dimensional visualization model constructed by digital means from geological data (such as rock type, layer, fault, hydrogeology, etc.). This model embeds various types of geological information in a three-dimensional coordinate system, and by providing a stereoscopic view, it allows users to intuitively browse and understand complex geological structures.

[0064] Step 120 : Based on the surface area combined with the container partitioning method, a plurality of three-dimensional geological model hierarchical bounding boxes are obtained according to the original three-dimensional geological model, and a plurality of to-be-combined model hierarchical bounding boxes are obtained according to the to-be-combined models.

[0065] Specifically, an axis-aligned bounding box is used as the node data structure, and the surface area cost partitioning method is used to effectively divide the model into a binary tree index structure. A hierarchical bounding box tree is constructed from top to bottom, and a three-dimensional geological model hierarchical bounding box and a hierarchical bounding box of the model to be combined are constructed for the original three-dimensional geological model and the model to be combined, respectively.

[0066] Step 130 : When the 3D geological model hierarchical bounding box intersects with the to-be-combined model hierarchical bounding box, it is determined whether each triangle corresponding to the 3D geological model hierarchical bounding box is an intersecting triangle or a non-intersecting triangle.

[0067] Specifically, on the X-axis, the maximum X-coordinate of level bounding box 1 must be greater than or equal to the minimum X-coordinate of level bounding box 2, and the minimum X-coordinate of level bounding box 1 must be less than or equal to the maximum X-coordinate of level bounding box 2; on the Y-axis, the maximum Y-coordinate of level bounding box 1 must be greater than or equal to the minimum Y-coordinate of level bounding box 2, and the minimum Y-coordinate of level bounding box 1 must be less than or equal to the maximum Y-coordinate of level bounding box 2; similar checks are performed on the Z-axis. If all these conditions are met, the two level bounding boxes intersect. When it is detected that two bounding boxes intersect, the Devillers algorithm is used to accurately detect triangles. The Devillers algorithm is used to determine the relative positional relationship between the midpoints, lines, and planes of the triangles through the geometric meaning of the positive and negative determinants formed by the vertices of the triangles, thereby determining whether the two triangles intersect.

[0068] Step 141 : When the triangle is the intersecting triangle, the internal and external relationship of the intersecting triangle is obtained by determining the internal and external relationship between the intersecting triangle and the model to be combined.

[0069] Specifically, the intersection triangles of the model are obtained by using intersection detection between hierarchical bounding boxes and intersection detection between triangles; triangulation is completed according to the positional relationship between the intersecting triangles; the normal vector relationship of the triangles is compared using ray intersection and the inside-outside judgment between the triangles and the intersecting model is completed.

[0070] Step 142: When the triangle is a non-intersecting triangle, obtain the internal and external relationship of the non-intersecting triangle through a preset half-edge mapping table;

[0071] Specifically, a half-edge mapping table is constructed for the 3D geological model, which is used to determine the inside and outside of non-intersecting triangles. The half-edge mapping table is constructed based on the half-edge structure and fully utilizes the topological information contained in the index grid itself.

[0072] Step 150 : performing a Boolean operation on the original three-dimensional geological model and the model to be combined using all the internal and external relationships of the intersecting triangles and / or the internal and external relationships of the non-intersecting triangles to obtain a Boolean operation result.

[0073] Specifically, the topology reconstruction of the Boolean operation result is completed according to the operation type of the Boolean operation.

[0074] In this embodiment, an original 3D geological model and a model to be combined are obtained. Based on the surface area and container partitioning method, hierarchical bounding boxes are constructed for each model, facilitating subsequent calculations. When the hierarchical bounding box of the 3D geological model intersects with the hierarchical bounding box of the model to be combined, the corresponding triangles are determined to be intersecting or non-intersecting. When the bounding boxes intersect, the intersecting triangles are further determined, improving computational efficiency. When the triangles are intersecting triangles, the intersecting triangles' internal and external relationships are determined by determining the internal and external relationships between the intersecting triangles and the model to be combined, enabling better processing of complex geometric shapes. When the triangles are non-intersecting triangles, the internal and external relationships of the non-intersecting triangles are determined using a preset half-edge mapping table, efficiently completing the determination of non-intersecting triangle internal and external relationships and reducing unnecessary computational overhead. A Boolean operation is performed on the original 3D geological model and the model to be combined using all the intersecting triangle internal and external relationships and / or the non-intersecting triangle internal and external relationships to obtain a Boolean result, improving computational efficiency and effectively processing complex geometric shapes and distributions.

[0075] Optionally, the original three-dimensional geological model includes vertex information of a plurality of triangles, and obtaining a plurality of three-dimensional geological model hierarchical bounding boxes according to the original three-dimensional geological model includes:

[0076] Obtaining a corresponding axis-aligned bounding box according to vertex information of each triangle;

[0077] Obtaining a plurality of partition positions and partition axes through the axis-aligned bounding box;

[0078] Splitting the axis-aligned bounding box according to the plurality of split positions and the split axes to obtain a target left subtree bounding box and a target right subtree bounding box;

[0079] A plurality of new division positions and new division axes are respectively obtained through the target left subtree bounding box and the target right subtree bounding box. The target left subtree bounding box and the target right subtree bounding box are divided multiple times based on the multiple new division positions and the new division axes until a maximum number of bounding boxes is reached, thereby generating a plurality of the three-dimensional geological model hierarchical bounding boxes of the original three-dimensional geological model.

[0080] Specifically, the triangle vertex information includes the coordinates of each triangle vertex, and the boundaries of the bounding box are determined by the minimum and maximum coordinates of each triangle vertex. The length of the projection of the three triangle vertices on each coordinate is calculated, and the average of the minimum and maximum coordinates of the triangle is calculated to obtain the center point of the bounding box. The maximum and minimum values ​​on each axis are integrated to form the area of ​​the bounding box. The size of the bounding box is obtained by the difference between the minimum and maximum coordinates, and half of the size is used as the radius of the bounding box.

[0081] In some more specific embodiments, a function for calculating a bounding box is called for each triangle in a triangle list to obtain the center point and radius of each triangle, and this information is stored in a list for later use. The calculated axis-aligned bounding box of each triangle (including the center point and radius) is stored in a suitable data structure.

[0082] In this optional embodiment, the corresponding axis-aligned bounding box is obtained through the vertex information of each triangle, which facilitates subsequent space division in the data structure, simplifies calculation and optimizes the processing flow, and improves the efficiency and performance of three-dimensional graphics applications.

[0083] Optionally, the step of dividing the axis-aligned bounding box according to the plurality of division positions and the division axes to obtain a target left subtree bounding box and a target right subtree bounding box includes:

[0084] Splitting the axis-aligned bounding box according to each of the split positions and the split axis to obtain a plurality of original left subtree bounding boxes and an original right subtree bounding box, wherein the original left subtree bounding box includes the number of left subtree triangles and the area of ​​the left subtree bounding box, and the original right subtree bounding box includes the number of right subtree triangles and the area of ​​the right subtree bounding box;

[0085] Obtaining a current cost according to the number of triangles in the left subtree, the area of ​​the left subtree bounding box, the number of triangles in the right subtree, the area of ​​the right subtree bounding box, and the area of ​​the axis-aligned bounding box;

[0086] The current cost is:

[0087]

[0088] Among them, Cost is the current cost, C T For the minimum cost, S P is the area of ​​the axis-aligned bounding box, N L is the number of triangles in the left subtree, N R is the number of triangles in the right subtree, S L is the area of ​​the left subtree bounding box, S R is the area of ​​the right subtree bounding box;

[0089] The target left subtree bounding box and the target right subtree bounding box are determined according to the current cost.

[0090] Specifically, the minimum cost initial value is 10.

[0091] Optionally, determining the target left subtree bounding box and the target right subtree bounding box according to the current cost includes:

[0092] When the current cost is less than the minimum cost, the minimum cost is updated using the current cost, and the corresponding original left subtree bounding box and the original right subtree bounding box are used as the target left subtree bounding box and the target right subtree bounding box.

[0093] Specifically, traverse the partitioning axes, usually the x, y, and z axes. Get the boundary positions of all triangles on the current axis, and sort these positions to obtain a series of possible partitioning positions. Set a variable to store the minimum cost currently found (the initial value is positive infinity), and set variables to store the best partitioning axis and partitioning position. For each possible partitioning position, divide the geometry in the current node into a left subtree and a right subtree. For each split, calculate the bounding boxes of the left subtree and the right subtree, and find the number of triangles in them and the surface area of ​​their axis-aligned bounding boxes. Calculate the current partitioning cost. If the cost of the current partitioning is less than the minimum cost found previously, update the minimum cost, the best partitioning axis, and the partitioning position. Save the best partitioning axis and partitioning position to the current node for subsequent processing.

[0094] In this optional embodiment, the surface area cost partitioning method is used to effectively divide the model into a binary tree index structure and construct a hierarchical bounding box tree from top to bottom. Decomposing complex objects or scenes into a hierarchical structure composed of bounding boxes can quickly detect collisions and optimize the rendering process.

[0095] Optionally, obtaining the internal and external relationship of the intersecting triangles by determining the internal and external relationship between the intersecting triangles and the model to be combined includes:

[0096] Splitting the intersecting triangle to obtain a plurality of partial triangles, wherein the sum of the areas of all the partial triangles is the area of ​​the intersecting triangle;

[0097] Based on the dot product operation method, the internal and external relationships of the intersecting triangles are obtained according to the internal and external relationships of each of the partial triangles and the model to be combined.

[0098] Specifically, combined Figure 2 、 Figure 3 As shown, let the models involved in the Boolean operation be A and B, and the triangle T b is a triangle belonging to model B. b When intersecting the internal and external relationship of the model A, it is necessary to construct a ray R, whose starting point is the triangle T b The coordinates of the center of gravity of the triangle T b The normal vector of the ray R, the first triangle where the ray intersects with the model A is T a , the internal and external relationship is achieved by comparing the triangle T a and T bDetermined by the direction of the normal vector. Figure 2 For triangle T b When it is outside the intersection model, triangle T a and T b The angle between the normal vector and the dot product is greater than zero. Figure 3 For triangle T b In the case of the intersection model, the triangle T a and T b The angle between the normal vectors is an obtuse angle, and the result of the dot product operation is less than zero. In addition, in special cases, the ray R may not intersect the model A, so the triangle T cannot be obtained. a In this case, we can determine that triangle T b Outside the intersection model.

[0099] In this optional embodiment, ray intersection is used to compare the normal vector relationship of the triangle and complete the inside-outside judgment between the triangle and the intersecting model. Ray intersection technology can be used to determine whether a point is inside a polyhedron. By emitting rays and detecting whether the rays intersect with the triangle model, it can help determine whether it is inside the object and achieve efficient geometric processing.

[0100] Optionally, the splitting of the intersecting triangles to obtain a plurality of partial triangles includes:

[0101] Obtaining the positional relationship of the intersecting triangles in space, and obtaining a subdivision plane according to the positional relationship;

[0102] Obtaining intersecting line segments of the intersecting triangles according to the subdividing plane;

[0103] The intersecting triangle is split according to the intersecting line segments to obtain a plurality of partial triangles.

[0104] Specifically, during the intersecting triangle decomposition process, the spatial positional relationships of the intersecting triangles are first considered. These relationships include partial intersection, internal intersection, inclusion intersection, and coincident intersection. A decomposition plane is then constructed based on these corresponding positional relationships. The decomposition plane is then used to obtain the intersecting line segments between the intersecting triangles. Finally, the triangles are iteratively decomposed using these intersecting line segments to obtain multiple partial triangles.

[0105] Optionally, the Boolean operation includes a Boolean union operation, a Boolean difference operation, and a Boolean intersection operation, and the Boolean operation result is obtained by performing the Boolean operation on the original three-dimensional geological model and the model to be combined based on the internal and external relationships of all the intersecting triangles and / or the internal and external relationships of the non-intersecting triangles, including:

[0106] The Boolean operation result is obtained by performing the Boolean union operation, the Boolean difference operation, or the Boolean intersection operation on the original three-dimensional geological model and the model to be combined through the internal and external relationships of all the intersecting triangles and / or the internal and external relationships of the non-intersecting triangles.

[0107] In some more specific embodiments, a half-edge mapping table is constructed for a three-dimensional geological model, and the half-edge mapping table is used to complete the inside-outside determination of non-intersecting triangles. The half-edge mapping table is constructed based on the half-edge structure, and also fully utilizes the topological information contained in the index grid itself. Since there is a mapping relationship between the half-edge starting point and the dual edge, a hash table is used in the construction process of the half-edge mapping table, and the half-edge mapping relationship constructed by the hash table is converted into an array expression, so that the adjacency information can be directly accessed using the array index. The essence of a hash table is a collection of key-value pairs. To ensure the uniqueness of the key, the key can be set to the dual half-edge and the value to the starting point. Since the dual half-edge contains a direction, it can be further hashed into the coordinate information of the two vertices. When constructing the half-edge mapping table, first obtain a piece of half-edge information based on the triangle index. Then, search the hash table to see if there is a dual half-edge for that half-edge. If so, save the mapping relationship to an array and delete the key-value pair corresponding to the mapping relationship from the hash table. If not, reverse the direction of this half-edge and store it in the hash table. Iterate all half-edge information until all mapping relationships are matched, and finally output the array that stores the mapping relationship. When determining the inside and outside of non-intersecting triangles, first select any non-intersecting triangle and determine its inside-outside relationship with the intersecting model. Then, quickly obtain the adjacent triangle through the half-edge mapping table and set it to the same inside-outside relationship.

[0108] In some more specific embodiments, in combination Figure 4 As shown in the figure, the contents that need to be stored in the half-edge structure mainly include the starting vertex Origin of the half-edge Edge, the dual half-edge Twin in the opposite direction of the half-edge Edge, the triangle IncidentTri to which the half-edge Edge belongs, and the previous Prev and next half-edge Next of the half-edge Edge. During the construction process, multiple pointers are needed to point to other half-edges.

[0109] In some more specific embodiments, in combination Figure 5 As shown in the figure, the process of obtaining adjacent triangles from the half-edge mapping table is a neighborhood diffusion search process. Based on the three sides of triangle T0, the half-edge mapping table can be used to quickly find the three adjacent triangles T1, T2, and T3. The neighborhood diffusion search can then be continued based on the half-edges of these three triangles. Repeating this process will traverse all triangles in the model.

[0110] like Figure 6As shown, an embodiment of the present invention provides a three-dimensional geological model Boolean operation device, comprising:

[0111] A model acquisition module 10 is used to acquire an original three-dimensional geological model and a model to be combined, wherein both the original three-dimensional geological model and the model to be combined are three-dimensional geological models represented by triangular meshes;

[0112] A hierarchical bounding box acquisition module 20 is configured to obtain a plurality of hierarchical bounding boxes of three-dimensional geological models according to the original three-dimensional geological model based on a surface area combined with a container partitioning method, and obtain a plurality of hierarchical bounding boxes of models to be combined according to the models to be combined;

[0113] An intersection judgment module 30 is used to judge whether each triangle corresponding to the three-dimensional geological model hierarchical bounding box is an intersecting triangle or a non-intersecting triangle when the three-dimensional geological model hierarchical bounding box intersects with the hierarchical bounding box of the model to be combined;

[0114] The intersecting triangle internal and external relationship acquisition module 40 is configured to obtain the intersecting triangle internal and external relationship by determining the internal and external relationship between the intersecting triangle and the model to be combined when the triangle is the intersecting triangle;

[0115] A non-intersecting triangle internal and external relationship acquisition module 50 is configured to obtain the non-intersecting triangle internal and external relationship using a preset half-edge mapping table when the triangle is a non-intersecting triangle;

[0116] The Boolean operation result acquisition module 60 is configured to perform a Boolean operation on the original three-dimensional geological model and the model to be combined based on the internal and external relationships of all the intersecting triangles and / or the internal and external relationships of the non-intersecting triangles to obtain a Boolean operation result.

[0117] The three-dimensional geological model Boolean operation device of this embodiment is used to implement the three-dimensional geological model Boolean operation method described above. Its advantages over the existing technology are the same as the advantages of the three-dimensional geological model Boolean operation method described above over the existing technology, and will not be repeated here.

[0118] Optionally, the hierarchical bounding box acquisition module 20 is specifically configured to: obtain a corresponding axis-aligned bounding box according to vertex information of each triangle;

[0119] Obtaining a plurality of partition positions and partition axes through the axis-aligned bounding box;

[0120] Splitting the axis-aligned bounding box according to the plurality of split positions and the split axes to obtain a target left subtree bounding box and a target right subtree bounding box;

[0121] A plurality of new division positions and new division axes are respectively obtained through the target left subtree bounding box and the target right subtree bounding box. The target left subtree bounding box and the target right subtree bounding box are divided multiple times based on the multiple new division positions and the new division axes until a maximum number of bounding boxes is reached, thereby generating a plurality of the three-dimensional geological model hierarchical bounding boxes of the original three-dimensional geological model.

[0122] Optionally, the hierarchical bounding box acquisition module 20 is specifically configured to: split the axis-aligned bounding box according to each of the division positions and the division axis to obtain a plurality of original left subtree bounding boxes and original right subtree bounding boxes, wherein the original left subtree bounding box includes the number of left subtree triangles and the area of ​​the left subtree bounding box, and the original right subtree bounding box includes the number of right subtree triangles and the area of ​​the right subtree bounding box;

[0123] Obtaining a current cost according to the number of triangles in the left subtree, the area of ​​the left subtree bounding box, the number of triangles in the right subtree, the area of ​​the right subtree bounding box, and the area of ​​the axis-aligned bounding box;

[0124] The current cost is:

[0125]

[0126] Among them, Cost is the current cost, C T is the minimum cost, S P is the area of ​​the axis-aligned bounding box, N L is the number of triangles in the left subtree, N R is the number of triangles in the right subtree, S L is the area of ​​the left subtree bounding box, S R is the area of ​​the right subtree bounding box;

[0127] The target left subtree bounding box and the target right subtree bounding box are determined according to the current cost.

[0128] Optionally, the hierarchical bounding box acquisition module 20 is specifically used to: when the current cost is less than the minimum cost, use the current cost to update the minimum cost, and use the corresponding original left subtree bounding box and the original right subtree bounding box as the target left subtree bounding box and the target right subtree bounding box.

[0129] Optionally, the intersecting triangle internal and external relationship acquisition module 40 is specifically configured to:

[0130] Splitting the intersecting triangle to obtain a plurality of partial triangles, wherein the sum of the areas of all the partial triangles is the area of ​​the intersecting triangle;

[0131] Based on the dot product operation method, the internal and external relationships of the intersecting triangles are obtained according to the internal and external relationships of each of the partial triangles and the model to be combined.

[0132] Optionally, the intersecting triangle internal and external relationship acquisition module 40 is specifically used to: acquire the positional relationship of the intersecting triangles in space, and obtain a subdivision plane according to the positional relationship;

[0133] Obtaining intersecting line segments of the intersecting triangles according to the subdividing plane;

[0134] The intersecting triangle is split according to the intersecting line segments to obtain a plurality of partial triangles.

[0135] Optionally, the Boolean operation result acquisition module 60 is specifically used to: perform the Boolean union operation or the Boolean difference operation or the Boolean intersection operation on the original three-dimensional geological model and the model to be combined through the internal and external relationships of all the intersecting triangles and / or the internal and external relationships of the non-intersecting triangles to obtain the Boolean operation result.

[0136] like Figure 7 As shown, an electronic device 700 provided by an embodiment of the present invention includes a memory 710 and a processor 720; the memory 710 is used to store a computer program; the processor 720 is used to implement the three-dimensional geological model Boolean operation method as described above when executing the computer program.

[0137] In other words, an electronic device 700 includes a memory 710 and a processor 720 coupled to the memory 710; the memory 710 is configured to store a computer program; and the processor 720 is configured to perform the following operations when executing the computer program:

[0138] Acquire an original three-dimensional geological model and a model to be combined, wherein both the original three-dimensional geological model and the model to be combined are three-dimensional geological models represented by triangular meshes;

[0139] Based on the surface area combined with the container division method, a plurality of three-dimensional geological model hierarchical bounding boxes are obtained according to the original three-dimensional geological model, and a plurality of to-be-combined model hierarchical bounding boxes are obtained according to the to-be-combined model;

[0140] When the three-dimensional geological model hierarchical bounding box intersects with the to-be-combined model hierarchical bounding box, determining whether each triangle corresponding to the three-dimensional geological model hierarchical bounding box is an intersecting triangle or a non-intersecting triangle;

[0141] When the triangle is the intersecting triangle, the internal and external relationship of the intersecting triangle is obtained by determining the internal and external relationship between the intersecting triangle and the model to be combined;

[0142] When the triangle is a non-intersecting triangle, the internal and external relationship of the non-intersecting triangle is obtained by using a preset half-edge mapping table;

[0143] A Boolean operation result is obtained by performing a Boolean operation on the original three-dimensional geological model and the model to be combined through the internal and external relationships of all the intersecting triangles and / or the internal and external relationships of the non-intersecting triangles.

[0144] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the three-dimensional geological model Boolean operation method described above is implemented.

[0145] In other words, a non-volatile computer-readable storage medium stores a computer program, which, when executed by a processor, causes the processor to perform the following operations:

[0146] Acquire an original three-dimensional geological model and a model to be combined, wherein both the original three-dimensional geological model and the model to be combined are three-dimensional geological models represented by triangular meshes;

[0147] Based on the surface area combined with the container division method, a plurality of three-dimensional geological model hierarchical bounding boxes are obtained according to the original three-dimensional geological model, and a plurality of to-be-combined model hierarchical bounding boxes are obtained according to the to-be-combined model;

[0148] When the three-dimensional geological model hierarchical bounding box intersects with the to-be-combined model hierarchical bounding box, determining whether each triangle corresponding to the three-dimensional geological model hierarchical bounding box is an intersecting triangle or a non-intersecting triangle;

[0149] When the triangle is the intersecting triangle, the internal and external relationship of the intersecting triangle is obtained by determining the internal and external relationship between the intersecting triangle and the model to be combined;

[0150] When the triangle is a non-intersecting triangle, the internal and external relationship of the non-intersecting triangle is obtained by using a preset half-edge mapping table;

[0151] A Boolean operation result is obtained by performing a Boolean operation on the original three-dimensional geological model and the model to be combined through the internal and external relationships of all the intersecting triangles and / or the internal and external relationships of the non-intersecting triangles.

[0152] An electronic device 700 that can serve as a server or client of the present invention will now be described, which is an example of a hardware device that can be applied to various aspects of the present invention. The electronic device 700 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device 700 can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0153] The electronic device 700 includes a computing unit that can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) or a computer program loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for device operation can also be stored. The computing unit, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.

[0154] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM). In this application, the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments of the present invention. In addition, the functional units in the various embodiments of the present invention can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into a single unit. The above-mentioned integrated units can be implemented in the form of hardware or software functional units.

[0155] Although the present invention is disclosed as above, the protection scope of the present invention is not limited thereto. Those skilled in the art may make various changes and modifications without departing from the spirit and scope of the present invention, and these changes and modifications will fall within the protection scope of the present invention.

Claims

1. A three-dimensional geological model Boolean operation method, characterized in that: include: An original three-dimensional geological model and a model to be combined are obtained, wherein both the original three-dimensional geological model and the model to be combined are three-dimensional geological models represented by triangular meshes, and the three-dimensional geological model includes: Construct a 3D graphics system based on OpenGL; Importing three-dimensional geological model data into the image processing unit of the three-dimensional graphics system to generate a three-dimensional geological model, wherein the three-dimensional geological model data includes rock types, horizons, faults and hydrogeology; Based on the surface area combined with the container division method, a plurality of three-dimensional geological model hierarchical bounding boxes are obtained according to the original three-dimensional geological model, and a plurality of to-be-combined model hierarchical bounding boxes are obtained according to the to-be-combined model; When the three-dimensional geological model hierarchical bounding box intersects with the to-be-combined model hierarchical bounding box, determining whether each triangle corresponding to the three-dimensional geological model hierarchical bounding box is an intersecting triangle or a non-intersecting triangle; When the triangle is the intersecting triangle, the internal and external relationship of the intersecting triangle is obtained by determining the internal and external relationship between the intersecting triangle and the model to be combined; When the triangle is a non-intersecting triangle, the internal and external relationship of the non-intersecting triangle is obtained by using a preset half-edge mapping table; A Boolean operation result is obtained by performing a Boolean operation on the original three-dimensional geological model and the model to be combined through the internal and external relationships of all the intersecting triangles and / or the internal and external relationships of the non-intersecting triangles.

2. The three-dimensional geological model Boolean operation method according to claim 1, characterized in that: The original three-dimensional geological model includes vertex information of a plurality of triangles, and the step of obtaining a plurality of three-dimensional geological model hierarchical bounding boxes according to the original three-dimensional geological model includes: Obtaining a corresponding axis-aligned bounding box according to vertex information of each triangle; Obtaining a plurality of partition positions and partition axes through the axis-aligned bounding box; Splitting the axis-aligned bounding box according to the plurality of split positions and the split axes to obtain a target left subtree bounding box and a target right subtree bounding box; A plurality of new division positions and new division axes are respectively obtained through the target left subtree bounding box and the target right subtree bounding box. The target left subtree bounding box and the target right subtree bounding box are divided multiple times based on the multiple new division positions and the new division axes until a maximum number of bounding boxes is reached, thereby generating a plurality of the three-dimensional geological model hierarchical bounding boxes of the original three-dimensional geological model.

3. The Boolean operation method of three-dimensional geological model according to claim 2, characterized in that: The step of segmenting the axis-aligned bounding box according to the plurality of segmentation positions and the segmentation axes to obtain a target left subtree bounding box and a target right subtree bounding box includes: Splitting the axis-aligned bounding box according to each of the split positions and the split axis to obtain a plurality of original left subtree bounding boxes and an original right subtree bounding box, wherein the original left subtree bounding box includes the number of left subtree triangles and the area of ​​the left subtree bounding box, and the original right subtree bounding box includes the number of right subtree triangles and the area of ​​the right subtree bounding box; Obtaining a current cost according to the number of triangles in the left subtree, the area of ​​the left subtree bounding box, the number of triangles in the right subtree, the area of ​​the right subtree bounding box, and the area of ​​the axis-aligned bounding box; The current cost is: , in, is the current cost, For the minimum cost, is the area of ​​the axis-aligned bounding box, is the number of triangles in the left subtree, is the number of triangles in the right subtree, is the area of ​​the left subtree bounding box, is the area of ​​the right subtree bounding box; The target left subtree bounding box and the target right subtree bounding box are determined according to the current cost.

4. The three-dimensional geological model Boolean operation method according to claim 3, characterized in that: The determining the target left subtree bounding box and the target right subtree bounding box according to the current cost includes: When the current cost is less than the minimum cost, the minimum cost is updated using the current cost, and the corresponding original left subtree bounding box and the original right subtree bounding box are used as the target left subtree bounding box and the target right subtree bounding box.

5. The three-dimensional geological model Boolean operation method according to claim 1, characterized in that: The determining of the internal and external relationship between the intersecting triangles and the model to be combined comprises: Splitting the intersecting triangle to obtain a plurality of partial triangles, wherein the sum of the areas of all the partial triangles is the area of ​​the intersecting triangle; Based on the dot product operation method, the internal and external relationships of the intersecting triangles are obtained according to the internal and external relationships between each of the partial triangles and the model to be combined.

6. The three-dimensional geological model Boolean operation method according to claim 5, characterized in that: The step of dividing the intersecting triangles to obtain a plurality of partial triangles includes: Obtaining the positional relationship of the intersecting triangles in space, and obtaining a subdivision plane according to the positional relationship; Obtaining intersecting line segments of the intersecting triangles according to the subdividing plane; The intersecting triangle is split according to the intersecting line segments to obtain a plurality of partial triangles.

7. The three-dimensional geological model Boolean operation method according to claim 1, characterized in that: The Boolean operation includes a Boolean union operation, a Boolean difference operation, and a Boolean intersection operation. The Boolean operation result obtained by performing the Boolean operation on the original three-dimensional geological model and the model to be combined through the internal and external relationships of all the intersecting triangles and / or the internal and external relationships of the non-intersecting triangles includes: The Boolean operation result is obtained by performing the Boolean union operation, the Boolean difference operation, or the Boolean intersection operation on the original three-dimensional geological model and the model to be combined through the internal and external relationships of all the intersecting triangles and / or the internal and external relationships of the non-intersecting triangles.

8. A three-dimensional geological model Boolean operation device, characterized in that: include: a model acquisition module, configured to acquire an original three-dimensional geological model and a model to be combined, wherein both the original three-dimensional geological model and the model to be combined are three-dimensional geological models represented by triangular meshes, and the three-dimensional geological model is constructed based on geological data, including rock types, horizons, faults, and hydrogeology; A hierarchical bounding box acquisition module is configured to obtain a plurality of hierarchical bounding boxes of three-dimensional geological models based on the original three-dimensional geological model and a plurality of hierarchical bounding boxes of models to be combined based on the models to be combined based on the surface area combined with the container partitioning method; An intersection judgment module is used to judge whether each triangle corresponding to the hierarchical bounding box of the three-dimensional geological model is an intersecting triangle or a non-intersecting triangle when the hierarchical bounding box of the three-dimensional geological model intersects with the hierarchical bounding box of the model to be combined; An intersecting triangle internal and external relationship acquisition module, configured to obtain the intersecting triangle internal and external relationship by determining the internal and external relationship between the intersecting triangle and the model to be combined when the triangle is the intersecting triangle; a non-intersecting triangle internal and external relationship acquisition module, configured to obtain the non-intersecting triangle internal and external relationship through a preset half-edge mapping table when the triangle is a non-intersecting triangle; The Boolean operation result acquisition module is used to perform Boolean operation on the original three-dimensional geological model and the model to be combined through the internal and external relationships of all the intersecting triangles and / or the internal and external relationships of the non-intersecting triangles to obtain a Boolean operation result.

9. An electronic device, characterized in that: including memory and processor; The memory is used to store computer programs; The processor is configured to implement the three-dimensional geological model Boolean operation method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and when the computer program is executed by a processor, the three-dimensional geological model Boolean operation method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • TIN-based coupling method of three-dimensional geological model and BIM (Building Information Modeling) model

    CN107609268A

  • Boolean operation method and device, computer equipment and storage medium

    CN113902870A