BIM model lightweight method

Through geometric extraction, vertex remapping, space division and geometric simplification of BIM models, the problems of large BIM model files and low rendering efficiency are solved, fast loading and efficient rendering of models are achieved, and the requirements of modern building information model technology are met. High efficiency and high performance requirements.

CN118821284APending Publication Date: 2024-10-22ZHEJIANG HUADONG CONSTR ENG +1
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411014107.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-10-22

AI Technical Summary

Technical Problem

BIM models contain a large amount of geometric and non-geometric data, resulting in large file sizes, which affects storage, transmission and rendering efficiency, especially on resource-constrained terminal devices, limiting the effectiveness of BIM technology in practical applications.

Method used

The BIM model is converted into OSGB data format using methods of geometric extraction and transformation, vertex remapping, space division, geometric simplification and tile output, and the storage space of the model is reduced through the spatial octree algorithm and the quadratic error measurement algorithm. requirements and improve rendering performance.

Benefits of technology

It achieves fast loading and smooth interaction of BIM models, improves data transmission efficiency and rendering performance, maintains the accuracy and integrity of the model, meets the needs of large-volume model processing, and promotes the informatization and digital transformation of the construction industry.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118821284A_ABST
    Figure CN118821284A_ABST
Patent Text Reader

Abstract

The invention discloses a BIM (Building Information Modeling) lightweight method, which comprises the following steps of: S1, geometric extraction and transformation: carrying out geometric extraction and transformation on model elements in an OSGB (Open Service Gateway Broadcasting) data format, which mainly comprises the steps of extracting geometric information of a whole model space and carrying out coordinate system transformation on each vertex of the model elements; s2, vertex remapping: remapping the model by adopting a vertex + index mode; s3, space division: performing space division on each node in the model node list through an octree algorithm; s4, geometric simplification: simplifying vertexes of geometric elements of the model by adopting a quadratic error measurement algorithm; and S5, tile output: hierarchically outputting the result in a 3D Tiles data format. The complete BIM model lightweight process formed through the steps has obvious advantages in the aspects of improving the model processing efficiency, optimizing data storage and transmission, keeping the model precision and integrity and the like, and can meet the requirements of the modern building information model technology for high efficiency and high performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a BIM model lightweight method, and the technical method is applicable to the BIM model application fields in industries such as construction, hydropower, water conservancy, mining, and transportation. Background Art

[0002] BIM (Building Information Modeling) technology plays a vital role in the architecture, engineering and construction (AEC) industry, supporting the design, construction and operation of buildings, infrastructure and cities by creating and using digital information models. However, BIM models usually contain a large amount of geometric and non-geometric data, which results in a large model file size and poses challenges to data storage, transmission and processing. These problems become more prominent, especially when data needs to be exchanged between different platforms, real-time collaboration is carried out in a network environment, or model browsing and operation is carried out on resource-constrained terminal devices.

[0003] The lightweighting of BIM models is mainly to solve the challenges encountered in the storage, transmission and rendering of BIM models. As a three-dimensional model that integrates the information of the entire life cycle of an engineering project, the improvement of BIM (Building Information Modeling) is often accompanied by a substantial increase in the amount of data. This leads to many problems in the processing and use of the model, such as slow loading speed, low rendering efficiency, and large system resource occupation. These problems limit the effectiveness of BIM technology in practical applications.

[0004] In order to overcome these challenges, BIM model lightweight technology came into being. Lightweight technology aims to reduce the storage space requirements of the model, optimize the data transmission efficiency, and improve the rendering and display performance of the model on the terminal device. This includes efficient compression of model data, the use of streaming technology, and the development of rendering strategies that adapt to different display requirements. Through these technologies, while maintaining the accuracy and integrity of the model, the model can be loaded quickly and interacted smoothly, greatly expanding the application scope and flexibility of BIM technology.

[0005] In addition, with the in-depth application of BIM technology in engineering project management, more complex application scenarios, larger BIM model data, and more business scenario interactive operations have led to a growing demand for technologies that can support lightweight processing of large-scale models. This not only involves the storage and transmission of models, but also includes model rendering, display optimization, and user interaction. How to maintain model accuracy and integrity while supporting large-scale model processing efficiency is the current research direction of BIM model lightweight technology, and is also of great significance for promoting the informatization and digital transformation of the construction industry. Summary of the invention

