Method and device for converting BIM data into 3D tiles data, medium and equipment
By using octree indexing and pruning technology during BIM data to 3Dtiles data conversion, the problem of slow loading and rendering speed during BIM data conversion is solved, and efficient data conversion and query is achieved.
Patent Information
- Application Number
- CN202311656408.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-05
- Publication Date
- 2024-12-13
AI Technical Summary
BIM data is slow to load and render when converted to 3Dtiles data, and optimization strategies are required.
The Octet index data structure is adopted to build a standard Octet tree and prune and adjust it. The node range is adjusted based on the bounding box range of the BIM model, and the data is exported as a B3DM model and converted into 3DTiles data with hierarchical structure.
It effectively improves the loading and rendering speed of BIM data to 3Dtiles data conversion process, reduces the number and complexity of nodes through reasonable grading and simplification strategies, and improves query and traversal efficiency.
Smart Images

Figure CN119131229A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of engineering data processing, and in particular to a method, device, medium and equipment for converting BIM data into 3D tiles data. Background Art
[0002] The demand for the combination of Building Information Modeling (BIM) and Geographic Information System (GIS) is becoming increasingly urgent. BIM+GIS integration will become the development direction of multi-dimensional and multi-granularity spatial research.
[0003] The integrated application of BIM and GIS is achieved through data integration, system integration or application integration. If BIM data is to be integrated into the GIS environment, it is necessary to convert the BIM data into a data format that can be recognized by GIS, that is, it is necessary to convert the BIM data into 3D Tiles data supported by the GIS development platform. However, since the BIM data format is generally large, the efficiency of loading and rendering will become extremely slow, so a reasonable optimization strategy needs to be adopted in the conversion process. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, medium and equipment for converting BIM data to 3D tiles data to solve the problem of slow loading and rendering speed during the conversion process of BIM data to 3D tiles data.
[0005] A method for converting BIM data to 3D tiles data, the method comprising:
[0006] Setting a data structure of an octree index, and constructing a standard octree corresponding to the BIM model based on the data structure;
[0007] The standard octree is pruned and adjusted based on the categories of the child nodes in the standard octree, and the bounding box range of the nodes in the standard octree is loosely adjusted based on the bounding box range of the components in the BIM model to obtain the target octree;
[0008] cyclically exporting the data of each level in the target octree into a B3dm model according to the data structure of the spatial index;
[0009] The comprehensive octree data converts the B3DM model into 3DTiles data with a hierarchical structure.
[0010] In one embodiment, constructing a standard octree corresponding to the BIM model based on the data structure includes:
[0011] Acquire the overall spatial range of the BIM model, and create a bounding box that satisfies the overall spatial range as the current bounding box to be split;
[0012] Constructing a root node of a standard octree, and determining a target recursive depth of the standard octree based on a preset splitting accuracy and the overall spatial range;
[0013] Sequentially place the BIM model into the current bounding box to be split that can be contained and has no child nodes;
[0014] If the current recursion depth of the standard octree does not reach the target recursion depth, the current bounding box to be split is equally split into eight parts to obtain eight corresponding sub-bounding boxes, and the BIM model contained in the bounding box to be split before the split is shared among the corresponding eight sub-bounding boxes, and the child nodes corresponding to the split sub-bounding boxes are constructed in the standard octree;
[0015] Take each child bounding box as the current bounding box to be split, return to execute the step of sequentially placing the BIM model into the current bounding box to be split that can be contained and has no child nodes and subsequent steps, until the current recursion depth of the standard octree reaches the target recursion depth, and the constructed standard octree is obtained.
[0016] In one embodiment, constructing a standard octree corresponding to the BIM model based on the data structure further includes:
[0017] Construct the node name of each node in the standard octree based on the name of the BIM model, the node level and the spatial index of the bounding box represented by the node;
[0018] Determine storage path rules for node data and intermediate format data, and determine a target storage path for BIM data at each level based on the storage path rules.
[0019] In one embodiment, the pruning and adjusting of the standard octree based on the category of the child nodes in the standard octree includes:
[0020] When all child nodes under a target parent node in a standard octree belong to the same category, the target parent node is retained, and all child nodes under the target parent node are pruned; wherein the target parent node is any parent node in the standard octree, and the categories of child nodes include gray nodes, white nodes, and black nodes, the gray nodes indicate that the corresponding bounding box is partially occupied by the BIM model, the white nodes indicate that the corresponding bounding box is not occupied by the BIM model, and the black nodes indicate that the corresponding bounding box is fully occupied by the BIM model.
[0021] In one embodiment, the loosely adjusting the bounding box range of the node in the standard octree based on the bounding box range of the component in the BIM model includes:
[0022] Calculate the node bounding box range of the child node corresponding to the parent node according to the node bounding box coordinates of all parent nodes in the standard octree;
[0023] Get the bounding box range of each component in the BIM model;
[0024] Compare the component bounding box range of the target component with the node bounding box range of the target node. If the component bounding box range is within the node bounding box range, update the node bounding box range of the target node to the component bounding box range of the target component; wherein the target component is any component in the BIM model, and the component bounding box range of the target component overlaps with the node bounding box range of the target node;
[0025] If the component bounding box range is outside the node bounding box range, all node bounding box ranges overlapped by the component bounding box range are obtained, and all overlapping node bounding box ranges are merged and updated as the component bounding box range of the target component.
[0026] In one embodiment, the cyclically converting the data of each level in the target octree into 3D tiles data according to the spatial index data structure includes:
[0027] The geometric information of each level in the target octree is read cyclically, and the geometric information is converted into the coordinate form of the Gltf model, and the content of the Position part in the Gltf model is constructed;
[0028] Circularly reading and storing the attribute information of each level in the target octree;
[0029] Circularly read the rendering style information of each level in the target octree, convert the rendering style information into the form of a Gltf model, and construct the content of the material part in the Gltf model;
[0030] Convert the Gltf model into the Glb model through binary conversion;
[0031] The Glb model was converted into a B3dm model by recoding.
[0032] In one embodiment, the integrated octree data converts the B3DM model into 3DTiles data with a hierarchical structure, including:
[0033] Starting from the root node, recursively record the geometric error, bounding box range, content, and URL of each node.
[0034] A device for converting BIM data to 3D tiles data, the device comprising:
[0035] A standard octree construction module, used to set the data structure of the octree index and to construct a standard octree corresponding to the BIM model based on the data structure;
[0036] A hierarchical simplification module is used to prune and adjust the standard octree based on the categories of the child nodes in the standard octree, and to loosely adjust the bounding box range of the nodes in the standard octree based on the bounding box range of the components in the BIM model to obtain a target octree;
[0037] An export module, used for cyclically exporting the data of each level in the target octree into a B3dm model according to the data structure of the spatial index;
[0038] The conversion module is used to integrate the octree data to convert the B3DM model into 3DTiles data with a hierarchical structure.
[0039] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the processor executes the steps of the above-mentioned method for converting BIM data to 3D tiles data.
[0040] A device for converting BIM data to 3D tiles data includes a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above-mentioned method for converting BIM data to 3D tiles data.
[0041] The present invention provides a method, device, medium and equipment for converting BIM data to 3Dtiles data. First, the data structure of the octree index is set, and a standard octree corresponding to the BIM model is constructed based on the data structure; then the standard octree is pruned and adjusted based on the category of the child nodes in the standard octree, and the bounding box range of the nodes in the standard octree is loosely adjusted based on the bounding box range of the components in the BIM model to obtain a target octree; the data of each level in the target octree is cyclically exported as a B3DM model according to the data structure of the spatial index; finally, the octree data is integrated to convert the B3DM model into 3Dtiles data with a hierarchical structure. The present invention adopts a reasonable classification and simplification strategy in the conversion process, which effectively solves the problem of slow loading and rendering speed in the conversion process of BIM data to 3Dtiles data. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] in:
[0044] Figure 1 It is a flowchart of the method for converting BIM data to 3D tiles data;
[0045] Figure 2 is a schematic diagram of a bounding box and an octree in one embodiment;
[0046] Figure 3 This is a schematic diagram of the format of the Gltf model;
[0047] Figure 4 This is a schematic diagram of the format of the tileset.json configuration file;
[0048] Figure 5 It is a structural schematic diagram of a device for converting BIM data into 3D tiles data;
[0049] Figure 6 The structural block diagram of the device for converting BIM data to 3D tiles data. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] The terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally includes steps or units that are not listed, or optionally includes other steps or units inherent to these processes, methods, products or devices.
[0052] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0053] like Figure 1 As shown, Figure 1 1 is a flow chart of a method for converting BIM data to 3D tiles data in one embodiment. The method for converting BIM data to 3D tiles data in this embodiment includes the following steps:
[0054] S101, setting the data structure of the octree index, and constructing a standard octree corresponding to the BIM model based on the data structure.
[0055] Specifically, when setting the data structure of the octree index, you first need to set the bounding box data class Bbox. The bounding box is a cube or rectangular box used to enclose an object, scene or other geometric body.
[0056] In this embodiment, the following attribute information in the bounding box is specifically set:
[0057] (1) Boundary information of the bounding box, including the length range [Xmin, Xmax], width range [Ymin, Ymax], and height range [Zmin, Zmax].
[0058] (2) Some method functions used to calculate the relationship between the bounding box and the component, including a method function to determine whether a certain coordinate is within the bounding box, a method function to determine whether a bounding box is contained in the current bounding box, a method function to determine whether a bounding box overlaps with the current bounding box, a method function to merge the maximum range of two bounding boxes, etc.
[0059] Next, we need to set the data class Node of the node in the octree. The node is the basic element used to organize and describe the tree structure. Usually, a node contains 8 child nodes, which corresponds to the origin of the name of the octree. Each child node represents one eighth of the subspace represented by the parent node.
[0060] In this embodiment, the following attribute information of the node is specifically set:
[0061] (1) The geometric error value of the node, geometricError, is a floating point data type. It contains the default bounding box _box, the judgment threshold metric, and the subnode data subnode.
[0062] (2) Some method functions that describe nodes, such as setting the name code of the current node set_no, splitting the child node split method function, adding the component to the current node add method function, getting the component code of the current node get_ids method function, etc.
[0063] In the octree index, the definition and implementation of Bbox and Node enable us to effectively organize and represent data in three-dimensional space and implement efficient spatial query, visualization, clipping and other operations.
[0064] Furthermore, in a specific embodiment, a standard octree corresponding to the BIM model is constructed through the following steps:
[0065] (1) Obtain the overall spatial range of the BIM model and create a bounding box that satisfies the overall spatial range as the current bounding box to be split.
[0066] For example, taking the BIM model of the Beihang Building as an example, after determining the overall spatial range of its length, width and height, a bounding box that meets the overall spatial range can be created. The size of the bounding box is: length range [-147057, 153647], width range [-129244, 130952], height range [-1701, 48801], in millimeters. Figure 2 As shown, that is, corresponding to Figure 2 The largest rectangle on the left.
[0067] (2) Construct the root node of the standard octree and determine the target recursive depth of the standard octree based on the preset splitting accuracy and the overall spatial range.
[0068] The root node is the topmost node in the octree, which is the starting point of the entire tree. The root node of the octree represents the bounding box of the entire space or scene. Figure 2 As shown, that is, corresponding to Figure 2 The vertex of the split tree on the right.
[0069] In the octree, the split is based on the length, width and height divided by 2 respectively, that is, the length, width and height of the bounding box represented by the node of the next level are half of the length, width and height of the bounding box represented by the node of the previous level. Therefore, the bounding box represented by each split child node is 1 / 8 the size of the bounding box represented by its parent node.
[0070] When determining the target recursive depth, optionally, the longest side can be selected from the x-direction, y-direction, and z-direction of the model, and then divided equally according to the above classification method until the preset splitting accuracy is reached to obtain the target recursive depth. For example, in the BIM model of the Beihang Building, the side in the x-direction (corresponding to the length range [-147057, 153647]) is the longest side, and its overall length is about 300 meters. Assuming that the preset splitting accuracy is 37 meters, the target recursive depth can be determined to be 4 after equal division.
[0071] (3) Place the BIM models into the current bounding box to be split that can be contained and has no child nodes.
[0072] (4) If the current recursion depth of the standard octree does not reach the target recursion depth, the current bounding box to be split is split into eight equal parts to obtain eight corresponding sub-bounding boxes, and the BIM model contained in the bounding box to be split before the split is shared among the corresponding eight sub-bounding boxes, and the child nodes corresponding to the split sub-bounding boxes are constructed in the standard octree.
[0073] For example, before the first split, since the current recursion depth is equal to or less than the target recursion depth 4, the eight equal splits are performed as shown on the left side of X, and a total of eight corresponding sub-bounding boxes are obtained, among which the spatial index of the lower left sub-bounding box is recorded as 0_0_0, and the spatial index of the sub-bounding box adjacent to the X axis is recorded as 1_0_0, the spatial index of the sub-bounding box adjacent to the Y axis is recorded as 0_1_0, and the spatial index of the sub-bounding box adjacent to the Z axis is recorded as 0_0_1. Figure 2 The second level of child nodes is constructed in the standard octree on the right.
[0074] (5) Take each sub-bounding box as the current bounding box to be split, return to execute step (3) and subsequent steps, until the current recursion depth of the standard octree reaches the target recursion depth, and obtain the constructed standard octree.
[0075] That is, iterate steps (3) and (4) until the conditions for stopping iteration are met. Through such a splitting and recursive process, the standard octree can organize and index the BIM model according to the positional relationship, thereby achieving efficient query and operation.
[0076] Furthermore, each node needs to be named according to the specified rules and stored in the specified path. The naming can refer to the following rules: the node name of each node in the standard octree is constructed based on the name of the BIM model, the node level and the spatial index of the bounding box represented by the node.
[0077] For example, the naming rules of the eight sub-nodes of the first level of the Beihang Building are:
[0078] bh_xzl.ifc.1_0_0_0.b3dm,
[0079] bh_xzl.ifc.1_0_0_1.b3dm,
[0080] bh_xzl.ifc.1_0_1_0.b3dm,
[0081] bh_xzl.ifc.1_0_1_1.b3dm,
[0082] bh_xzl.ifc.1_1_0_0.b3dm,
[0083] bh_xzl.ifc.1_1_0_1.b3dm,
[0084] bh_xzl.ifc.1_1_1_0.b3dm,
[0085] bh_xzl.ifc.1_1_1_1.b3dm.
[0086] The naming method of nodes at other levels is similar and will not be elaborated here.
[0087] Furthermore, considering that some intermediate format data, such as gltf files, will be exported during the creation of the spatial index, they also need to be stored in the specified format for the convenience of recording. Therefore, the following steps are performed: determine the storage path rules for node data and intermediate format data, and determine the target storage path of BIM data at each level based on the storage path rules.
[0088] For example, the storage path rule is determined as follows: each level uses its space threshold as a folder name, and all intermediate format files and final files of the level are stored under the path.
[0089] Correspondingly, for the first level with a length range of [-147057, 153647], its space threshold is 300704, and the target storage path corresponding to this level and the data stored therein are set as follows:
[0090]
[0091]
[0092] S102, pruning and adjusting the standard octree based on the categories of the child nodes in the standard octree, and loosely adjusting the bounding box range of the nodes in the standard octree based on the bounding box range of the components in the BIM model, so as to obtain a target octree.
[0093] In this step, pruning and adjustment can reduce the number and complexity of nodes in the octree, and improve the efficiency of querying and traversing the octree.
[0094] In a specific implementation, pruning and adjustment are performed through the following steps: when all child nodes under a target parent node in a standard octree belong to the same category, the target parent node is retained, and all child nodes under the target parent node are pruned.
[0095] Among them, the target parent node is any parent node in the standard octree, and the categories of child nodes include gray nodes, white nodes and black nodes. The gray node indicates that the corresponding bounding box is partially occupied by the BIM model, the white node indicates that the corresponding bounding box is not occupied by the BIM model, and the black node indicates that the corresponding bounding box is fully occupied by the BIM model.
[0096] For example, in a certain level of the standard octree, there is a parent node P, which has eight child nodes A, B, C, D, E, F, G, and H. If these eight child nodes are all gray nodes, it means that the bounding box corresponding to each child node is only partially occupied by the BIM model, but not completely occupied (i.e., partially covered). In this case, pruning can be performed, that is, deleting these child nodes and retaining the parent node P.
[0097] After pruning, the bounding box represented by the parent node P is still partially occupied by the BIM model, but it is no longer necessary to record the information of the child nodes. It should be noted that the pruning operation is only performed when all the child nodes of the parent node belong to the same category (gray nodes). If the child nodes contain nodes of different categories (such as white nodes or black nodes), pruning cannot be performed because these nodes of different categories still provide important spatial information and divisions. Because there is no need to further access the pruned child nodes during the search or operation process, this reduces the number and complexity of the nodes in the octree, and also improves the efficiency of querying and traversing the octree.
[0098] In this step, loose adjustment can prevent the parts from being cut by the bounding box, thereby better performing spatial analysis.
[0099] In a specific implementation, loose adjustment is performed through the following steps:
[0100] (1) Calculate the node bounding box range of the child node corresponding to the parent node based on the node bounding box coordinates of all parent nodes in the standard octree.
[0101] Exemplarily, the node bounding box coordinates of a parent node are [ΔX, ΔY, ΔZ], where:
[0102] ΔX=(BoundX max -BoundXmin ) / 2
[0103] ΔY=(BoundY max -BoundY min ) / 2
[0104] ΔZ=(BoundZ max -BoundZ min ) / 2
[0105] Then, the bounding box range of its first child node is:
[0106] Bound l_0_0_0 =[BoundX min , ΔX, BoundY min , ΔY, BoundZ min , ΔZ]
[0107] The bounding box range of the second child node:
[0108] Bound l_1_0_0 =[ΔX,BoundX max , BoundY min , ΔY, BoundZ min , ΔZ]
[0109] The bounding box range of the third child node:
[0110] Bound l_1_1_0 =[ΔX,BoundX max , ΔY, BoundY max , BoundZ min , ΔZ]
[0111] The bounding box range of the fourth child node:
[0112] Bound l_0_1_0 =[BoundX min , ΔX, ΔY, BoundY max , BoundZ min , ΔZ]
[0113] The bounding box range of the fifth child node:
[0114] Bound l_0_0_1 =[BoundX min , ΔX, BoundY min , ΔY, ΔZ, BoundZ max ]
[0115] The bounding box range of the sixth child node:
[0116] Bound l_1_0_1 =[ΔX,BoundX max , BoundY min , ΔY, ΔZ, BoundZ max ]
[0117] The bounding box range of the seventh child node:
[0118] Bound l_1_1_1 =[ΔX,BoundX max , ΔY, BoundY max , ΔZ, BoundZ max ]
[0119] The bounding box range of the eighth child node:
[0120] Bound l_0_1_1 =[BoundX min , ΔX, ΔY, BoundY max , ΔZ, BoundZ max ]
[0121] (2) Obtain the bounding box range of each component in the BIM model.
[0122] Optionally, the bounding box of the component is recorded as bound.
[0123] (3) Compare the component bounding box range of the target component with the node bounding box range of the target node. If the component bounding box range is within the node bounding box range, update the node bounding box range of the target node to the component bounding box range of the target component.
[0124] The target component is any component in the BIM model, that is, the same operation is performed on all components, and the component bounding box range of the target component overlaps with the node bounding box range of the target node.
[0125] For example, if the target component overlaps with the bounding box of the first child node, the bounding box of the target component is bounded and the bounding box range of the first child node is Bound. l_0_0_0 Compare, if the former is within the range of the latter, use Bound l_0_0_0 Update bound and record it as Bound l_0_0_0 ′.
[0126] (4) If the component bounding box range is outside the node bounding box range, all node bounding box ranges overlapped by the component bounding box range are obtained, and all overlapping node bounding box ranges are merged and updated as the component bounding box range of the target component.
[0127] For example, if the target component overlaps with the bounding box of the first child node, the bounding box of the target component is bounded and the bounding box range of the first child node is Bound. l_0_0_0 Compare, if the former exceeds the latter, at the same time can get all the node bounding box ranges overlapped by the component bounding box range including Bound l_0_0_0 and Bound l_1_0_0 , then merge Bound l_0_0_0 and Bound l_1_0_0 , and updated to the bounding box range of the target component, which is also recorded as Bound after update l_0_0_0 ′.
[0128] Through this comparison, merging and updating process, the node bounding box range can be dynamically adjusted in the BIM model to reflect the position and size changes of the components, thereby preventing the components from being cut by the bounding box and better performing spatial analysis.
[0129] S103, cyclically exporting the data of each level in the target octree into a B3dm model according to the data structure of the spatial index.
[0130] This step involves the method of deriving the B3dm model from the target octree. In a specific embodiment, the step of deriving includes:
[0131] (1) Loop through the geometric information of each level in the target octree, convert the geometric information into the coordinate form of the Gltf model, and construct the content of the Position part in the Gltf model;
[0132] Each octree node can contain geometric information, such as triangular meshes, point clouds, etc. In this step, it is necessary to traverse each level of the octree according to a certain algorithm, read the geometric information, and convert the geometric information into the coordinate form of the Gltf model. Gltf is an open standard format for representing three-dimensional graphics. Figure 3 As shown, it can contain geometry, material, texture, animation and other information. In the Gltf model, the geometry information is contained in the vertex array, and the position information of these vertices is the "Position part". Usually, the construction of the Position part in the Gltf model includes the following steps: vertex data extraction, coordinate system conversion, data format processing and vertex index processing.
[0133] (2) cyclically read and store the attribute information of each level in the target octree;
[0134] Among them, attribute information such as texture coordinates and normals, etc. In this step, it is necessary to loop through the attribute information of each level and store it to prepare for B3dm generation.
[0135] (3) Circularly read the rendering style information of each level in the target octree, convert the rendering style information into the form of a Gltf model, and construct the content of the material part in the Gltf model;
[0136] The rendering style information includes information related to the visual effects of the object, such as color, texture, transparency, etc. In this step, it is necessary to read the rendering style information of each level in the octree and convert it into the form of a Gltf model, and then construct the material part of the Gltf model to associate the rendering style information with the geometric information.
[0137] (4) Convert the Gltf model into the Glb model through binary conversion;
[0138] Among them, Glb is the binary version of Gltf. Converting the Gltf model to the Glb model can effectively reduce the file size and loading time. In this step, the Glb model is generated by merging the JSON part of the Gltf model with the binary data and using binary encoding.
[0139] (5) Convert the Glb model into the B3dm model by recoding.
[0140] B3dm is a 3D tile model based on the Gltf format, which is used for efficient visualization and interaction in 3D maps. In this step, the generated Glb model needs to be re-encoded into the B3dm format, and necessary metadata, such as the location and bounding volume of the model, are added so that it can be correctly displayed and positioned when using the B3dm model.
[0141] S104, integrating the octree data to convert the B3DM model into 3DTiles data with a hierarchical structure.
[0142] In a specific embodiment, the conversion method is: starting from the root node, recursively record the geometric error geometricError, bounding volume bounding volume, content content and content url of each node.
[0143] In this step, we describe how to construct a collection of child nodes of a root node. Each child node is a tile in a hierarchical 3DTiles data, which may contain its own B3DM model content as well as child nodes. The detailed information of each child node includes:
[0144] Bounding Volume: used to optimize operations such as culling and collision detection.
[0145] Geometric Error: used to control when to load and display the tile, and to achieve dynamic detail loading.
[0146] Content: The URL address pointing to the B3DM model corresponding to the child node.
[0147] URL of content: Get the B3DM model of the child node.
[0148] If the child node still has grandchild nodes, the detailed information of the grandchild nodes is recursively recorded, including the bounding box, geometric error, content URL, etc. of the grandchild nodes. Finally, it is recorded in the tileset.json configuration file. The specific format is as follows Figure 4 This forms a hierarchical 3DTiles data structure, which can dynamically load and display data at different levels of detail according to the viewer's viewpoint and distance, achieving more efficient and smooth three-dimensional geographic data display.
[0149] In one embodiment, Figure 5 As shown, a device for converting BIM data to 3D tiles data is proposed, the device comprising:
[0150] A standard octree construction module 501 is used to set the data structure of the octree index and to construct a standard octree corresponding to the BIM model based on the data structure;
[0151] A hierarchical simplification module 502 is used to prune and adjust the standard octree based on the categories of the child nodes in the standard octree, and to loosely adjust the bounding box range of the nodes in the standard octree based on the bounding box range of the components in the BIM model, so as to obtain a target octree;
[0152] The export module 503 is used to cyclically export the data of each level in the target octree into a B3dm model according to the data structure of the spatial index;
[0153] The conversion module 504 is used to integrate the octree data and convert the B3DM model into 3DTiles data with a hierarchical structure.
[0154] In one embodiment, the standard octree construction module 501 is specifically used to: obtain the overall spatial range of the BIM model, and create a bounding box that meets the overall spatial range as the current bounding box to be split; construct the root node of the standard octree, and determine the target recursive depth of the standard octree based on the preset splitting accuracy and the overall spatial range; sequentially place the BIM model into the current bounding box to be split that can be contained and has no child nodes; if the current recursive depth of the standard octree does not reach the target recursive depth, the current bounding box to be split is equally split into eight equal parts to obtain eight corresponding child bounding boxes, and the BIM model contained in the bounding box to be split before the split is shared among the corresponding eight child bounding boxes, and the child nodes corresponding to the split child bounding boxes are constructed in the standard octree; each child bounding box is used as the current bounding box to be split, and the step of sequentially placing the BIM model into the current bounding box to be split that can be contained and has no child nodes and subsequent steps are returned to execute until the current recursive depth of the standard octree reaches the target recursive depth, and the constructed standard octree is obtained.
[0155] In one of the embodiments, the standard octree construction module 501 is further specifically used to: construct the node name of each node in the standard octree based on the name of the BIM model, the level of the node, and the spatial index of the bounding box represented by the node; determine the storage path rules for the node data and the intermediate format data, and determine the target storage path of the BIM data at each level based on the storage path rules.
[0156] In one of the embodiments, the hierarchical simplification module 502 is specifically used to: when all child nodes under the target parent node in the standard octree belong to the same category, retain the target parent node and prune all child nodes under the target parent node; wherein the target parent node is any parent node in the standard octree, and the categories of child nodes include gray nodes, white nodes and black nodes, gray nodes indicate that the corresponding bounding box is partially occupied by the BIM model, white nodes indicate that the corresponding bounding box is not occupied by the BIM model, and black nodes indicate that the corresponding bounding box is completely occupied by the BIM model.
[0157] In one embodiment, the hierarchical simplification module 502 is specifically used to: calculate the node bounding box range of the child node corresponding to the parent node according to the node bounding box coordinates of all parent nodes in the standard octree; obtain the component bounding box range of each component in the BIM model; compare the component bounding box range of the target component with the node bounding box range of the target node, and if the component bounding box range is within the node bounding box range, update the node bounding box range of the target node to the component bounding box range of the target component; wherein the target component is any component in the BIM model, and the component bounding box range of the target component overlaps with the node bounding box range of the target node; if the component bounding box range is outside the node bounding box range, obtain all node bounding box ranges overlapped by the component bounding box range, and merge all overlapping node bounding box ranges to update them to the component bounding box range of the target component.
[0158] In one of the embodiments, the export module 503 is specifically used to: cyclically read the geometric information of each level in the target octree, convert the geometric information into the coordinate form of the Gltf model, and construct the content of the Position part in the Gltf model; cyclically read the attribute information of each level in the target octree and store it; cyclically read the rendering style information of each level in the target octree, and convert the rendering style information into the form of the Gltf model, and construct the content of the material part in the Gltf model; convert the Gltf model into a Glb model through binary conversion; convert the Glb model into a B3dm model through re-encoding.
[0159] In one embodiment, the conversion module 504 is specifically used to recursively record the geometric error, bounding box range, content and URL of each node starting from the root node.
[0160] Figure 6 FIG. 1 shows an internal structure diagram of a device for converting BIM data to 3D tiles data in one embodiment. Figure 6 As shown, the BIM data to 3D tiles data conversion device includes a processor, a memory and a network interface connected via a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the BIM data to 3D tiles data conversion device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement a method for converting BIM data to 3D tiles data. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can execute a method for converting BIM data to 3D tiles data. Those skilled in the art will understand that Figure 6The structure shown in the figure is only a block diagram of a part of the structure related to the present application scheme, and does not constitute a limitation on the BIM data to 3D tiles data conversion device to which the present application scheme is applied. The specific BIM data to 3D tiles data conversion device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0161] A computer-readable storage medium stores a computer program, which implements the following steps when executed by a processor: setting a data structure of an octree index, and constructing a standard octree corresponding to a BIM model based on the data structure; pruning and adjusting the standard octree based on the categories of child nodes in the standard octree, and loosely adjusting the bounding box range of nodes in the standard octree based on the bounding box range of components in the BIM model to obtain a target octree; cyclically exporting data of each level in the target octree as a B3dm model according to the data structure of the spatial index; and converting the B3DM model into 3D Tiles data with a hierarchical structure by integrating the octree data.
[0162] A device for converting BIM data to 3D tiles data includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are implemented: setting a data structure of an octree index, and constructing a standard octree corresponding to a BIM model based on the data structure; pruning and adjusting the standard octree based on the categories of child nodes in the standard octree, and loosely adjusting the bounding box range of nodes in the standard octree based on the bounding box range of components in the BIM model to obtain a target octree; cyclically exporting data of each level in the target octree as a B3DM model according to the data structure of the spatial index; and integrating the octree data to convert the B3DM model into 3D tiles data with a hierarchical structure.
[0163] It should be noted that the above-mentioned BIM data to 3D tiles data conversion method, device, equipment and computer-readable storage medium belong to a general inventive concept, and the contents of the BIM data to 3D tiles data conversion method, device, equipment and computer-readable storage medium embodiments are applicable to each other.
[0164] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0165] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0166] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several modifications and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for converting BIM data to 3D tiles data, characterized in that: The method comprises: Setting a data structure of an octree index, and constructing a standard octree corresponding to the BIM model based on the data structure; The standard octree is pruned and adjusted based on the categories of the child nodes in the standard octree, and the bounding box range of the nodes in the standard octree is loosely adjusted based on the bounding box range of the components in the BIM model to obtain the target octree; cyclically exporting the data of each level in the target octree into a B3dm model according to the data structure of the spatial index; The comprehensive octree data converts the B3DM model into 3DTiles data with a hierarchical structure.
2. The method according to claim 1, characterized in that: The method of constructing a standard octree corresponding to the BIM model based on the data structure includes: Acquire the overall spatial range of the BIM model, and create a bounding box that satisfies the overall spatial range as the current bounding box to be split; Constructing a root node of a standard octree, and determining a target recursive depth of the standard octree based on a preset splitting accuracy and the overall spatial range; Sequentially place the BIM model into the current bounding box to be split that can be contained and has no child nodes; If the current recursion depth of the standard octree does not reach the target recursion depth, the current bounding box to be split is equally split into eight parts to obtain eight corresponding sub-bounding boxes, and the BIM model contained in the bounding box to be split before the split is shared among the corresponding eight sub-bounding boxes, and the child nodes corresponding to the split sub-bounding boxes are constructed in the standard octree; Take each child bounding box as the current bounding box to be split, return to execute the step of sequentially placing the BIM model into the current bounding box to be split that can be contained and has no child nodes and subsequent steps, until the current recursion depth of the standard octree reaches the target recursion depth, and the constructed standard octree is obtained.
3. The method according to claim 2, characterized in that The step of constructing a standard octree corresponding to the BIM model based on the data structure also includes: Construct the node name of each node in the standard octree based on the name of the BIM model, the node level and the spatial index of the bounding box represented by the node; Determine storage path rules for node data and intermediate format data, and determine a target storage path for BIM data at each level based on the storage path rules.
4. The method according to claim 1, characterized in that: The pruning and adjusting of the standard octree based on the category of the child nodes in the standard octree includes: When all child nodes under a target parent node in a standard octree belong to the same category, the target parent node is retained, and all child nodes under the target parent node are pruned; wherein the target parent node is any parent node in the standard octree, and the categories of child nodes include gray nodes, white nodes, and black nodes, the gray nodes indicate that the corresponding bounding box is partially occupied by the BIM model, the white nodes indicate that the corresponding bounding box is not occupied by the BIM model, and the black nodes indicate that the corresponding bounding box is fully occupied by the BIM model.
5. The method according to claim 1, characterized in that The method of loosely adjusting the bounding box range of the node in the standard octree based on the bounding box range of the component in the BIM model includes: Calculate the node bounding box range of the child node corresponding to the parent node according to the node bounding box coordinates of all parent nodes in the standard octree; Get the bounding box range of each component in the BIM model; Compare the component bounding box range of the target component with the node bounding box range of the target node. If the component bounding box range is within the node bounding box range, update the node bounding box range of the target node to the component bounding box range of the target component; wherein the target component is any component in the BIM model, and the component bounding box range of the target component overlaps with the node bounding box range of the target node; If the component bounding box range is outside the node bounding box range, all node bounding box ranges overlapped by the component bounding box range are obtained, and all overlapping node bounding box ranges are merged and updated as the component bounding box range of the target component.
6. The method according to claim 1, characterized in that The cyclically converting the data of each level in the target octree into 3D tiles data according to the data structure of the spatial index comprises: The geometric information of each level in the target octree is read cyclically, and the geometric information is converted into the coordinate form of the Gltf model, and the content of the Position part in the Gltf model is constructed; Circularly reading and storing the attribute information of each level in the target octree; Circularly read the rendering style information of each level in the target octree, convert the rendering style information into the form of a Gltf model, and construct the content of the material part in the Gltf model; Convert the Gltf model into the Glb model through binary conversion; The Glb model was converted into a B3dm model by recoding.
7. The method according to claim 1, characterized in that The comprehensive octree data converts the B3DM model into 3DTiles data with a hierarchical structure, including: Starting from the root node, recursively record the geometric error, bounding box range, content, and URL of each node.
8. A device for converting BIM data to 3D tiles data, characterized in that: The device comprises: A standard octree construction module, used to set the data structure of the octree index and to construct a standard octree corresponding to the BIM model based on the data structure; A hierarchical simplification module is used to prune and adjust the standard octree based on the categories of the child nodes in the standard octree, and to loosely adjust the bounding box range of the nodes in the standard octree based on the bounding box range of the components in the BIM model to obtain a target octree; An export module, used for cyclically exporting the data of each level in the target octree into a B3dm model according to the data structure of the spatial index; The conversion module is used to integrate the octree data to convert the B3DM model into 3DTiles data with a hierarchical structure.
9. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.
10. A device for converting BIM data to 3D tiles data, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 7.
Citation Information
Cited By
Geological modeling parallel explicit sampling method, device and equipment and storage medium
CN119478278A
Compression storage method and system of transformer substation GIM model
CN119988320A
