A GPU-based AASDF construction method and system

By constructing AASDF through hierarchical sparse octree and improved FIM algorithm, the difficulty of Boolean operations on surface meshes is solved, efficient AASDF construction and Boolean operations are achieved, and the computing performance on GPU is improved.

CN115994976BActive Publication Date: 2025-09-05INST OF SOFTWARE - CHINESE ACAD OF SCI
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211578074.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-06
Publication Date
2025-09-05
Estimated Expiration
2042-12-06

AI Technical Summary

Technical Problem

Existing technologies have difficulty performing Boolean operations on surface meshes, and the construction of adaptive SDFs and Boolean operations are inefficient, making them difficult to implement efficiently on GPUs.

Method used

A hierarchical sparse octree structure and a bottom-up improved FIM algorithm are used to construct the AASDF model layer by layer in parallel, and Boolean operations are implemented through the bottom-up improved FIM algorithm.

Benefits of technology

It realizes the efficient construction and Boolean operation of AASDF, does not rely on the surface patches of the model, and can be executed in parallel on the GPU, thus improving the computational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115994976B_ABST
    Figure CN115994976B_ABST
Patent Text Reader

Abstract

The present invention relates to a method and system for constructing an AASDF based on a GPU. The method comprises the following steps: S1: determining the constraints of the AASDF and a hierarchical sparse octree according to the definition of the AASDF; S2: defining the AASDF model using the Eikonal equation; S3: constructing the leaf nodes of the finest layer of the AASDF model; S4: constructing the nodes of the middle layer of the AASDF model layer by layer from bottom to top based on the leaf nodes; S5: initializing the nodes of the top layer of the AASDF model constructed based on a uniform grid based on the nodes of the middle layer, iteratively updating using a standard fast iterative algorithm until the top layer nodes converge and the AASDF model is constructed; S6: constructing a global neighborhood relationship based on the hierarchical structure of the AASDF model, and then interpolating based on the neighborhood relationship of the nodes using moving least squares to achieve access to the AASDF; and S7: repeating steps S3 to S5 for any two AASDF models to perform bottom-up Boolean operations. The method provided by the present invention uses a hierarchical sparse octree structure to achieve parallel construction and Boolean operations of AASDF on a GPU.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer graphics, and in particular to a method and system for constructing an AASDF based on a GPU. Background Art

[0002] Boolean operations, including intersection, union, and complement, are important geometric tools in solid modeling and computational geometry. Because geometric models are often represented by surface meshes, researchers have conducted extensive research on performing Boolean operations directly on surface meshes. However, performing Boolean operations directly on surface meshes has proven to be a notoriously difficult task. Signed distance fields (SDFs), a widely used implicit model representation method in solid modeling and physics-based animation, offer the advantages of fast computational speed and ease of implementation when performing Boolean operations on them.

[0003] However, compared with using surface meshes to represent models, volume representation using SDFs usually requires more storage space. In order to save storage space, adaptive sparse data structures such as octrees can be used to store SDFs. The core idea of ​​existing adaptive SDF construction algorithms is to first create sampling points based on quadtrees (2D) or octrees (3D), and then query the shortest distance from the sampling points to the model surface mesh. Different spatial structures are used to accelerate the query process, including rectangular grids, octrees, bounding volume hierarchies (BVHs), etc. Existing methods can achieve interactive speed construction of adaptive SDFs based on GPUs, but the dependence of the construction process on surface meshes makes it very difficult to perform Boolean operations on two adaptive SDFs. How to develop high-performance sparse data structures for the construction of SDFs and Boolean operations on them has become an urgent problem to be solved. Summary of the Invention

[0004] To address the aforementioned technical issues, the present invention provides a GPU-based AASDF construction method and system. The proposed AASDF uses a hierarchical sparse octree to store the AASDFs. A bottom-up improved FIM algorithm (Fastiterative Method) is then used to construct the AASDFs layer by layer in parallel. Boolean operations between two AASDFs are also performed using the bottom-up improved FIM algorithm.

[0005] The technical solution of the present invention is: a method for constructing an AASDF based on a GPU, comprising:

[0006] Step S1: According to the definition of AASDF, determine the constraints of AASDF and the constraints of the hierarchical sparse octree corresponding to AASDF;