[0006] In order to overcome the above-mentioned shortcomings of the prior art and enable BIM model lightweight technology to maintain model accuracy and integrity while supporting large-volume model processing efficiency, the present invention provides a BIM model lightweight method. The present invention adopts the following technical solutions.

[0007] A BIM model lightweight method includes the following steps:

[0008] Step S1, geometry extraction and transformation: convert the BIM model to be lightweight into the OSGB data format through the specified BIM model conversion plug-in, extract the geometry information and attribute information of the entire model element, and perform coordinate system conversion on the extracted geometry information;

[0009] Step S2, vertex remapping: converting the geometric information in the BIM model from a vertex-only representation to a vertex+index form, specifically by creating an index array, initializing valid index variable values, building a hash table, and iteratively processing duplicate vertices;

[0010] Step S3, spatial division: spatially divide the elements within the model range according to the spatial octree algorithm to obtain spatial hierarchical information, specifically creating a root node cube within the model range, constructing the root node cube number and index, dividing deeper spatial cubes, recursively processing each spatial cube according to the geometric node threshold in each cube, and obtaining spatial hierarchical information constructed according to the spatial octree algorithm.

[0011] Step S4, geometric simplification: starting from the smallest unit of the constructed spatial octree, the number of vertices of the model geometric elements is reduced layer by layer using the quadratic error metric (QEM) algorithm;

[0012] Step S5, tile output: traverse the model elements according to the spatial layering information and output a lightweight file in the 3D Tiles data format.

[0013] Furthermore, in step S1, the BIM model to be lightweight is converted into three-dimensional model data in DGN, RVT, IFC, STP, and FBX formats, and the geometric information and attribute information of the entire model element are extracted, including vertices, indices, normals, colors, UV coordinates, and material information.

[0014] Furthermore, in step S1, the method for extracting geometric information and attribute information of model elements includes the following steps:

[0015] Step S101, initializing a matrix stack: before processing a model element, an empty matrix stack is initialized and the identity matrix is ​​pushed into the stack for use in subsequent geometric transformations;

[0016] Step S102, recursively process nodes: recursively process each node of the model, including group nodes, geometry nodes, and matrix transformation nodes. For each group node, first process its child nodes, then multiply the current transformation matrix by the child node transformation matrix, and push the result into the matrix stack.

[0017] Step S103, matrix transformation of geometric nodes: extracting geometric information of each geometric node, including vertices and normal vectors, and applying the matrix in the current matrix stack to transform the geometric information;

[0018] Step S104, coordinate system conversion: convert each vertex in the transformed geometric information from the original coordinate system to the WGS84 coordinate system. The coordinate system conversion method uses the open source geospatial coordinate conversion library Proj.4, which provides rich map projection conversion functions and is widely used in the GIS (Geographic Information System) field.

[0019] Further, step S2 includes the following steps:

[0020] Step S201, create an index array: if the model has no index, create an empty index array (orgIndex), the array size is the number of vertices of the model, and the initial value is 0, 1, 2, 3, 4... until the number of vertices of the model decreases by one;

[0021] Step S202, initializing the valid index variable value: creating a target index array (dstIndex) whose length is equal to the number of vertex indexes of the model element, assigning the initial value of each element in the array to -1, and creating the next valid index value nextIndex at the same time, and setting its initial value to 0, indicating the next valid index value;

[0022] Step S203, constructing a hash table: establishing a hash array, the array size is greater than or equal to the number of model vertex arrays, the initial value of all elements in the array is set to -1, and at the same time, defining a variable i for looping, looping from 0 to the maximum value of the original model vertex index, in each loop, taking the current index value index = orgIndex[i], and the current vertex value vertex = vertex[index];

[0023] Step S204, iteratively process duplicate vertices: take a hash number for the current vertex value, and search for the entry corresponding to the hash in the hash array. If the entry value is -1, it indicates a new index, and the value of the entry is assigned to index, the target index is set to index, and nextIndex is increased by 1; if the entry value is not -1, it indicates that the same index already exists, and the target index is set to the entry value; then, the target index array size is set to nextIndex, and step S203 is repeated until all vertices are traversed; this process implements the method of calculating the vertex hash value to determine whether the vertex values ​​are equal, and merges the vertex indices with the same hash value, thereby achieving the purpose of fully reducing the number of indexes of the model;

