A Cluster-Based Method for Generating and Using Component-Level LODs in IFC Models

By introducing the concepts of clusters and cluster groups, and adopting a LOD generation method with a directed acyclic graph structure, the problems of component-level operation requirements and visual effect abrupt changes in the traditional LOD technology in the BIM field are solved, achieving smooth multi-level LOD transitions and the operability of individual components.

CN118691728BActive Publication Date: 2025-10-31ZHEJIANG UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410595615.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-05-14
Publication Date
2025-10-31
Estimated Expiration
2044-05-14

AI Technical Summary

Technical Problem

Traditional LOD technology struggles to meet component-level operational requirements in the BIM field, and the lack of alignment between model edges when multiple LOD levels coexist leads to abrupt changes in visual effects.

Method used

A cluster-based LOD generation method is adopted. By using the grouping concept of clusters and cluster groups and the structure of directed acyclic graphs, a multi-level LOD hierarchy is generated, which enables the model to smoothly transition when the observed state changes and meets the requirements of component-level operations.

Benefits of technology

It achieves a smooth transition of multi-level LODs on the IFC model, protects the operability of individual components, avoids the accumulation of high-frequency information at the edges, and improves the browsing effect of the 3D model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118691728B_ABST
    Figure CN118691728B_ABST
Patent Text Reader

Abstract

This invention discloses a cluster-based method for generating and using Level of Detail (LOD) at the component level in IFC (Integrated Functional Component) models. This method is applicable to IFC component models containing a large number of triangles. During offline processing, the component model is divided into groups by a fixed number of triangles forming a cluster, generating multi-level LOD rough models. This allows for dynamic adjustment of the number of triangles rendered in a component during real-time rendering based on the visible range of the rendering camera, avoiding overhead from invalid rendering. This invention also introduces clustering into the LOD processing of IFC models, improving the fine-grainedness of facet reduction operations. Individual components can achieve coexistence of multiple LOD levels, ensuring smooth transitions between different LOD levels during camera movement. Furthermore, this invention incorporates instantiation rendering and culling algorithms that conform to modern GPU hardware operating methods, significantly improving rendering frame rate performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial 3D model display, and in particular to a cluster-based method for generating and using IFC model component-level LODs. Background Technology

[0002] With the widespread application of 3D computer-aided design (CAD) in engineering, architecture, manufacturing, and other fields, the demand for efficient and accurate representation of complex 3D models is increasing. Traditional 3D CAD model representation methods face several challenges, such as the massive data volume resulting from high model complexity, and the increasingly demanding requirements on computer hardware and software. Therefore, to improve the performance and efficiency of 3D CAD systems and reduce the burden of data processing and transmission, a more intelligent and efficient model representation method is needed.

[0003] To address this issue, in recent years, increasing attention and research have focused on Level of Detail (LOD) technology. LOD technology is a method for dynamically adjusting the level of detail in a model, allowing for the rendering of 3D models with varying degrees of refinement at different distances or viewing angles. This technology was first applied in computer graphics for real-time rendering and optimizing model display, and has since been gradually adopted in the field of CAD.

[0004] Typically, conventional LOD (Level of Detail) technology is sufficient to meet the need for dynamically adjusting model detail to reduce rendering overhead. However, CAD models such as IFC (Industry Foundation Classes) and BIM (Building Information Modeling) often have different interaction requirements than other fields. This issue is not a core concern in other fields, such as games, because in a large scene, the user's operational unit is usually not as small as a tiny part. But in the BIM field, it's the complete opposite; meeting component-level operational requirements is a necessity. Even in an extremely complex water supply and drainage model, it's necessary to ensure the operability of even the smallest component.

[0005] Furthermore, while traditional LOD generation is relatively simple based on tree-like generation structures, it typically cannot achieve the coexistence of multiple LOD levels on a single object. This is because model simplification inevitably leads to the loss of high-frequency information, making it difficult for model edges between different levels to fit together. Forced merging will result in obvious edge line problems, leading to an unsmooth model. On the other hand, if a single model uses only one level at a time, it will cause significant abrupt changes in the visual effect of the model as the viewing distance and perspective change during browsing. Summary of the Invention