[0007] Step S2: Based on the definition of AASDF and its constraints, define the AASDF model using the Eikonal equation;

[0008] Step S3: solving the AASDF model according to the constraints of the hierarchical sparse octree to construct leaf nodes of the finest layer of the AASDF model;

[0009] Step S4: Based on the leaf nodes, construct the nodes of the middle layer of the AASDF model layer by layer from bottom to top;

[0010] Step S5: Initializing the nodes of the top layer of the AASDF model constructed based on the uniform grid based on the nodes of the middle layer, and iteratively updating using a standard fast iterative algorithm until the top layer nodes converge and the AASDF model is constructed;

[0011] Step S6: constructing a global neighborhood relationship based on the hierarchical structure of the AASDF model, and then using moving least squares to interpolate based on the neighborhood relationship of the nodes to access the AASDF;

[0012] Step S7: Repeat steps S3 to S5 for any two AASDF models to perform Boolean operations from bottom to top, wherein the Boolean operations include intersection, union and complement operations.

[0013] Compared with the prior art, the present invention has the following advantages:

[0014] 1. The present invention discloses a GPU-based AASDF construction method, which uses a hierarchical sparse octree structure to construct an algebraic system of AASDF. The construction process of the present invention does not depend on the facets of the model surface, so Boolean operations between AASDFs can be efficiently implemented.

[0015] 2. The present invention adopts a bottom-up improved FIM method, which can construct AASDF nodes in parallel on GPU.

[0016] 3. The present invention adopts a bottom-up algorithm and can perform Boolean operations of two AASDFs in parallel on a GPU. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 Flowchart of a method for constructing an AASDF based on GPU in an embodiment of the present invention;

[0018] Figure 2 Schematic diagram of a hierarchical sparse octree according to an embodiment of the present invention;

[0019] Figure 3 This is the process of constructing the parent node and sibling nodes of the intermediate layer node in an embodiment of the present invention;

[0020] Figure 4 Schematic diagram of the construction process of each layer of the AASDF model in an embodiment of the present invention;

[0021] Figure 5 Schematic diagram of a neighbor node search process according to an embodiment of the present invention;

[0022] Figure 6 This is a structural block diagram of a GPU-based AASDF construction system in an embodiment of the present invention. DETAILED DESCRIPTION

[0023] The present invention provides a method for constructing AASDF based on GPU, which uses a hierarchical sparse octree structure to realize parallel construction and Boolean operations of AASDF on GPU.

[0024] The hardware platform for the method uses an Intel Xeon W 2245 eight-core CPU with a main frequency of 3.9GHz and an NVIDIA GeForce GTX 3090 graphics card with 24GB of video memory. The system program is written in C++, using the CUDA language for acceleration of parallel computing. The program is compiled and executed using Microsoft Visual Studio 2017, and open source libraries such as OpenGL and Freeglut are used during development.

[0025] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below through specific implementation and in conjunction with the accompanying drawings.

[0026] Example 1

[0027] like Figure 1 As shown, an embodiment of the present invention provides a method for constructing an AASDF based on a GPU, comprising the following steps:

[0028] Step S1: According to the definition of AASDF, determine the constraints of AASDF and the constraints of the hierarchical sparse octree corresponding to AASDF;

[0029] Step S2: Based on the definition of AASDF and its constraints, define the AASDF model using the Eikonal equation;

[0030] Step S3: Solve the AASDF model according to the constraints of the hierarchical sparse octree and construct the leaf nodes of the finest layer of the AASDF model;

[0031] Step S4: Based on the leaf nodes, construct the nodes of the middle layer of the AASDF model layer by layer from bottom to top;

[0032] Step S5: Initialize the nodes of the top layer of the AASDF model constructed based on the uniform grid based on the nodes of the middle layer, and iterate and update using a standard fast iterative algorithm until the top layer nodes converge and the AASDF model is constructed;

[0033] Step S6: constructing a global neighborhood relationship based on the hierarchical structure of the AASDF model, and then using moving least squares to interpolate based on the neighborhood relationship of the nodes to achieve access to the AASDF;

[0034] Step S7: Repeat steps S3 to S5 for any two AASDF models to perform Boolean operations from bottom to top, where the Boolean operations include intersection, union, and complement operations.