[0024] Step S205, updating the target index array: assigning the target index to all vertices of the model.

[0025] Further, step S3 includes the following steps:

[0026] Step S301, creating a root node cube: according to the bounding box of the entire model, select the maximum value of the length, width and height, build a cube containing all model elements as the root node of the 0th layer (i.e. the top layer), numbered 0, and initialize its index;

[0027] Step S302, dividing the space cubes at a deeper level: performing an octave operation on the 0th layer cube according to the spatial octree algorithm to obtain 8 small cubes, which are numbered 0, 1, 2, 3, 4, 5, 6, 7 respectively, representing the 8 small cubes of the first layer;

[0028] Step S303, recursively process each spatial cube: traverse the center point of each Geode's bounding box, determine in which small cube it falls, and continue to recursively process deeper spatial divisions according to the spatial octree algorithm according to the threshold of the number of Geodes in each cube, until the predetermined number of layers n is reached or the threshold of the number of Geodes in each cube is met;

[0029] Step S304, obtaining spatial hierarchical information: recording the numbers and index information of the small cubes to which each geometric node (Geode) of each layer belongs, and finally constructing spatial hierarchical information according to the spatial octree algorithm.

[0030] Further, step S4 includes the following steps:

[0031] Step S401, calculate the Q matrix of each vertex: calculate the Q matrix of each vertex in the model, that is, the K matrix of all triangles adjacent to the vertex v p sum;

[0032] Step S402, preprocessing all legal point pairs: preprocessing all legal point pairs, that is, vertex pairs that can be shrunk without causing geometric topological structure errors, obtaining the coordinates of the shrunk points and the corresponding error metrics, and putting them into a priority queue (heap);

[0033] Step S403, select a point pair for contraction operation: start from the minimum unit of the constructed spatial octree, iterate layer by layer, and for each iteration, select the point pair (v1, v2) at the top of the stack to pop the stack, and perform contraction operation on the grid;

[0034] Step S404, update the point pairs in the priority queue: update all point pairs involving v1 and v2 in the heap. The specific steps are: calculate the updated vertex The Q matrix is ​​Q 1 +Q 2 , modify all (v1, u), (v2, u) point pairs to And update its error cost and optimal point.

[0035] Further, step S5 includes the following steps:

[0036] Step S501, analyzing model data: analyzing the model data to obtain the number of Geodes in each small cube and its attribute information;

[0037] Step S502, data merging: merging the vertex and index data processed by steps S1 to S4 according to a specific merging rule, and generating a batch number according to the number of merged vertices;

[0038] Step S503, creating output files: creating a b3dm file and a descriptive JSON file containing metadata and geometric data description of the model, and then compressing the geometric data and texture images to reduce the file size;

[0039] Step S505, creating a tileset.json file: creating a tileset.json file indicating the location of the root node layer and the bounding box according to the 3D Tiles specification.

[0040] The beneficial effects of the present invention are as follows: the complete BIM model lightweight process formed by the above steps has obvious advantages in improving model processing efficiency, optimizing data storage and transmission, maintaining model accuracy and integrity, etc., and can meet the requirements of modern building information modeling technology for high efficiency and high performance. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 It is a schematic diagram of the process of the present invention.

[0042] Figure 2This is the OSGB data organization form in the specific embodiment of the present invention.

[0043] Figure 3 It is a schematic diagram of the process of geometry extraction in a specific embodiment of the present invention.

[0044] Figure 4 It is a schematic diagram of the space division process in a specific embodiment of the present invention. DETAILED DESCRIPTION

[0045] 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.

[0046] This embodiment is based on the flow chart of the present invention, as shown in Figure 1 As shown, a BIM model lightweight method includes:

[0047] A BIM model lightweight method, comprising the steps of:

[0048] Step S1, geometry extraction and transformation: convert the BIM model to be lightweight into the OSGB data format through the specified BIM model conversion plug-in, extract the geometry information and attribute information of the entire model element, and perform coordinate system conversion on the extracted geometry information;

[0049] Step S2, vertex remapping: converting the geometric information in the BIM model from a vertex-only representation to a vertex+index form, specifically by creating an index array, initializing valid index variable values, building a hash table, and iteratively processing duplicate vertices;