[0006] The purpose of this invention is to address the shortcomings of existing technologies by providing a cluster-based method for generating and using LODs, building upon traditional LOD technology. This method is then applied to individual components of an IFC model, enabling a smooth transition as the model dynamically switches LOD levels based on changes in the user's viewing state, and meeting the component-level operational requirements in the BIM industry.

[0007] The objective of this invention is achieved through the following technical solution:

[0008] A cluster-based method for generating and using IFC model component-level LODs includes the following steps:

[0009] (1) Read the geometric information of the IFC model components, remove duplicates from the vertex data of the components, encapsulate the updated triangular face data, and traverse the geometric data; compare the number of triangular faces of each component with the preset face number threshold. Components with no more than the threshold number of triangular faces are regarded as simple mesh components and follow the regular rendering pipeline; components with more than the threshold number of triangular faces are regarded as complex mesh components. Obtain the adjacency relationship between the triangular faces of this part of the components and record it as a data structure.

[0010] (2) Identify the data structure of the adjacency relationship of the triangular face in the building components in the traversal model, sort the triangular face and divide it into clusters, calculate the adjacency relationship of the clusters, use this part of the data to divide the clusters into cluster groups, and then obtain the cluster group data and encapsulate it into a data structure.

[0011] (3) Traverse the cluster group data in component identification step (2), traverse each group, extract the triangular face data of all clusters, combine the face reduction algorithm to reduce the face, and record all newly generated triangular face data and their adjacency relationship data in the group.

[0012] (4) Repeat steps (2) and (3) until a specified number of LOD levels are generated, and store the newly generated geometric data as an intermediate file;

[0013] (5) Read the geometric data in the intermediate file, and remove the corresponding parts in sequence according to the component mesh, component cluster and component cluster visibility in the model to which the geometric data belongs. Record the data of the visible cluster and the corresponding LOD level and render it.

[0014] Furthermore, step (1) is implemented through the following sub-steps:

[0015] (1.1) Parse the geometric data of the IFC model, obtain the vertex attributes and corresponding index numbers of each component, traverse all vertices corresponding to the index numbers, and compare them. If two index numbers point to the same vertex attribute, deduplication is performed and the updated data is stored.

[0016] (1.2) By default, each triangle facet has an edge direction. Using the vertex and index data obtained in step (1.1), all edges are traversed. When any two edges have the same vertex and opposite directions, these two edges are considered to be opposite edges. This relationship is recorded in the data structure.

[0017] (1.3) Identification step (1.2) Regarding the data structure of the opposite edge relationship, read each pair of opposite edges, calculate the index of the triangular facet it belongs to through the index of the edge, and then obtain the adjacency relationship of the triangular facets, and encapsulate it into a data structure.

[0018] Furthermore, step (2) is implemented through the following sub-steps:

[0019] (2.1) Identify the data structure that records the adjacency relationship of triangular faces, use the index number of the triangular facets and the adjacency relationship as weights to sort the index numbers, then divide them into fixed sizes, encapsulate them into clusters in order, and record the edge data information of the clusters.

[0020] (2.2) Combining the logic in the half-edge data structure algorithm that each undirected edge can be split into two half edges with the same vertex but opposite directions, it can be assumed that each edge has a direction. By using the edge data of the cluster obtained in step (2.1), all edges are traversed. When any two edges have the same vertex and opposite directions, these two edges have a pair of edges. The pair of edges is recorded in the data structure.

[0021] (2.3) Identify the data structure containing the edge relationship, read each pair of edges in it, and map the index number of the edge back to the index number of its cluster, thereby obtaining the adjacency relationship of the cluster and encapsulating it into a data structure.

[0022] (2.4) Identify the adjacency relationship of the clusters in step (2.3). The data is sorted by index number using the cluster index number size and adjacency relationship as weights. Then, it is divided into clusters of a fixed size and encapsulated into cluster groups in sequence. The edge data information of the cluster groups is recorded.

[0023] Furthermore, step (3) is implemented through the following sub-steps:

[0024] (3.1) Identify the geometric data of the clusters, traverse each group, obtain the vertex attributes and index data of the triangular facets of all clusters, and store them in a data structure respectively;

[0025] (3.2) Read the edge data of the group and identify the vertex attributes and index data generated in step (3.1). Mark the vertices corresponding to the edges as "locked" to ensure that they will not be modified during the face reduction process.