[0035] In one embodiment, the above step S1: determining the constraints of the AASDF and the constraints of the hierarchical sparse octree corresponding to the AASDF according to the definition of the AASDF, specifically includes:

[0036] Step S11: Determine the constraints of AASDF:

[0037] a) Adaptability: AASDF maintains sparse data structures by dynamically refining the grid resolution of the domain of interest, i.e., using high-resolution grids in the model boundary area and low-resolution grids in the non-boundary area;

[0038] b) Completeness: Any Boolean operation between any two AASDFs will generate a new AASDF, and the newly generated AASDF satisfies the above adaptability;

[0039] c) Parallelism: The construction of AASDF and the Boolean operations are both parallelizable;

[0040] Step S12: Determine the constraints of the hierarchical sparse octree:

[0041] a) Each level of sparse octree shares a global reference point x g When constructing AASDF, according to the following formula, x g Align the boundaries of the region of interest:

[0042]

[0043] Among them, x o is the starting point of the region of interest, Δx is the grid spacing of the finest layer, and frac(·) is the equation used to calculate the floating-point fraction;

[0044] b) At each layer, sparsity is maintained by creating only nodes in the boundary area. That is, the hierarchical sparse octree contains only two types of nodes: intermediate nodes and leaf nodes. Among them, the intermediate nodes have 8 child nodes and the leaf nodes have no child nodes.

[0045] c) The depth of the hierarchical sparse octree is adaptive, that is, only leaf nodes within a preset number are constructed, and when the number of layers of the hierarchical sparse octree is greater than a threshold, a unified uniform grid is automatically created as the top layer.

[0046] The finest layer of the AASDF model defined according to an embodiment of the present invention only includes leaf nodes, and the middle layer and the top layer may include leaf nodes and middle nodes.

[0047] In one embodiment, the above step S2: defining the AASDF model using the Eikonal equation according to the definition of AASDF and its constraints, specifically includes:

[0048] In the entire metric space X, define the AASDF model φ(x):

[0049]

[0050] in, is the boundary of the closed domain Ω, and d represents the distance to the boundary;

[0051] When the boundary is smooth, the gradient of φ(x) satisfies the Eikonal equation:

[0052]

[0053] in, is the gradient operator, and |·| is the Euclidean norm.

[0054] The Eikonal equation can be viewed as along The absolute value of φ(x) represents the time it takes for the wavefront to reach point x. Three numerical methods are commonly used to solve the Eikonal equation: the fast marching method (FMM), the fast sweep method (FSM), and the fast iterative method (FIM).

[0055] In order to develop a highly parallel algorithm based on GPU to solve the Eikonal equation, the present invention proposes an improved FIM solution method that can work well on adaptive grids.

[0056] The basic idea of ​​the standard FIM is to propagate values ​​from a narrow band near the boundary to distant regions. This process can be divided into two steps:

[0057] (1) Initialization: First, initialize the value of the node near the boundary, mark it as the FIM source point and add it to the source point list, then add the nodes adjacent to the FIM source point to the active list;

[0058] (2) Update: Update the values ​​of these nodes according to their neighbor source points. Once the value of a node in the active list converges, add the node to the source point list, and then add the neighbor nodes of the node that have not converged to the active list. Continue this process until the active list is empty.

[0059] Both the initialization and update processes can be implemented in parallel, and no complex data structures are required to store intermediate variables. Therefore, if a uniform grid is used to store the signed distance field, standard FIM methods can be easily implemented on a GPU. The difficulty lies in how to use the FIM method and maintain good performance when using a sparse data structure to store the signed distance field. This paper proposes using a hierarchical sparse octree to store AASDF. Figure 2 A schematic diagram of a hierarchical sparse octree is shown, which contains two types of nodes: leaf nodes and intermediate nodes, where layer 6 is the finest layer and contains only leaf nodes. Layers 4 and 5 are intermediate layers, containing leaf nodes and intermediate nodes. Layer 3 is the top layer, containing leaf nodes and intermediate nodes. The basic idea of ​​the improved FIM of the present invention is: in the process of constructing a hierarchical sparse octree layer by layer from bottom to top, the leaf nodes of the finest layer are first created and marked as source points and added to the source point list; after the nodes of the intermediate layer are created and initialized based on the finest layer, the intermediate nodes of the intermediate layer are marked as source points, and the leaf nodes are added to the active list, and the values ​​of the leaf nodes are updated through iteration; the top-level nodes are created and initialized based on the intermediate layer, the intermediate nodes of the top-level nodes are marked as source points, and then the standard FIM iteration is used to update the nodes of the top level.