[0050] Step S3, spatial division: spatially divide the elements within the model range according to the spatial octree algorithm to obtain spatial hierarchical information, specifically creating a root node cube within the model range, constructing the root node cube number and index, dividing deeper spatial cubes, recursively processing each spatial cube according to the geometric node threshold in each cube, and obtaining spatial hierarchical information constructed according to the spatial octree algorithm.

[0051] Step S4, geometric simplification: starting from the smallest unit of the constructed spatial octree, the number of vertices of the model geometric elements is reduced layer by layer using the quadratic error metric (QEM) algorithm;

[0052] Step S5, tile output: traverse the model elements according to the spatial layering information and output a lightweight file in the 3D Tiles data format.

[0053] Specifically, the step S1 is to convert the BIM model to be lightweight into the OSGB data format. The BIM model to be lightweight refers to a data format file including but not limited to three-dimensional models such as DGN, RVT, IFC, STP, FBX, etc., and convert it into the OSGB data format using a conversion plug-in. The OSGB data format (full name Open Scene Graph Binary) is a binary format for storing and exchanging three-dimensional scenes. It is closely related to Open Scene Graph (OSG), which is an open source, high-performance 3D graphics toolkit commonly used in real-time rendering and virtual reality applications. The nodes of OSGB data are organized in a tree shape, and its form is as follows: Figure 2 As shown. The geometric information and attribute information of the entire model element are extracted, mainly including vertices, vertex indices, normals, colors, UV coordinates, materials and other information. The extraction method is to first establish an empty matrix stack and initialize a unit matrix, and then recursively process each child node from the root node of the model element: for the Group node, continue to recurse its child nodes; for the MatrixTransform node, first take out the matrix at the top of the matrix stack, multiply it by the MatrixTransform node matrix and push it into the matrix stack, recursively process its child nodes, and after processing the child nodes, pop up the matrix at the top of the matrix stack; for the Geode node, take out the matrix at the top of the matrix stack, and use the matrix to transform each vertex and normal of each geometric node below it, and finally get a new value. The flowchart of geometric extraction is shown as follows. Figure 3 As shown. The coordinate system conversion of the extracted geometric information refers to converting each vertex in the Geode list obtained by extracting the geometric information into the WGS84 coordinate system. The coordinate system conversion method uses the open source geospatial coordinate conversion library Proj.4, which provides rich map projection conversion functions and is widely used in the GIS (Geographic Information System) field.

[0054] The step S2 is specifically to convert the method of expressing the model geometry information by only using vertices in the BIM model into the form of vertices + indices. The specific method steps are to create an index array, initialize valid index variable values, build a hash table, and iteratively process repeated vertices. The creation of the index array is specifically to create an empty index array (orgIndex) if the model has no index, the array size is the number of vertices in the model, and the initial values ​​are 0, 1, 2, 3, 4.....; the initialization of the valid index variable value is specifically to create a target index array (dstIndex), the length of which is equal to the number of vertex indexes of the model elements, and the initial value of each element in the array is -1, and at the same time create the next valid index value nextIndex, whose value is 0, indicating the next valid index value. The construction of the hash table and iterative processing of repeated vertices are as follows: first, a hash array is established, the size of the array is not less than the number of model vertex arrays, and the initial values ​​of all elements in the array are assigned to -1; secondly, a variable i is defined for looping, and it starts from 0 and loops through to the maximum value of the vertex index of the original model. In each loop, the current index value index = orgIndex [i] and the current vertex value vertex = vertex [index] are taken. A hash number is taken for the current vertex value again, and the entry corresponding to the hash is searched in the hash array. If the entry value is -1, it indicates a new index, and the value of the entry is assigned to index, the target index is set to index, and nextIndex is increased by 1. If the entry value is not -1, it indicates that the same index already exists, and the target index is set to the entry value. Then the size of the target index array is set to nextIndex. Finally, the target index is assigned to the model. This process realizes the method of calculating the vertex hash value to determine whether the vertex values ​​are equal, and the vertex indices with the same hash value are merged, so as to fully reduce the number of indexes of the model.