[0026] (3.3) Identify the vertex attributes and index data generated in step (3.1), and combine them with the face reduction algorithm to iterate through the cumulative face reduction error corresponding to each edge. For edges with "locked" vertices set in step (3.2), set a maximum value for their cumulative face reduction error, and then store the error in a min-heap data structure.

[0027] (3.4) Identify the min-heap data structure of step (3.3), extract the edge with the smallest cumulative error of face reduction in sequence, collapse the edge, adjust the vertex data of its adjacent triangular facets, calculate the cumulative error of face reduction of the new edge generated after face reduction, and store it in the min-heap.

[0028] (3.5) Repeat step (3.4) until the number of existing edges meets the preset condition. Then, remove duplicates from the existing vertex attributes and index labels. Use the new vertex attributes and index labels obtained after deduplication to construct new triangular face geometric data and encapsulate the result into a data structure.

[0029] (3.6) Identify the new triangular face geometric data obtained in step (3.5), traverse all edges, and when any two edges have the same vertex and opposite directions, these two edges have a pair of opposite edges. Record all pair of opposite edges in the data structure, and then use this data to obtain the adjacency relationship of the triangular face.

[0030] Furthermore, step (4) is implemented through the following sub-steps:

[0031] (4.1) Repeat steps (2) and (3) according to the preset number of LOD levels;

[0032] (4.2) Set up an encoding structure, arrange the component LOD geometric data generated in step (4.1) in sequence, and store it in an intermediate file.

[0033] Furthermore, step (5) is implemented through the following sub-steps:

[0034] (5.1) Combining the encoding structure set in step (4.2), the intermediate file recording LOD data is parsed and encapsulated into a data structure, stored in the buffer for rendering to read, and the component geometry data in the buffer is generated.

[0035] (5.2) Read the component geometry data in the buffer generated in step (5.1), use the bounding box to calculate the visibility of the component model, and record the index number of the visible component;

[0036] (5.3) Identify the index number of the visible component obtained in step (5.2), use the index number to read the geometric information of the corresponding cluster group in the buffer generated in step (5.1), use the distance between it and the camera and the proportion of pixels it occupies on the terminal interface as weights to calculate its corresponding LOD level, and then use the level to filter the corresponding cluster group index number and record it.

[0037] (5.4) Identify the cluster group index number obtained in step (5.3), read the clusters contained in the cluster group from the buffer generated in step (5.1), and traverse and compare the visibility of the clusters in turn. Then generate and record the index buffer of the visible cluster index numbers.

[0038] (5.5) Read the visible cluster index label data in the index buffer generated in step (5.4) to obtain the corresponding index label, and then read the vertex data in the buffer generated in step (5.1) according to the index and render it.

[0039] The benefits of this invention are as follows:

[0040] This invention introduces the concepts of clusters and cluster groups during the LOD generation process, changing the traditional tree-like generation structure of LOD to a directed acyclic graph generation structure. This ensures that the edges of parent-level units do not coincide with the edges of their corresponding child-level units, thus avoiding the problem of "having to retain high-frequency edge information to ensure edge alignment when merging different level meshes." This allows for a more uniform distribution of newly generated triangular faces during the face reduction process, achieving the effect of multi-level LODs coexisting and displaying smoothly on the same single-unit model. Furthermore, this technology is only applied to individual component models. Compared to conventional LOD technology applied to the entire model, it protects the operability of individual components, and each individual component can independently switch LODs, ensuring that the browsing effect of the 3D model does not produce obvious abrupt changes. Attached Figure Description

[0041] Figure 1 This is a framework diagram of the cluster-based IFC model component-level LOD generation and usage method of the present invention;

[0042] Figure 2 This is a schematic diagram of the LOD directed acyclic graph generation structure of the present invention;

[0043] Figure 3 These are schematic diagrams of the edges of different cluster levels in this invention;

[0044] Figure 4 This is a schematic diagram of the LOD hierarchy of the sphere model of the present invention. Detailed Implementation

[0045] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0046] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, for example: a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0047] like Figure 1 As shown, a method for generating and using component-level LODs in a cluster-based IFC model includes the following steps:

[0048] Step 1: Analyze the IFC model, identify and extract the geometric attribute data of the components involved, and set the classification standard for simple and complex components to 64 triangular faces. All components in the IFC model are divided into two categories: simple component models and complex component models according to this threshold. The simple component models are rendered using the traditional rendering method, while the complex component models are processed using LOD.

[0049] This step is the technical basis of the present invention. It takes components as the processing unit and fundamentally meets the operational requirements at the component level. In addition, it distinguishes the operating environments of simple components and complex components to avoid invalid optimization operations of LOD processing on simple components.

[0050] Step one includes the following sub-steps:

[0051] (1.1) Use the ifc-openshell third-party parsing library to parse and obtain the geometric data and semantic information of the IFC model, and encapsulate the coordinates, normals, materials, indexes, and texture UV geometric data of the vertices according to the component units;

[0052] (1.2) Given that the existing GPU architecture usually uses 32 or 64 cores as a scheduling unit, in order to make full use of hardware performance and ensure program portability, and also to avoid LOD processing of too many simple components, the default cluster composition unit is 64 triangular faces. Based on this, the 64 triangular faces are used as the basis for dividing simple components and complex components, and the geometric data of the encapsulated components are divided.

[0053] (1.3) Simple components are rendered directly using the traditional rendering pipeline, while the data of complex components is encapsulated for further processing.

[0054] Step Two: Process the complex components identified in Step One one by one. Read the vertex data, remove duplicates, and then, based on the half-edge data structure, find the adjacency relationships of the triangular faces contained in the components. Using the adjacency relationship and the index number of the triangular face as weights, and in conjunction with the METIS third-party segmentation library, sort and divide the triangular face groups, and encapsulate them into clusters of 60-64 triangular faces each. Record the edges of the clusters formed by the triangular faces. Continue to use the half-edge data structure method to find the adjacency relationships of the clusters. Continue to call the METIS library to sort and divide the clusters, forming groups of 12-16 clusters each, and record the edges of the groups formed by the clusters.

[0055] Step two is one of the core inventions, introducing the concept of clusters and cluster groups based on traditional LOD technology, in the form of... Figure 2 The left and middle figures include the following sub-steps.

[0056] (2.1) Read the geometric data of the complex component after division in step one, traverse the index number of its vertex, read the attribute data of the vertex corresponding to the index, calculate the hash value using the murmur-32 hash function, and compare it with a preset hash function table. If the value already exists, change the index number to the index number recorded in the hash function table; otherwise, store the index number in the hash function table.

[0057] (2.2) Based on the concept of half-edge data structure, each edge is set to have a direction. That is, if the two vertices of an edge are A and B respectively, then the edge has two half-edges, AB and BA. Traverse all edges in the component and compare them with a preset hash function table. If the edge recorded in the table is exactly opposite to the current edge, then it is a pair of edges. Record the index of the pair of edges in a mapping data structure.

[0058] (2.3) Read the mapping data structure of the record of the edge relationship. Since the edge has a direction, the triangles where the two edges of the edge relationship are located are adjacent. Based on this, divide the index of these two edges by 3 and take the integer part to obtain the index of the triangle where they are located. Encapsulate the index of the adjacent triangles into a new mapping data structure.

[0059] (2.4) Read the adjacency relationship and index number of the triangle face, use them as weights, and hand them over to the METIS partitioning library for recursive partitioning. Each partitioning range is set to 60 to 64 triangle faces to allow for a certain error adjustment. After partitioning, sorted triangle face indices and arrays recording each range can be obtained.

[0060] (2.5) Read the array of recorded group ranges, obtain the index number of the corresponding triangle face in each group, and read the corresponding geometric information, encapsulate it into a cluster data structure, and calculate the bounding sphere of the cluster; in the process of encapsulating the triangle face, determine in turn whether the triangle face index of the opposite side of the three sides of the triangle face is in another group range. If so, it indicates that the side is the edge of the cluster, and record the edge data.

[0061] (2.6) Create a mapping structure to record the mapping relationship between the index of a cluster and the index of its edge. Combining the concept of opposite edges in step (2.2), further find the opposite edge relationship of the cluster's edges and record it in a mapping data structure.

[0062] (2.7) Read the mapping data structure that records the edge relationship, obtain the adjacency relationship of the cluster through the data structure that records the cluster and cluster edge mapping relationship, and encapsulate it into a new mapping data structure;