[0060] The embodiment of the present invention defines a structure containing the following attributes for each node:

[0061] (1) l: the level number of the node, the level number of the root node is marked as 0;

[0062] (2) m: Morton code, indicating that nodes are stored in memory according to a z-shaped filling curve;

[0063] (3)φ: the directed distance field of the node center;

[0064] (4) c: the center of the node;

[0065] (5) p: projection of the node center to the model boundary;

[0066] (6) n: normal direction of the model boundary at point p;

[0067] (7) The indices of all child nodes;

[0068] (8) The indices of all neighbor nodes.

[0069] In one embodiment, the above step S3: solving the AASDF model according to the constraints of the hierarchical sparse octree to construct the leaf nodes of the finest layer of the AASDF model specifically includes:

[0070] Step S31: Select an appropriate grid spacing Δx for the finest layer, and then construct leaf nodes for the overlapping grids of the axis-aligned bounding boxes of the AASDF model boundary patches. The index of the overlapping grid is calculated by the following formula:

[0071]

[0072]

[0073]

[0074] Where [x1, x2] is the axis-aligned bounding box of the AASDF model boundary patch, that is, the smallest hexahedron that contains the AASDF model boundary patch and has edges parallel to the coordinate axes. x1 is the vertex at the lower left corner of the axis-aligned bounding box, and x2 is the vertex at the upper right corner of the axis-aligned bounding box. is the floor function, is the ceiling function, % is the remainder function;

[0075] Based on the above formula, it can be ensured that the sibling nodes of the leaf nodes at the finest level are created at the same time, that is, the parent node of the leaf node is guaranteed to have eight child nodes, which meets the characteristics of the hierarchical sparse octree;

[0076] Step S32: After sorting and removing duplicates, grids with indexes within the range of F(x1)×G(x2) are recorded as leaf nodes.

[0077] In the construction process of AASDF, the model boundary is usually represented by closed triangular facets. When constructing the leaf nodes of the finest layer, a GPU thread is assigned to each triangular facet, and then the grid index that overlaps with the axis-aligned bounding box (AABB) of the triangular facet is calculated. Then, corresponding leaf nodes are created for these grids, and the attributes of these leaf nodes are updated at the same time. Since each triangular facet is calculated in parallel and independently, additional operations are required to delete duplicate leaf nodes. First, all leaf nodes are sorted in parallel according to the Morton code. For leaf nodes with the same Morton code, only the leaf nodes with the smallest absolute value of the distance are retained. At this point, the construction of the leaf nodes of the finest layer is completed. Since the distance value calculations of the leaf nodes of the finest layer are accurate, all leaf nodes of this layer are marked as source points of the FIM and are used to initialize the intermediate layer nodes created next.

[0078] In one embodiment, the above step S4: constructing the nodes of the middle layer of the AASDF model layer by layer from bottom to top based on the leaf nodes specifically includes:

[0079] The current node can be calculated based on the Morton code of its child nodes or the child nodes of its sibling nodes according to the following formula:

[0080] m l =(m l+1 >>6)<<3+m l+1 &7

[0081] Among them, m l is the Morton code of the current node, i.e. the intermediate node of the lth layer, m l+1 is the Morton code of the middle node of the l+1th layer, >> is the right shift operator, << is the left shift operator, and & is the position operator.

[0082] In this step, assuming that the nodes of layer l are currently being constructed based on layer l+1, a GPU thread needs to be allocated to each node of layer l+1, and then the parent node and the sibling nodes of the parent node are constructed according to the above formula. Figure 3 The process of constructing the parent node and sibling nodes of a middle-layer node is shown. When the node's Morton code is m=0000, its parent node m=00 is created. When the node's Morton code is m=0001, its parent node's sibling node m=01 is created. This approach not only ensures that the constructed middle layer meets the characteristics of a hierarchical sparse octree but also reduces the number of duplicate nodes, improving construction efficiency. However, nodes generated in this way will still be duplicated, so duplicate nodes must be removed using the same steps as those used to construct nodes in the finest layer.