[0055] The step S3 is specifically to divide the elements within the model range according to the spatial octree algorithm to obtain spatial hierarchical information. Specifically, it is to create a root node cube within the model range, construct the root node cube number and index, divide the deeper spatial cube, recursively process each spatial cube according to the Geode threshold in each cube, and obtain the spatial hierarchical information constructed according to the spatial octree algorithm. Here, a three-layer space is used as an example to illustrate the specific process: first, take the maximum value of the length, width and height of the bounding box of the entire model to form a cube. At this time, all the Geodes of the model elements are in this cube, and this is taken as the 0th layer (i.e., the top layer); then, the cube is divided into eight equal parts to obtain 8 small cubes, and the center point of the bounding box of each Geode is traversed to determine which small cube it falls in, and the 8 small cubes are numbered respectively, such as 0, 1, 2, ... 7, and the number represents the 8 small cubes in the first layer; finally, each cube obtained in the previous step is divided into eight equal parts, and each small cube can obtain 8 smaller cubes. They are numbered 0-1, 0-2, 0-3, 0-4...7-6, 7-7, representing the 64 small cubes in the second layer. The final result is the small cubes belonging to each Geode in each layer. The process of space division is as follows: Figure 4 shown.

[0056] The step S4 specifically includes reducing the vertices of the model geometric elements using the quadratic error metric (QEM) algorithm. Starting from the smallest unit of the constructed spatial octree, the quadratic error metric (QEM) algorithm is used to reduce the number of model vertices layer by layer. The specific algorithm process is as follows: First, the Q matrix of each vertex is calculated, that is, the K matrix of all its adjacent triangles. p Then preprocess all legal point pairs, find the coordinates of the points after shrinkage and the corresponding error metrics, and put them in the heap. For each iteration, select the point pair (v1, v2) at the top of the heap to pop the stack and perform shrinkage on the grid. Finally, update all point pairs involving v1 and v2 in the heap. The values ​​that need to be updated here are: Calculate the update The Q matrix is ​​Q 1 +Q 2 , modify all point pairs such as (v1, u), (v2, u) to And modify the error cost and optimal point.

[0057] The step S5 is specifically to traverse the model elements according to the spatial hierarchical information and output a lightweight file in the 3DTiles data format in a tiled form. Specifically, the model data is first analyzed to obtain the number of Geodes in each small cube and their attributes. Secondly, data merging is performed, merging vertices, indexes and other data according to specific merging rules and generating a batch number according to the number of merged vertices. Again, a b3dm file and a descriptive JSON file containing the metadata and geometric data description of the model are created. Then, the geometric data and texture images are compressed to reduce the file size and improve loading efficiency. Finally, a tileset.json file representing the location of the root node layer and the bounding box is created according to the 3D Tiles specification. Take the three-layer space division in step S3 as an example: ① From the highest layer to the 0th layer, a folder is created according to the layer number and the folder is named with a number, and the created file names are 2, 1, and 0 respectively. ② Traverse each small cube in each layer of space: If there is no Geode in the small cube, continue to traverse. If there is a Geode, group and merge the vertices, normals, indices, UVs, and colors of all Geodes in the layer by material, and generate a batch number. Here, we take three Geodes with vertices of 1000, 2000, and 3000, and indexes of 3000, 4000, and 5000 as examples. The new vertex coordinates, normals, UVs, and colors are the sum of all corresponding arrays. Taking vertex coordinates as an example, for example, there are a total of 6000 vertices in the end, the first 1000 are the first Geode, the 1001st to 3000th are the second Geode, and the rest are the third Geode. New indexes, there are 12,000 new indexes in total. The first 3,000 are the index values ​​of the original first Geode, 3001 to 7000 are the index values ​​of the original second Geode plus 3000 (that is, the original index is 0, now changed to 3000), and 7001 to 1200 are the index values ​​of the original third Geode plus 7000. The length of the batch number is the same as the length of the new vertex, that is, a total of 6,000 elements, the first 1,000 element values ​​are all 0, indicating that these 1,000 vertices are the first Geode; 1001 to 3000 values ​​are all 2, indicating that these vertices are the second Geode, and the remaining values ​​are all 2. The new vertices, normals, indices, UVs, colors, and batch numbers will be generated to generate a b3dm file and a corresponding description JSON file, such as 1-6.b3dm, indicating that it is the model file generated by the sixth small cube in the first layer; for texture images, they are placed in the textures folder under the root directory. In this way, when different models reference the same texture, only the relative path needs to be recorded, and there is actually only one copy of the image instead of saving multiple copies. ③ For data compression operations, if it is geometric data, use the Draco or MeshOpt algorithm for compression; if it is a texture image, save it in webp format.④ Generate tileset.json, indicating the location of layer 0 and its bounding box and other information.