[0063] (2.8) Read the adjacency relationship and index number of the cluster, use them as weights, and submit them to the METIS partitioning library for recursive partitioning. Each partitioning range is set to 12 to 16 clusters to allow for a certain error adjustment. After partitioning, sorted cluster indexes and arrays recording each range can be obtained.

[0064] (2.9) Read the array of the record group range, obtain the index number of the corresponding cluster for each group, and read the corresponding geometric information, encapsulate it into a cluster group data structure. At the same time, determine whether the index of the cluster to which the opposite edge of the cluster belongs is in another group range. If so, it indicates that the edge is the edge of the cluster group and record the edge data.

[0065] Step 3: Read the cluster data obtained in Step 2, traverse each cluster, read the triangle face vertices and index data of all clusters, and integrate them into several arrays; traverse the edge information of the clusters, mark the vertices where these edges are located as "locked", and then combine the QEM (Quadic Error Metrics) face reduction algorithm to calculate the cumulative face reduction error of all edges in the cluster and store the error in a min-heap data structure; then take out the edge with the smallest cumulative error in turn, collapse it, update the cumulative face reduction error of the newly generated edge and store it in the min-heap, and continue to reduce the face until the number of edges reaches the preset range.

[0066] Step three is the second core part of the invention, which completes the reduction of the surface area based on step two, and its form is as follows: Figure 2 The middle and right images are shown. Steps two and three introduce clusters and cluster groups and perform face reduction, allowing the LOD generation structure of the directed acyclic graph to replace the traditional tree-like LOD generation structure. The advantage of the directed acyclic graph is that it breaks the limitation of the tree structure, where the parent unit must be composed of a fixed number of child units, making the distribution of newly generated triangles more free and uniform. At the same time, the cluster edge locking operation in step three makes it possible for multiple levels of LOD to coexist on the same model, which allows the edges of different LOD levels to fit together, thus achieving a smoother visual effect in the transition of LOD levels.

[0067] Step three includes the following sub-steps:

[0068] (3.1) Traverse each cluster group, read the vertex attributes and index data of the triangle faces of all clusters, and traverse the edge information of the cluster group, marking the vertices where these edges are located as "locked";

[0069] (3.2) One of the advantages of the QEM face reduction algorithm is to optimize the computational cost of calculating the quadratic equation by using the quadratic matrix calculation. Traverse all triangular faces in the cluster, use the three vertices of the triangular face to calculate the quadratic representation of the face containing the triangular face, and record it in a matrix.

[0070] (3.3) Traverse all edges. If any point on the edge has a "locked" mark, set its cumulative face reduction error to a maximum value. If there is no "locked" mark, obtain all adjacent triangular faces around the two vertices contained in the edge. Calculate the cumulative quadratic form matrix of these adjacent triangular faces using the quadratic form matrix pre-calculated in 2). Use this matrix in combination with the QEM face reduction algorithm to obtain the position of the newly generated vertex.

[0071] (3.4) Determine the validity of the newly generated vertex. Traverse all adjacent triangles obtained in step (3.3). First, calculate the normal vector n1 by the cross product of the vectors of the original vertex and the other two vertices of the triangle. Then, calculate the new normal vector n2 by the cross product of the vectors of the newly generated vertex and the other two vertices of the triangle. Calculate the dot product of the normal vectors n1 and n2. If it is negative, it means that the newly generated triangle has been flipped, that is, the new vertex is invalid. Then, increase the cumulative error of the edge by 100.0 to reduce its weight.

[0072] (3.5) Record the mapping relationship between the index of all edges and their cumulative error of face reduction, and store them in a min-heap data structure;

[0073] (3.6) Take the index of the edge with the smallest cumulative face reduction error from the min-heap, remove the contents of the two vertices of the edge in the geometric data, change the corresponding old vertices of all adjacent triangles of the edge to the newly generated vertices obtained by the QEM algorithm, add the vertex data to the geometric data, calculate the cumulative face reduction error of all newly generated edges, and store the mapping relationship between the edge index and the error value in the min-heap of step (3.5);

[0074] (3.7) Repeat step (3.6) until the number of existing edges does not exceed the preset target number of edges. Traverse the index of all vertices, use a hash function to remove duplicate vertices, and encapsulate the updated vertex attributes and index data.

