An efficient 3D collision detection method for BIM based on distributed framework
By adopting a hybrid strategy of grid index and 3D R tree index in a distributed framework, the problem of low efficiency in large-scale BIM data storage and query is solved, and efficient three-dimensional collision detection and computing efficiency are improved.
Patent Information
- Application Number
- CN202410538250.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-30
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-04-30
AI Technical Summary
When processing large-scale BIM data, the prior art faces problems such as decreasing index query rate, extended index construction time and reduced computing efficiency, especially in terms of distributed storage and efficient computing queries.
Using a distributed framework-based approach, through the strategies of primary mesh index and secondary 3D R tree index, large-scale BIM raw data sets are partitioned and multiple 3D R tree indexes are constructed, and indexes are constructed using mesh division and parallelization to improve query efficiency.
It realizes efficient storage and organizational management of large-scale BIM data, significantly improves index query rate, reduces index construction time, and improves computing efficiency.
Smart Images

Figure CN118278091B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data index query, and in particular to a BIM efficient three-dimensional collision detection method based on a distributed framework. Background Art
[0002] Building Information Modeling (BIM) is a digital modeling method widely used in the fields of architecture and engineering. BIM takes the three-dimensional digital model as its core and integrates the physical characteristics of the project and a large amount of information, including building structure, materials, cost, schedule, energy efficiency, maintenance requirements, etc. Foreign countries have accumulated rich experience in research results, technical reserves and project practices in BIM collision detection. In "Minimal Hierarchical Collision Detection", collision detection based on boundary volume hierarchy is proposed. Its main feature is that the size of the data structure is very small. At the same time, in most cases, it can still perform collision detection as quickly as other traditional hierarchical algorithms. However, it still faces challenges in providing collision analysis and efficient computational query of large data. There is an urgent need for a high-performance three-dimensional spatial index to efficiently store and query data.
[0003] Currently popular spatial indexes include: 3D R-tree index, quadtree index, KD-tree index, grid index and other types. However, traditional spatial indexes mainly use a single memory index structure for spatial data management. When facing small-scale data, they do perform well. However, once the data scale becomes larger, the query rate will decrease at best. In the process of indexing, due to the excessive amount of data loaded into the memory, the memory will be exhausted before the index is successfully established, the program will crash, and the index building time will be extended. In addition, tree structure indexes such as 3D R-tree index and KD-tree index will change their structure according to the inserted data, which brings great difficulties to the distributed storage of the index and reduces the computing efficiency when querying the index. Summary of the invention
[0004] The technical problem to be solved by the present invention is to realize the storage and organizational management of large-scale BIM data, improve the index query rate, reduce the index construction time, and improve the computing efficiency. In order to overcome the defects of the above-mentioned prior art (or related technology), the present invention provides a BIM efficient three-dimensional collision detection method based on a distributed framework.
[0005] The present invention provides a BIM efficient three-dimensional collision detection method based on a distributed framework, including an index establishment process and a collision query process, wherein the index establishment process comprises the following steps:
[0006] Step S1, reading a BIM data source file to obtain BIM original data sets of multiple BIM entities, storing each of the BIM original data sets in an HBase distributed storage database, and recording the boundaries of each of the BIM original data sets;
[0007] Step S2, dividing the grid index according to pre-configured grid parameters to obtain multiple grids of the same area size;
[0008] Step S3, traversing each of the BIM original data sets, and placing each of the BIM entities into the corresponding grid;
[0009] Step S4, establishing a 3D R-tree index for each of the grids;
[0010] The collision query process includes the following steps:
[0011] Step A1, obtaining a target query range of the grid index and target grid parameters corresponding to the two BIM original data sets that need to be queried for collision, and obtaining first result sets containing grid IDs corresponding to the two BIM original data sets within the target query range based on the target grid parameters;
[0012] Step A2, searching for a 3D R-tree corresponding to each of the grid IDs in the two first result sets, and taking out the BIM original data set stored in the 3D R-tree, to obtain two second result sets containing BIM entities;
[0013] Step A3, traversing the two second result sets to filter the BIM entities that do not match the target query scope;
[0014] Step A4: compare each of the BIM entities in the two second result sets in pairs, and for every two compared BIM entities, extract the BIM original data sets with intersection between the two BIM entities to form a collision pair and add it to the third result set as a collision detection result.
[0015] Compared with the prior art, the BIM efficient three-dimensional collision detection method based on a distributed framework in this application has the following advantages:
[0016] 1. The present invention adopts the strategy of primary grid index and secondary 3D R-tree index, which can partition the large-scale BIM original data set by grids first, and then construct a 3D R-tree index on each grid separately, so as to meet the storage and organization management of large-scale BIM original data sets;
[0017] 2. The present invention adopts a hybrid indexing strategy of grid index and 3D R-tree index, and divides multiple 3D R-tree indexes by grid, thereby reducing the data volume of a single 3D R-tree, so that each 3D R-tree will not affect the query speed due to the particularly large amount of data, thereby greatly improving the index query rate;
[0018] 3. In the present invention, a large-scale BIM original data set is divided into several small-scale data by dividing the large-scale BIM original data set through grids, and a computer cluster is used to perform parallel construction of a 3D R-tree index for each grid, which greatly reduces the time for index construction;
[0019] 4. The collision query process in the present invention adopts distributed framework computing. Based on the grid ID, a 3D R-tree index query is performed on multiple nodes to obtain the corresponding result set. Compared with traditional single-machine computing, it can greatly improve computing efficiency by utilizing the advantages of multiple nodes in a computer cluster.
[0020] In a possible implementation manner, the BIM data source file is an rvt file, and in the step S1, the rvt file is read through Revit API to obtain the BIM original data sets of the plurality of BIM entities.
[0021] In a possible implementation, in step S1, for each of the BIM original data sets, the maximum value and the minimum value of the x-axis, the y-axis, and the z-axis in the BIM original data set are recorded as the boundary of the BIM original data set.
[0022] In a possible implementation, in step S3, the range calculation rule of each BIM entity in the grid index is as follows:
[0023] {(x,y,z)|x_start<=x<=x_end,y_start<=y<=y_end,z_start<=z<=z_end};
[0024] x_start=(int)Math.ceil((double)((x_min-total_XMIN) / X_SIZE));
[0025] y_start=(int)Math.ceil((double)((y_min-total_YMIN) / Y_SIZE));
[0026] z_start=(int)Math.ceil((double)((z_min-total_ZMIN) / Z_SIZE));
[0027] x_end=(int)Math.ceil((double)(x_max-x_min) / X_SIZE)+x_start-1;
[0028] y_end=(int)Math.ceil((double)(y_max-y_min) / Y_SIZE)+y_start-1;
[0029] z_end=(int)Math.ceil((double)(z_max-z_min) / Z_SIZE)+z_start-1;
[0030] in,
[0031] (x, y, z) represents the range of the grid where the BIM entity is located;
[0032] x_start represents the starting point of the BIM entity on the x-axis within the grid index;
[0033] x_end represents the end point of the BIM entity on the x-axis within the grid index;
[0034] y_start represents the starting point of the BIM entity on the y-axis within the grid index;
[0035] y_end represents the end point of the BIM entity on the y-axis within the grid index;
[0036] z_start represents the starting point of the BIM entity on the z-axis within the grid index;
[0037] z_end represents the end point of the BIM entity on the z-axis within the grid index;
[0038] x_min represents the minimum value of the BIM entity on the x-axis;
[0039] x_max represents the maximum value of the BIM entity on the x-axis;
[0040] y_min represents the minimum value of the BIM entity on the y-axis;
[0041] y_max represents the maximum value of the BIM entity on the y-axis;
[0042] z_min represents the minimum value of the BIM entity on the z-axis;
[0043] z_max represents the maximum value of the BIM entity on the z-axis;
[0044] X_SIZE represents the length of a single grid on the x-axis;
[0045] Y_SIZE represents the length of a single grid on the y-axis;
[0046] Z_SIZE represents the length of a single grid on the z-axis;
[0047] total_XMIN represents the minimum value of the BIM original data set on the x-axis;
[0048] total_YMIN represents the minimum value of the BIM original data set on the y-axis;
[0049] total_ZMIN represents the minimum value of the BIM original data set on the z-axis.
[0050] In a possible implementation manner, when establishing a 3DR tree index for each grid in step S4, the step further includes:
[0051] The maximum number of child nodes of each 3D R-tree index and the maximum number of BIM entities of each child node are set.
[0052] Compared with the prior art, the above technical solution can ensure the rationality of the data volume under each 3D R-tree index and child node, and avoid the influence of excessive data volume on computing and processing efficiency.
[0053] In a possible implementation, in step S4, when inserting the 3D R-tree index, starting from the root node, it is determined whether to traverse to a leaf node:
[0054] If yes, insert it;
[0055] If not, then according to the minimum extension metric strategy, a child node with the smallest boundary extension metric after inserting the BIM original data set is selected.
[0056] In a possible implementation manner, the step S4 further includes:
[0057] For each child node in the 3D R-tree index, determine whether the current number of BIM entities of the child node is greater than the maximum number of BIM entities:
[0058] If so, a dimension with the smallest boundary expansion metric after the split is selected according to the minimum expansion metric strategy, and the excess child nodes are equally divided into multiple parts under the dimension;
[0059] If not, exit.
[0060] Compared with the prior art, the above technical solution can evenly divide the sub-nodes when the current number of BIM entities in the sub-nodes is overloaded, thereby reducing the data volume pressure of the sub-nodes.
[0061] In a possible implementation, in step S4, the number of shares into which the excess sub-nodes under the dimension are equally divided is the same as the maximum number of child nodes. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 A flowchart of the steps of the index building process of the present invention;
[0063] Figure 2 A flowchart of the steps of the collision query process of the present invention;
[0064] Figure 3 It is a schematic diagram of the structure of the grid index and the 3D R-tree index of the present invention;
[0065] Figure 4 Schematic diagram of the distribution of the BIM original data set of the present invention;
[0066] Figure 5 A demonstration diagram of establishing a grid-3D R-tree hybrid index of the present invention;
[0067] Figure 6 It is a schematic diagram of the distributed framework structure of the present invention. DETAILED DESCRIPTION
[0068] First, those skilled in the art should understand that these implementations are only used to explain the technical principles of the embodiments of the present application, and are not intended to limit the protection scope of the embodiments of the present application. Those skilled in the art can make adjustments to them as needed to adapt to specific application scenarios.
[0069] The present application is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0070] See also Figure 1 The present application embodiment discloses a BIM efficient three-dimensional collision detection method based on a distributed framework, including an index establishment process, such as Figure 1 The following shows the index creation process, where the index creation method is:
[0071] 1. Read the rvt file through RevitAPI to obtain the BIM original data set of all BIM entities including the original data of the aabb package, store the BIM original data set in HBase, and record the boundaries of the entire BIM original data set (the maximum and minimum values on the x-axis, y-axis, and z-axis in the entire BIM original data set);
[0072] 2. Determine the parameters of the grid, such as how many grids are divided into the x-axis, y-axis, and z-axis, respectively, to obtain the size of the grid under the entire network index (X_SIZE, Y_SIZE, Z_SIZE);
[0073] 3. Traverse the BIM original data set and put each BIM entity into the corresponding grid. The calculation rules for the starting point of the BIM entity on the x-axis, y-axis, and z-axis are as follows:
[0074] {(x,y,z)|x_start<=x<=x_end,y_start<=y<=y_end,z_start<=z<=z_end};
[0075] x_start=(int)Math.ceil((double)((x_min-total_XMIN) / X_SIZE));
[0076] y_start=(int)Math.ceil((double)((y_min-total_YMIN) / Y_SIZE));
[0077] z_start=(int)Math.ceil((double)((z_min-total_ZMIN) / Z_SIZE));
[0078] x_end=(int)Math.ceil((double)(x_max-x_min) / X_SIZE)+x_start-1;
[0079] y_end=(int)Math.ceil((double)(y_max-y_min) / Y_SIZE)+y_start-1;
[0080] z_end=(int)Math.ceil((double)(z_max-z_min) / Z_SIZE)+z_start-1;
[0081] Among them, x_min, x_max, y_min, y_max, z_min, z_max are the aabb package parameters of the BIM entity;
[0082] 4. Create a 3D R-tree index for each grid, initialize the 3D R-tree index, set the maximum number of child nodes to SPILT_NUM, and the maximum number of BIM entities per child node to MAX_ENTRIES;
[0083] 5. When inserting into a 3D R-tree index, start from the root node. If the traversal reaches a leaf node, insert it directly. Otherwise, follow the minimum expansion metric strategy and select the node with the smallest bounding box expansion metric of the child node after inserting the data item.
[0084] 6. If the number of BIMs of the current node exceeds MAX_ENTRIES, the minimum expansion metric strategy is still used to select a dimension with the smallest boundary expansion metric after splitting, and the excess child nodes are divided into SPILT_NUM parts.
[0085] See also Figure 3 , Figure 3 This is a structural diagram of the first-level grid index and the second-level 3D R-tree index. The grid index contains different grid areas distinguished by x-axis values, y-axis values, and z-axis values, while the 3D R-tree index presents a multi-dimensional structure extending from R1 to R2, R3, and R4. Different BIM entity data are stored under R2, R3, and R4. The combination of the two can meet the storage and organizational management of large-scale BIM entity data sets.
[0086] See also Figure 4 and Figure 5 , Figure 4 This is a schematic diagram of the BIM original data set. Figure 5 This is a demonstration diagram for the establishment of a grid-3D R-tree hybrid index. Figure 5 In (a), the original BIM data set is meshed, and the (1,0,0) grid is selected to show the establishment of the 3D R-tree. Figure 5 In (b), R1 is the root node of the entire 3D R-tree, and it has three child nodes, namely R2, R3, and R4. There are three BIM entities in R2, two BIM entities in R3, and four BIM entities in R4. The maximum number of BIM entities that can be accommodated in each child node is Max_Entries, which is 4. If the maximum number of BIM entities that can be accommodated is Max_Entries is 3 and the maximum number of byte points Split_Num is 2, R4 will be divided into two leaf nodes, and the four BIM entities in R4 will be evenly divided into the two leaf nodes.
[0087] See also Figure 2 The embodiment of the present application discloses a BIM efficient three-dimensional collision detection method based on a distributed framework, which includes a collision query process in addition to the index establishment process, such as Figure 2 The following is a collision query process, where the collision query method is:
[0088] 1. Get the target query range, usually an aabb package like (x_min, x_max, y_min, y_max, z_min, z_max);
[0089] 2. Query the target grid parameters (X_SIZE, Y_SIZE, Z_SIZE) of the two colliding data sets as needed, and calculate all the grid IDs contained in the query target query range. The calculation formula is as follows:
[0090] x_start=(int)Math.ceil((double)((x_min-total_XMIN) / X_SIZE));
[0091] y_start=(int)Math.ceil((double)((y_min-total_YMIN) / Y_SIZE));
[0092] z_start=(int)Math.ceil((double)((z_min-total_ZMIN) / Z_SIZE));
[0093] x_end=(int)Math.ceil((double)(x_max-x_min) / X_SIZE)+x_start-1;
[0094] y_end=(int)Math.ceil((double)(y_max-y_min) / Y_SIZE)+y_start-1;
[0095] z_end=(int)Math.ceil((double)(z_max-z_min) / Z_SIZE)+z_start-1;
[0096] {(x,y,z)|x_start<=x<=x_end,y_start<=y<=y_end,z_start<=z<=z_end};
[0097] According to the above formula, two first result sets R1 and R1' containing grid IDs can be obtained;
[0098] 3. According to the two first result sets R1 and R1' found, find the 3D R-tree corresponding to each grid ID, take out the BIM entity stored in the 3D R-tree, and obtain two second result sets R2 and R2' containing BIM entities;
[0099] 4. Further traverse the second result set R2, R2', and filter out the BIM entities that do not intersect with the target query range;
[0100] 5. Compare each BIM entity in the second result set R2, R2' in pairs, extract the data with intersection in the aabb packages of the two BIM entities to form a collision pair, and add it to the third result set R3. The third result set R3 finally obtained is the collision query result.
[0101] See also Figure 6 , Figure 6 This is a schematic diagram of the structure of the distributed framework based on the collision query process, such as Figure 6 As shown in , after a query range is given, the grid range is calculated, and the grid ID is added to the query grid ID queue. The grid ID is queried in the main node, and then the 3D R-tree query algorithm is implemented under the corresponding node according to different grid IDs to obtain the corresponding BIM result set, which is then integrated to obtain the BIM query result set.
[0102] In the description of the present application, the description with reference to the terms "one embodiment", "some embodiments", "in the present embodiment", "specific example", or "some examples" etc. means that the specific features, mechanisms, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, mechanisms, materials or characteristics described may be combined in a suitable manner in any one or more embodiments or examples. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0103] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A BIM efficient three-dimensional collision detection method based on a distributed framework, characterized in that: The process includes an index creation process and a collision query process. The index creation process includes the following steps: Step S1, reading a BIM data source file to obtain BIM original data sets of multiple BIM entities, storing each of the BIM original data sets in an HBase distributed storage database, and recording the boundaries of each of the BIM original data sets; Step S2, dividing the grid index according to pre-configured grid parameters to obtain multiple grids of the same area size; Step S3, traversing each of the BIM original data sets, and placing each of the BIM entities into the corresponding grid; Step S4, establishing a 3D R-tree index for each of the grids; The collision query process includes the following steps: Step A1, obtaining a target query range of the grid index and target grid parameters corresponding to the two BIM original data sets that need to be queried for collision, and obtaining first result sets containing grid IDs corresponding to the two BIM original data sets within the target query range based on the target grid parameters; Step A2, searching for a 3D R-tree corresponding to each of the grid IDs in the two first result sets, and taking out the BIM original data set stored in the 3D R-tree, to obtain two second result sets containing BIM entities; Step A3, traversing the two second result sets to filter the BIM entities that do not match the target query scope; Step A4, comparing each of the BIM entities in the two second result sets in pairs, and for each two of the compared BIM entities, extracting the BIM original data sets with intersections between the two BIM entities to form collision pairs and adding them to the third result set as collision detection results; In step S3, the range calculation rule of each BIM entity in the grid index is as follows: {(x, y, z)|x_start<=x<=x_end, y_start<=y<=y_end, z_start<=z<=z_end}; x_start=(int)Math.ceil((double)((x_min-total_XMIN) / X_SIZE)); y_start=(int)Math.ceil((double)((y_min-total_YMIN) / Y_SIZE)); z_start=(int)Math.ceil((double)((z_min-total_ZMIN) / Z_SIZE)); x_end=(int)Math.ceil((double)(x_max-x_min) / X_SIZE)+x_start-1; y_end=(int)Math.ceil((double)(y_ max-y_min) / Y_SIZE)+y_start-1; z_end=(int)Math.ceil((double)(z_max-z_min) / Z_SIZE)+z_start-1; where, (x, y, z) represents the range of the grid where the BIM entity is located; x_start represents the starting point of the BIM entity on the x-axis within the grid index; x_end represents the end point of the BIM entity on the x-axis within the grid index; y_start represents the starting point of the BIM entity on the y-axis within the grid index; y_end represents the end point of the BIM entity on the y-axis within the grid index; z_start represents the starting point of the BIM entity on the z-axis within the grid index; z_end represents the end point of the BIM entity on the z-axis within the grid index; x_min represents the minimum value of the BIM entity on the x-axis; x_max represents the maximum value of the BIM entity on the x-axis; y_min represents the minimum value of the BIM entity on the y-axis; y_max represents the maximum value of the BIM entity on the y-axis; z_min represents the minimum value of the BIM entity on the z-axis; z_max represents the maximum value of the BIM entity on the z-axis; X_SIZE represents the length of a single grid on the x-axis; Y_SIZE represents the length of a single grid on the y-axis; Z_SIZE represents the length of a single grid on the z-axis; total_XMIN represents the minimum value of the BIM original data set on the x-axis; total_YMIN represents the minimum value of the BIM original data set on the y-axis; total_ZMIN represents the minimum value of the BIM original data set on the z-axis.
2. The BIM efficient three-dimensional collision detection method according to claim 1 is characterized in that: The BIM data source file is an rvt file, then in the step S1, the rvt file is read through Revit API to obtain the BIM original data sets of the multiple BIM entities.
3. The BIM efficient three-dimensional collision detection method according to claim 1 is characterized in that: In the step S1, for each of the BIM original data sets, the maximum value and the minimum value of the x-axis, the y-axis, and the z-axis in the BIM original data set are recorded as the boundary of the BIM original data set.
4. The BIM efficient three-dimensional collision detection method according to claim 1 is characterized in that: When the step S4 creates a 3D R-tree index for each of the grids, it also includes: The maximum number of child nodes of each 3D R-tree index and the maximum number of BIM entities of each child node are set.
5. The BIM efficient three-dimensional collision detection method according to claim 4 is characterized in that: In step S4, when inserting the 3D R-tree index, starting from the root node, determining whether to traverse to a leaf node: if so, inserting; If not, then according to the minimum extension metric strategy, a child node with the smallest boundary extension metric after inserting the BIM original data set is selected.
6. The BIM efficient three-dimensional collision detection method according to claim 4 is characterized in that: The step S4 further includes: For each child node in the 3D R-tree index, determine whether the current number of BIM entities of the child node is greater than the maximum number of BIM entities: If so, a dimension with the smallest boundary expansion metric after the split is selected according to the minimum expansion metric strategy, and the excess child nodes are equally divided into multiple parts under the dimension; If not, exit.
7. The BIM efficient three-dimensional collision detection method according to claim 6 is characterized in that: In the step S4, the number of shares into which the excess child nodes under the dimension are equally divided is the same as the maximum number of child nodes.
Citation Information
Patent Citations
Multi-type collision detection method and system of BIM lightweight model
CN116305386A