[0058] After the above steps, a complete BIM model lightweight process can be realized. This process has obvious advantages in improving model processing efficiency, optimizing data storage and transmission, maintaining model accuracy and integrity, etc., and can meet the needs of modern building information modeling technology for high efficiency and high performance.

[0059] This technology constructs the initial surface of the base-cover interface directly from the boundary data (A1) and the measured internal element data (A2), refers to the terrain surface (A3), and establishes a precisely controlled base-cover interface by adding internal control points (A4), thereby realizing the automatic creation of the base-cover interface. It can quickly construct a base-cover interface that conforms to basic geological laws and meets accuracy requirements to meet actual engineering needs.

[0060] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A BIM model lightweight method, characterized in that: The following steps are involved: Step S1, geometry extraction and transformation: convert the BIM model to be lightweight into the OSGB data format through the specified BIM model conversion plug-in, extract the geometry information and attribute information of the entire model element, and perform coordinate system conversion on the extracted geometry information; Step S2, vertex remapping: converting the geometric information in the BIM model from a vertex-only representation to a vertex+index form, specifically by creating an index array, initializing valid index variable values, building a hash table, and iteratively processing duplicate vertices; Step S3, space division: spatially divide the elements within the model range according to the spatial octree algorithm to obtain spatial hierarchical information, specifically creating a root node cube within the model range, constructing the root node cube number and index, dividing deeper spatial cubes, recursively processing each spatial cube according to the geometric node threshold in each cube, and obtaining spatial hierarchical information constructed according to the spatial octree algorithm; Step S4, geometric simplification: starting from the smallest unit of the constructed spatial octree, the number of vertices of the model geometric elements is reduced layer by layer using the quadratic error metric (QEM) algorithm; Step S5, tile output: traverse the model elements according to the spatial layering information and output a lightweight file in the 3D Tiles data format.

2. A BIM model lightweight method according to claim 1, characterized in that: In step S1, the BIM model to be lightweight is converted into three-dimensional model data in DGN, RVT, IFC, STP, and FBX formats, and the geometric information and attribute information of the entire model element are extracted, including vertices, indices, normals, colors, UV coordinates, and material information.

3. A BIM model lightweight method according to claim 1, characterized in that: In step S1, the method for extracting geometric information and attribute information of model elements includes the following steps: Step S101, initializing a matrix stack: before processing a model element, an empty matrix stack is initialized and the identity matrix is ​​pushed into the stack for use in subsequent geometric transformations; Step S102, recursively process nodes: recursively process each node of the model, including group nodes, geometry nodes, and matrix transformation nodes. For each group node, first process its child nodes, then multiply the current transformation matrix by the child node transformation matrix, and push the result into the matrix stack. Step S103, matrix transformation of geometric nodes: extracting geometric information of each geometric node, including vertices and normal vectors, and applying the matrix in the current matrix stack to transform the geometric information; Step S104, coordinate system conversion: convert each vertex in the transformed geometric information from the original coordinate system to the WGS84 coordinate system.

4. The BIM model lightweighting method described in step S1 of claim 3 is characterized in that: In step S102: For the group node, continue to recursively process its child nodes; For a MatrixTransform node, first take out the matrix at the top of the matrix stack, multiply it with the matrix of the current MatrixTransform node, push the multiplication result into the matrix stack, and then recursively process its child nodes. After processing the child nodes, pop out the matrix at the top of the matrix stack; For a geometry node, take out the matrix at the top of the matrix stack, apply the matrix transformation to the vertices and normal vectors of each geometry node under the node, and obtain new vertex and normal vector values.