[0075] Step 4: Repeat steps 2 and 3 to continuously process the newly generated triangular face data until a level 4 LOD structure is generated. Organize this part of the geometric data. First, record the number of clusters, the number of cluster groups, the offset value of the cluster group data, and the offset value of the next component data in sequence. Then, store the bounding box data of the component mesh, the geometric data of the clusters, and the geometric data of the cluster groups in sequence. Finally, encapsulate all LOD geometric data into a binary intermediate file.

[0076] Step four repeats steps two and three, generating a multi-level LOD structure. The directed acyclic graph structure resulting from the clusters and cluster groups implanted in step two means that there are no obvious connections between the edges of upper and lower levels in the LOD models generated in step four, specifically as follows: Figure 3 As shown, this prevents high-frequency edge information from accumulating as the layer increases during LOD generation, thus avoiding a patchy, abrupt visual appearance. Furthermore, step four encapsulates the LOD data into an intermediate file, which can be directly used later without repeated calculations when no further mesh adjustments are needed.

[0077] Step four includes the following sub-steps:

[0078] (4.1) Read the vertex attributes and index numbers of the newly generated triangle face, repeat steps two and three four times to generate a 4-level LOD structure, and encapsulate this part of the geometric data;

[0079] (4.2) Create a 32-bit unsigned integer array for data encapsulation and iterate through the LOD data of all complex components;

[0080] (4.3) Store the number of clusters, number of cluster groups, cluster group data offset value and offset value of the next component data in sequence, and then store the bounding box data of the current component mesh;

[0081] (4.4) Store the following information sequentially: number of cluster vertices, vertex attribute data offset, number of triangles, vertex index data offset, cluster bounding sphere data, cumulative face reduction error, cluster index, and LOD level of the current component.

[0082] (4.5) Sequentially store the number of clusters contained in the current component's cluster group, its related cluster data offset value, the maximum cumulative surface reduction error in the cluster group, the LOD level of the cluster group, and the bounding sphere information of the cluster group, etc.

[0083] (4.6) Store the cluster vertex attribute data and vertex index label data of the current component in sequence;

[0084] (4.7) Store the index data of the clusters contained in the cluster group of the current component in sequence;

[0085] (4.8) Encapsulate the above array data into a binary file.

[0086] Step 5: Determine if an intermediate LOD file already exists or if it needs to be rebuilt. If it exists, read the geometric data of the intermediate file using the encoding method in Step 4 and store it in the buffer of the graphics interface. Use the compute shader to perform frustum culling and determine the visibility of the component mesh. If visible, perform LOD level filtering. For clusters that pass the filtering, extract the clusters they contain and perform frustum culling and occlusion culling. If both pass, they are considered visible. Record the index numbers of these clusters in a buffer. Then, use the vertex shader to read the buffer to obtain the index numbers and use this to read the corresponding vertex attributes and vertex indices from the geometric data buffer for instantiation and rendering.

[0087] Step five is the main process for fully leveraging the advantages of the LOD structure. During the real-time browsing phase, suitable LOD levels are dynamically selected and invisible parts are culled to avoid rendering overhead from redundant triangles, thus improving rendering performance. The effect is as follows: Figure 4 .

[0088] Step five includes the following sub-steps:

[0089] (5.1) Determine whether an LOD intermediate file already exists or whether it needs to be rebuilt. If it does not exist or the LOD structure needs to be rebuilt, return to step one. Otherwise, read the geometric data of the intermediate file according to the encoding method in step four and store it in the buffer of the graphics interface.

[0090] (5.2) Call the compute shader of the graphics interface to execute instructions. The number of tasks to be executed is the number of complex components divided by 32 and rounded up. In the compute shader, each task processing group uses 32 threads.

[0091] (5.3) In the compute shader, the index of the current component is obtained through the global thread index. The bounding box information of the component is read from the buffer data through the index, and the frustum culling operation is performed. If it passes, it is considered visible; otherwise, it is discarded.