[0083] The properties of the newly constructed node are initialized by its child nodes or the child nodes of its sibling nodes, such as φ l Through the node center c l Projection point p to all child nodes l+1 The minimum distance is used to initialize. Since the directed distance value calculated in this way is accurate, newly created internal nodes are marked as FIM sources, and newly created leaf nodes are added to the active list. Next, the FIM is used to update the attributes of the nodes in the active list. Given a node with index (i, j, k), it is necessary to find all the source points adjacent to it. This invention proposes an axial method to find the neighbor nodes of a node. Taking the X axis as an example, the index is calculated according to the following formula:

[0084] I x =k*n i *n j +j*n i +i

[0085] Among them, (n i ×n j ×n k ) represents the grid resolution of this layer. x After sorting the nodes, it is easy to find the neighbor nodes along the X axis. Similarly, the neighbors along other axes can also be found through I y and I z After a few iterations, the newly constructed nodes are marked as source points, and the construction of the next layer of nodes continues.

[0086] In this step, the attributes of the intermediate layer nodes are initialized using the attributes of their child nodes or the child nodes of their sibling nodes. The positional relationship between the intermediate node and its child nodes ensures that the distance value of the intermediate node is accurate. Therefore, the initialized intermediate node is marked as the FIM source point, and then the leaf nodes of this layer are iteratively updated. Because the nodes in each layer are only within a narrow band, convergence is achieved after a few iterations. At this point, all nodes in the layer are marked as FIM sources, providing initial values ​​for the nodes in the next layer.

[0087] In one embodiment, the above step S5: initializes the top-level nodes of the AASDF model constructed based on the uniform grid based on the nodes of the middle layer, and iterates and updates using a standard fast iterative algorithm until the top-level nodes converge and the AASDF model is constructed.

[0088] The top layer uses a uniform grid to store the signed distance field, not just a narrow band near the boundary. The resolution of the uniform grid is affected by many factors, including the size of the region of interest, the number of GPU threads, and user-defined thresholds. After determining an appropriate resolution for the top layer, the construction of the signed distance field is similar to that of the middle layers. First, the intermediate nodes of the top layer are initialized by their children and marked as source points. Then, the leaf node values ​​are updated using standard FIM iterations until convergence. Since the top layer typically has a lower resolution, a small number of iterations is sufficient for convergence. This completes the AASDF model.

[0089] Figure 4 A schematic diagram of the construction process of each level of the AASDF model is shown.

[0090] At this point, all leaf nodes of the constructed AASDF model form an adaptive grid structure covering the domain of interest, and the leaf nodes store the directed distance values ​​corresponding to the grid center points. When Boolean operations are required on the AASDF, it is necessary to access the AASDF, that is, given the coordinates of any point, return its directed distance value in the current AASDF. Because the accessed point is usually not the grid center point, the embodiment of the present invention interpolates based on the global neighborhood relationship of the AASDF through the following steps to calculate the directed distance value of any point.

[0091] In one embodiment, step S6: constructing a global neighborhood relationship based on the hierarchical structure of the AASDF model, and then using moving least squares to perform interpolation based on the neighborhood relationship of the nodes to achieve access to the AASDF.

[0092] Boolean operations between AASDFs require access to the adaptive storage structure of the hierarchical sparse octree, that is, obtaining the directed distance value of the non-node center point, which requires interpolation based on the values ​​of all adjacent nodes. Since the storage structure of AASDFs is adaptive, the construction of neighborhood relationships is challenging. The neighborhood relationships of the same level have been constructed during iterative updates. This paper proposes to gradually construct global neighborhood relationships starting from the neighbor nodes of the same level. Figure 5 The process of searching for neighbor nodes is shown. First, a GPU thread is assigned to each leaf node of AASDF. For example, for leaf node N l , N' l is its neighbor node at the same level, if N' l If there is a child node, continue to visit the child node with N l For the adjacent half, if the child node has child nodes, continue to recursively visit downward until reaching the leaf node. According to this rule, and Is the leaf node that is finally visited, and then and Add to N lIn the neighbor node index list, N l Add to and The neighbor node index list.