5. A BIM model lightweight method according to claim 1, characterized in that: Step S2 includes the following steps: Step S201, create an index array: if the model has no index, create an empty index array (orgIndex), the array size is the number of vertices of the model, and the initial value is 0, 1, 2, 3, 4... until the number of vertices of the model decreases by one; Step S202, initializing the valid index variable value: creating a target index array (dstIndex) whose length is equal to the number of vertex indexes of the model element, assigning the initial value of each element in the array to -1, and creating the next valid index value nextIndex at the same time, and setting its initial value to 0, indicating the next valid index value; Step S203, constructing a hash table: establishing a hash array, the array size is greater than or equal to the number of model vertex arrays, the initial value of all elements in the array is set to -1, and at the same time, defining a variable i for looping, looping from 0 to the maximum value of the original model vertex index, in each loop, taking the current index value index = orgIndex[i], and the current vertex value vertex = vertex[index]; Step S204, iteratively process duplicate vertices: get a hash number for the current vertex value, and search for the entry corresponding to the hash in the hash array. If the entry value is -1, it indicates a new index, and the value of the entry is assigned to index, the target index is set to index, and nextIndex is increased by 1; if the entry value is not -1, it indicates that the same index already exists, and the target index is set to the entry value; then, the target index array size is set to nextIndex, and step S203 is repeated until all vertices are traversed; Step S205, updating the target index array: assigning the target index to all vertices of the model.

6. A BIM model lightweight method according to claim 1, characterized in that: Step S3 includes the following steps: Step S301, creating a root node cube: according to the bounding box of the entire model, select the maximum value of the length, width and height, build a cube containing all model elements as the root node of the 0th layer (i.e. the top layer), numbered 0, and initialize its index; Step S302, dividing the space cubes at a deeper level: performing an octave operation on the 0th layer cube according to the spatial octree algorithm to obtain 8 small cubes, which are numbered 0, 1, 2, 3, 4, 5, 6, 7 respectively, representing the 8 small cubes of the first layer; Step S303, recursively process each spatial cube: traverse the center point of each Geode's bounding box, determine in which small cube it falls, and continue to recursively process deeper spatial divisions according to the spatial octree algorithm according to the threshold of the number of Geodes in each cube, until the predetermined number of layers n is reached or the threshold of the number of Geodes in each cube is met; Step S304, obtaining spatial hierarchical information: recording the numbers and index information of the small cubes to which each geometric node (Geode) of each layer belongs, and finally constructing spatial hierarchical information according to the spatial octree algorithm.

7. A BIM model lightweight method according to claim 1, characterized in that: Step S4 includes the following steps: Step S401, calculate the Q matrix of each vertex: calculate the Q matrix of each vertex in the model, that is, the K matrix of all triangles adjacent to the vertex v p sum; Step S402, preprocessing all legal point pairs: preprocessing all legal point pairs, that is, vertex pairs that can be shrunk without causing geometric topological structure errors, obtaining the coordinates of the shrunk points and the corresponding error metrics, and putting them into a priority queue (heap); Step S403, select a point pair for contraction operation: start from the minimum unit of the constructed spatial octree, iterate layer by layer, and for each iteration, select the point pair (v1, v2) at the top of the stack to pop the stack, and perform contraction operation on the grid; Step S404, update the point pairs in the priority queue: update all point pairs involving v1 and v2 in the heap. The specific steps are: calculate the updated vertex The Q matrix is ​​Q 1 +Q 2 , modify all (v1, u), v2, u) point pairs to And update its error cost and optimal point.

8. A BIM model lightweight method according to claim 1, characterized in that: Step S5 includes the following steps: Step S501, analyzing model data: analyzing the model data to obtain the number of Geodes in each small cube and its attribute information; Step S502, data merging: merging the vertex and index data processed by steps S1 to S4 according to a specific merging rule, and generating a batch number according to the number of merged vertices; Step S503, creating output files: creating a b3dm file and a descriptive JSON file containing metadata and geometric data description of the model, and then compressing the geometric data and texture images to reduce the file size; Step S505, creating a tileset.json file: creating a tileset.json file indicating the location of the root node layer and the bounding box according to the 3D Tiles specification.

Citation Information

Cited By

  • Method, system and equipment for supporting lightweight processing and lossless compression of multi-source three-dimensional model and storage medium

    CN119396785A

  • A method, system, device and storage medium supporting lightweight processing and lossless compression of multi-source three-dimensional models

    CN119396785B

  • BIM (Building Information Modeling) rapid lightweight method based on GPU (Graphic Processing Unit) high-performance calculation

    CN119475864A

  • Oblique photography three-dimensional model loading method and system based on dynamic trajectory prediction

    CN121074283A

  • Bridge engineering BIM model lightweight conversion and visualization method and system

    CN121962529A