[0092] (5.4) For visible components, the cluster bounding sphere data and cumulative facet reduction error data of the component are read from the buffer data through its index. Then, the target facet reduction error at the distance is calculated by the distance between the bounding sphere and the camera in the camera space, the viewing angle, and the height of the terminal interface. Then, it is compared with the cumulative facet reduction error of the cluster. There are two situations at this time: one is that the cumulative facet reduction error of the cluster and its clusters are both greater than or less than the target facet reduction error, and the other is that the cumulative facet reduction error of the cluster is greater than the target facet reduction error while some of its clusters are less than the target facet reduction error. The former may lead to the selection of too high or too low LOD level, while the latter means the boundary case. Therefore, when the cumulative facet reduction error of the cluster is greater than the target facet reduction error, the clusters of the cluster are traversed to judge the error. After filtering, the index of the effective cluster is stored.

[0093] (5.5) Read the index data of the valid cluster, read its bounding sphere information from the buffer, perform view frustum culling and occlusion culling on it, and if successful, record its index in the index buffer of a cluster to be rendered.

[0094] (5.6) Read the number of indices in the index buffer of the cluster to be rendered, call the instantiation rendering instruction of the graphics interface, set the number of vertices to 64*3, because in step one, a cluster is preset to contain 64 triangles, and the number of instances is set to the number of indices read above. Then, read the index number in the index buffer of the cluster to be rendered in the vertex shader, and based on this, read the vertex attributes and index numbers of the cluster from the buffer in step (5.1), and then perform rendering.

[0095] The specific embodiments described herein are merely illustrative examples of the invention. Those skilled in the art to which this invention pertains may make various modifications or additions to the described specific embodiments or use similar methods to replace them, without departing from the spirit of the invention or exceeding the scope defined by the appended claims.

[0096] Although this document uses terms such as triangular facet, cluster, and cluster group frequently, the possibility of using other terms is not excluded. These terms are used merely for the convenience of describing and explaining the essence of the invention; interpreting them as any additional limitation would contradict the spirit of the invention.

Claims

1. A method for generating and using component-level LODs in a cluster-based IFC model, characterized in that, Includes the following steps: (1) Read the geometric information of the IFC model components and remove duplicates from the vertex data of the components; It also encapsulates the updated triangle face data and iterates through the triangle face data; The number of triangles of each component is compared with a preset threshold. Components with no more than the threshold are considered simple mesh components and are rendered using the regular rendering pipeline. Components with more than a threshold number of triangles are considered complex mesh components. The adjacency relationships between the triangles of such complex mesh components are obtained and recorded as a data structure. (2) Traverse the building components in the model to identify the data structure of the adjacency relationship of the triangular faces, sort the triangular faces and divide them into clusters, calculate the adjacency relationship of the clusters, use the adjacency relationship to divide the clusters into groups, and then obtain the group data of the groups and encapsulate it into a data structure; specifically, this is achieved through the following sub-steps: (2.1) Identify the data structure that records the adjacency relationship of triangular faces, use the index number of the triangular facets and the adjacency relationship as weights to sort the index numbers, then divide them into fixed sizes, encapsulate them into clusters in order, and record the edge data information of the clusters; (2.2) By default, each edge has a direction. Using the edge data of the cluster obtained in step (2.1), all edges are traversed. When any two edges have the same vertex and opposite directions, these two edges have a pair of edges. This pair of edges relationship is recorded in the data structure. (2.3) Identify the data structure containing the edge relationship, read each pair of edges in it, and map the index number of the edge back to the index number of its cluster, thereby obtaining the adjacency relationship of the cluster and encapsulating it into a data structure. (2.4) Identify the adjacency relationship of the clusters in step (2.3). The data is sorted by index number using the cluster index number size and adjacency relationship as weights. Then, it is divided into a fixed size and encapsulated into cluster groups in order. The edge data information of the cluster groups is recorded. (3) Traverse the cluster group data in component identification step (2), traverse each group, extract the triangular face data of all clusters, combine the face reduction algorithm to reduce the face, and record all newly generated triangular face data and their adjacency relationship data in each group. (4) Repeat steps (2) and (3) until a specified number of LOD levels are generated, and store the newly generated geometric data as an intermediate file; (5) Read the geometric data in the intermediate file, and remove the corresponding parts in sequence according to the component mesh, component cluster and component cluster visibility in the model to which the geometric data belongs. Record the data of the visible cluster and the corresponding LOD level and render it.