[0093] Since the sizes of adaptive grids are different, linear interpolation will introduce large errors. Therefore, the embodiment of the present invention selects MLS for interpolation. For any point x = (x, y, z), the directed distance value of the point can be expressed as:

[0094] φ(x)=a+b*x+c*y+d*z

[0095] Where (a, b, c, d) are the coefficients to be solved, which can be obtained through the following objective function:

[0096]

[0097] Among them, x i is the center point coordinate of the neighbor node, φ i is the directed distance value of the corresponding neighbor node, ω i (x) is a weight function, and the embodiment of the present invention uses a cubic spline function.

[0098] At this point, the interpolation of AASDF is completed, and the directed distance value of any point in AASDF can be obtained.

[0099] In one embodiment, the above step S7: repeating steps S3 to S5 for any two AASDF models to perform Boolean operations from bottom to top, wherein the Boolean operations include: intersection, union, and complement operations, specifically including:

[0100] Step S71: Combine the two AASDF models: and After Boolean operation, the origin x' of the new AASDF model is obtained o =min(x o1 ,x o2 ), and the origin x' o with x g It is aligned;

[0101] Step S72: and The grid spacing Δx1 and Δx2 are divided into the following two cases:

[0102] (1) Δx1 = Δx2: Because the grids of the finest layers of the two AASDF models are aligned, the leaf nodes of the finest layer of the new AASDF model can be directly calculated according to the Boolean operation formula;

[0103] (2) Δx1≠Δx2: The grid spacing of the new AASDF model can be set to Δx1 or Δx2 as required. For the AASDF model whose grid spacing is not selected, its leaf nodes at the finest level are reconstructed. The reconstruction process is the same as step S3, except that the primitives of the axis-aligned bounding box are replaced by voxel cells instead of facets.

[0104] Step S73: Construct the middle nodes and top nodes of the new AASDF model according to steps S4 to S5.

[0105] The Boolean operation of two signed distance fields φ1 and φ2 can theoretically be calculated as follows:

[0106] φ3=φ1|φ2=min(φ1,φ2), union

[0107] φ3=φ1&φ2=max(φ1,φ2), intersection

[0108] φ3=φ1\φ2=φ1&(-φ2), complement

[0109] Because the present invention uses an adaptive storage structure such as a hierarchical sparse octree to store AASDF, the Boolean operation between two AASDFs is not that simple. For the Boolean operation of two AASDFs, the present invention uses a method similar to the construction process to construct a new AASDF from bottom to top. First, Boolean operations are performed on the two AASDFs at the finest layer. When the grid spacing of the two finest layers is the same, the nodes of the finest layer of the new AASDF can be obtained by directly performing Boolean operations according to the formula; when the grid spacing is different, the party that does not meet the requirements will be reconstructed, and then the Boolean operation is performed using the newly constructed nodes. After the nodes of the finest layer of the new AASDF are constructed, the construction process of the nodes of the middle layer and the top layer is exactly the same as before. At this point, the Boolean operation process of the two AASDFs is completed.

[0110] This invention discloses a GPU-based method for constructing AASDFs. This method uses a hierarchical sparse octree structure to construct an algebraic system of AASDFs. The construction process of the invention does not rely on model surface patches, thus enabling efficient Boolean operations between AASDFs. The invention employs an improved bottom-up FIM approach to construct AASDF nodes in parallel on a GPU. The invention employs a bottom-up algorithm to perform Boolean operations on two AASDFs in parallel on a GPU.

[0111] Example 2

[0112] like Figure 6 As shown, an embodiment of the present invention provides a GPU-based AASDF construction system, including the following modules:

[0113] A constraint determination module 81 is used to determine the constraint conditions of the AASDF and the constraint conditions of the hierarchical sparse octree corresponding to the AASDF according to the definition of the AASDF;

[0114] AASDF model definition module 82 is used to define the AASDF model using Eikonal equations according to the definition of AASDF and its constraints;

[0115] A finest layer construction module 83 is used to solve the AASDF model according to the constraints of the hierarchical sparse octree and construct the leaf nodes of the finest layer of the AASDF model;

[0116] A middle layer construction module 84 is used to construct nodes of the middle layer of the AASDF model layer by layer from bottom to top based on leaf nodes;

[0117] A top-level module 85 is constructed to initialize the nodes of the top level of the AASDF model constructed based on the uniform grid based on the nodes of the middle level, and iteratively update the nodes using a standard fast iterative algorithm until the top-level nodes converge and the AASDF model is constructed.

[0118] An interpolation module 86 is used to construct a global neighborhood relationship based on the hierarchical structure of the AASDF model, and then use moving least squares to interpolate based on the neighborhood relationship of the nodes to achieve access to the AASDF;

[0119] The Boolean calculation module 87 is used to repeatedly execute modules 83 to 85 to perform Boolean operations from bottom to top on any two AASDF models, wherein the Boolean operations include intersection, union and complement operations.

[0120] The above embodiments are provided for the purpose of describing the present invention only and are not intended to limit the scope of the present invention. The scope of the present invention is defined by the appended claims. Various equivalent substitutions and modifications made without departing from the spirit and principles of the present invention are intended to be within the scope of the present invention.

Claims

1. A method for constructing AASDF based on GPU, characterized in that: include: Step S1: According to the definition of the algebraic adaptive signed distance field AASDF, determine the constraints of the AASDF and the constraints of the hierarchical sparse octree corresponding to the AASDF; Step S2: Based on the definition of AASDF and its constraints, define the AASDF model using the Eikonal equation; Step S3: solving the AASDF model according to the constraints of the hierarchical sparse octree to construct leaf nodes of the finest layer of the AASDF model; Step S4: Based on the leaf nodes, construct the nodes of the middle layer of the AASDF model layer by layer from bottom to top; Step S5: Initializing the nodes of the top layer of the AASDF model constructed based on the uniform grid based on the nodes of the middle layer, and iteratively updating using a standard fast iterative algorithm until the top layer nodes converge and the AASDF model is constructed; Step S6: Constructing a global neighborhood relationship based on the hierarchical structure of the AASDF model: Allocating a GPU thread to each leaf node of the AASDF, accessing the neighboring nodes of each leaf node at the same level, obtaining the set of leaf nodes adjacent to the current leaf node among all leaf nodes of the neighboring nodes at the same level, thereby obtaining a global neighborhood relationship; then using moving least squares to interpolate based on the neighborhood relationship of the nodes to achieve access to the AASDF; Step S7: Repeat steps S3 to S5 for any two AASDF models to perform Boolean operations from bottom to top, wherein the Boolean operations include intersection, union, and complement operations.

2. The method for constructing an AASDF based on GPU according to claim 1, wherein: The step S1: according to the definition of AASDF, determining the constraints of AASDF and the constraints of the hierarchical sparse octree corresponding to AASDF, specifically including: Step S11: Determine the constraints of AASDF: a) Adaptability: AASDF maintains the sparse data structure by dynamically refining the grid resolution of the domain of interest, that is, using high-resolution grids in the model boundary area and low-resolution grids in the non-boundary area; b) Completeness: Any Boolean operation between any two AASDFs will generate a new AASDF, and the newly generated AASDF satisfies the above adaptability; c) Parallelism: The construction of AASDF and the Boolean operations are both parallelizable; Step S12: Determine the constraints of the hierarchical sparse octree: a) Each of the hierarchical sparse octrees shares a global reference point When constructing AASDF, according to the following formula, Align the boundaries of the region of interest: in, is the starting point of the domain of interest, The grid spacing of the finest layer, is an equation used to calculate floating-point fractions; b) at each layer, sparsity is maintained by creating only nodes in the boundary area, i.e., the hierarchical sparse octree contains only two types of nodes: intermediate nodes and leaf nodes, where the intermediate nodes have 8 child nodes and the leaf nodes have no child nodes; c) The depth of the hierarchical sparse octree is adaptive, that is, only leaf nodes within a preset number are constructed, and when the number of layers of the hierarchical sparse octree is greater than a threshold, a unified uniform grid is automatically created as the top layer.

3. The method for constructing an AASDF based on GPU according to claim 1, wherein: The step S2: defining the AASDF model using the Eikonal equation according to the definition of AASDF and its constraints, specifically includes: In the entire metric space In the AASDF model, : in, Is a closed domain The border, Represents the distance to the boundary; When the boundary is smooth, The gradient satisfies the Eikonal equation: in, is the gradient operator, is the Euclidean norm.