2. The method for generating and using cluster-based IFC model component-level LODs according to claim 1, characterized in that, Step (1) is achieved through the following sub-steps: (1.1) Parse the geometric data of the IFC model, obtain the vertex attributes and corresponding index numbers of each component, traverse all vertices corresponding to the index numbers, and compare them. If two index numbers point to the same vertex attribute, deduplication is performed, and the updated data is stored. (1.2) By default, each triangle facet has an edge direction. Using the vertex and index data obtained in step (1.1), all edges are traversed. When any two edges have the same vertex and opposite directions, these two edges are considered to be opposite edges. This relationship is recorded in the data structure. (1.3) Identification step (1.2) Regarding the data structure of the opposite edge relationship, read each pair of opposite edges, calculate the index of the triangular facet it belongs to through the index of the edge, and then obtain the adjacency relationship of the triangular facets, and encapsulate it into a data structure.

3. The method for generating and using cluster-based IFC model component-level LODs according to claim 1, characterized in that, Step (3) is achieved through the following sub-steps: (3.1) Identify the geometric data of the clusters, traverse each group, obtain the vertex attributes and index data of the triangular facets of all clusters, and store them in a data structure respectively; (3.2) Read the edge data of each group and identify the vertex attributes and index data generated in step (3.1). Mark the vertices corresponding to the edges as "locked" to ensure that they will not be modified during the face reduction process. (3.3) Identify the vertex attributes and index data generated in step (3.1), and combine them with the face reduction algorithm to iterate through the cumulative face reduction error corresponding to each edge. For edges with "locked" vertices set in step (3.2), set a maximum value for their cumulative face reduction error, and then store the error in a min-heap data structure. (3.4) Identify the min-heap data structure of step (3.3), extract the edge with the smallest cumulative error of face reduction in sequence, collapse the edge, adjust the vertex data of its adjacent triangular facets, calculate the cumulative error of face reduction of the new edge generated after face reduction, and store it in the min-heap. (3.5) Repeat step (3.4) until the number of existing edges meets the preset conditions. Then, remove duplicates from the existing vertex attributes and index labels. Use the new vertex attributes and index labels obtained after deduplication to construct new triangular face geometric data and encapsulate the result into a data structure. (3.6) Identify the new triangular geometric data obtained in step (3.5), traverse all edges, and when any two edges have the same vertex and opposite directions, these two edges have a pair of opposite edges. Record all pair of opposite edges in a data structure, and then use the data structure that records the pair of opposite edges to obtain the adjacency relationship of the triangular faces.

4. The method for generating and using cluster-based IFC model component-level LODs according to claim 1, characterized in that, Step (4) is achieved through the following sub-steps: (4.1) Repeat steps (2) and (3) according to the preset number of LOD levels; (4.2) Set up an encoding structure, arrange the component LOD geometric data generated in step (4.1) in sequence, and store it in an intermediate file.

5. The method for generating and using cluster-based IFC model component-level LODs according to claim 4, characterized in that, Step (5) is achieved through the following sub-steps: (5.1) Combined with the encoding structure set in step (4.2), the intermediate file recording LOD data is parsed and encapsulated into a data structure, stored in the buffer for rendering to read, and the component geometry data in the buffer is generated. (5.2) Read the component geometry data in the buffer generated in step (5.1), use the bounding box to calculate the visibility of the component model, and record the index number of the visible component; (5.3) Identify the index number of the visible component obtained in step (5.2), use the index number to read the geometric information of the corresponding cluster group in the buffer generated in step (5.1), use the distance between it and the camera and the proportion of pixels it occupies on the terminal interface as weights, calculate its corresponding LOD level, and then use the level to filter the corresponding cluster group index number and record it. (5.4) Identify the cluster group index number obtained in step (5.3), read the clusters contained in the cluster group from the buffer generated in step (5.1), and traverse and compare the visibility of the clusters in turn. Then generate and record the index buffer of the visible cluster index numbers. (5.5) Read the visible cluster index label data in the index buffer generated in step (5.4) to obtain the corresponding index label, and then read the vertex data in the buffer generated in step (5.1) according to the index and render it.

Citation Information

Patent Citations

  • Scene model rendering method and device thereof, electronic equipment and storage medium

    CN113178014A

  • Three-dimensional model multi-level LOD generation method based on surface reduction algorithm

    CN113781642A