4. The method for constructing an AASDF based on GPU according to claim 1, wherein: The step S3: solving the AASDF model according to the constraints of the hierarchical sparse octree to construct the leaf nodes of the finest layer of the AASDF model, specifically includes: Step S31: Selecting a suitable grid spacing for the finest layer , then construct leaf nodes for the meshes that overlap the axis-aligned bounding boxes of the AASDF model's boundary patches. The indices of the overlapping meshes are calculated using the following formula: in, It is the axis-aligned bounding box of the AASDF model boundary patch, that is, the smallest hexahedron that contains the AASDF model boundary patch and has edges parallel to the coordinate axes. is the vertex at the lower left corner of the axis-aligned bounding box, The vertex for the upper right corner of the axis-aligned bounding box; is the floor function, is the ceiling function, is the remainder function; Step S32: After sorting and removing duplicates, the index is The grids within the range are recorded as leaf nodes.

5. The method for constructing an AASDF based on GPU according to claim 1, wherein: The step S4: constructing the nodes of the middle layer of the AASDF model layer by layer from bottom to top based on the leaf nodes, specifically includes: The current node can be calculated based on the Morton code of its child nodes or the child nodes of its sibling nodes according to the following formula: in, The current node is The Morton code of the intermediate nodes of the layer, It is The Morton code of the intermediate nodes of the layer, is the right shift operator, is the left shift operator, Is located at operator.

6. The method for constructing an AASDF based on GPU according to claim 4, wherein: Step S7: Repeat steps S3 to S5 for any two AASDF models to perform Boolean operations from bottom to top, wherein the Boolean operations include intersection, union, and complement operations, specifically including: Step S71: Combine the two AASDF models: and After performing Boolean operations, the origin of the new AASDF model is obtained , and the origin and It is aligned; Step S72: and Grid spacing and There are two situations: (1) : Because the grids of the finest layers of the two AASDF models are aligned, the leaf nodes of the finest layer of the new AASDF model can be directly calculated according to the Boolean operation formula; (2) :The grid spacing of the new AASDF model can be set as required or , for the AASDF model that does not belong to the selected grid spacing, reconstruct its leaf node at the finest level, and the reconstruction process is consistent with step S3, except that the primitive of the axis-aligned bounding box is replaced from a patch to a voxel unit cell; Step S73: Construct the middle nodes and top nodes of the new AASDF model according to steps S4-S5.

7. A GPU-based AASDF construction system, characterized by: Includes the following modules: A constraint determination module is used to determine the constraint conditions of the AASDF and the constraint conditions of the hierarchical sparse octree corresponding to the AASDF according to the definition of the algebraic adaptive signed distance field AASDF; Define the AASDF model module, which is used to define the AASDF model using the Eikonal equation according to the definition of AASDF and its constraints; Constructing a finest layer module, for solving the AASDF model according to the constraints of the hierarchical sparse octree, and constructing leaf nodes of the finest layer of the AASDF model; Constructing an intermediate layer module, which is used to construct the nodes of the intermediate layer of the AASDF model layer by layer from bottom to top based on the leaf nodes; Constructing a top-level module for initializing the top-level nodes of the AASDF model constructed based on a uniform grid based on the nodes of the middle layer, and iteratively updating using a standard fast iterative algorithm until the top-level nodes converge and the AASDF model is constructed; An interpolation module is used to construct a global neighborhood relationship based on the hierarchical structure of the AASDF model: a GPU thread is assigned to each leaf node of the AASDF, and by accessing the neighboring nodes of each leaf node at the same level, a set of leaf nodes adjacent to the current leaf node is obtained from all leaf nodes of the neighboring nodes at the same level, thereby obtaining a global neighborhood relationship; then, moving least squares is used to interpolate based on the neighborhood relationship of the nodes to achieve access to the AASDF; The Boolean calculation module is used to repeat steps S3 to S5 to perform bottom-up Boolean operations on any two AASDF models, wherein the Boolean operations include intersection, union, and complement operations.

Citation Information

Patent Citations

  • Three-dimensional point cloud reconstruction method based on improved shield poisson algorithm

    CN106780751A

  • Rapid adaptive iteration method for achieving Doppler wave beam sharpening imaging

    CN107402380A