A lightweight rendering method and device for Revit models

By hierarchical processing of the mesh grid of the Revit model and extracting incremental difference information, combined with the triangular mesh surface reduction algorithm, the lag problem caused by excessive size of the Revit model is solved, and the model is lightweight rendering and smooth show.

CN114186318BActive Publication Date: 2025-02-07PERSAGY TECHNOLOGY CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111525466.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-14
Publication Date
2025-02-07
Estimated Expiration
2041-12-14

AI Technical Summary

Technical Problem

Due to the large size of the existing Revit model, it has lag when viewing and browsing on the client computer, which is not conducive to the display and dissemination of the model.

Method used

By layering the mesh grid of the Revit model, the incremental difference information between different levels is extracted, and the object is loaded and rendered as needed according to the distance from the camera, and the triangular mesh surface reduction algorithm is used for surface reduction processing.

Benefits of technology

The Revit model is implemented to reduce the computational amount, improve rendering speed and fluency, and enable the model to be displayed smoothly on the client side.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114186318B_ABST
    Figure CN114186318B_ABST
Patent Text Reader

Abstract

The present invention provides a lightweight rendering method and device for a Revit model. The method obtains a mesh grid of a Revit model, processes the mesh grid in layers; extracts incremental difference information between mesh grids of different layers; traverses all objects in the scene to determine the layer of the mesh grid corresponding to the object; and uses the layer of the mesh grid where the currently rendered object is located as a reference to load incremental difference information to render objects of other layers. The mesh grid of the Revit model is processed in layers to determine the difference information between mesh grids of different layers. When rendering, incremental difference information is added to objects of different layers as required to render objects of different layers. The present invention loads and renders display content of different layers on demand, reducing the amount of calculation and improving the calculation speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of building information modeling, and in particular to a method and device for lightweight rendering of a Revit model. Background Art

[0002] Building Information Modeling (BIM) is an information carrier based on 3D models. It mainly includes architectural geometric model mesh data, that is, Mesh data of 3D models, which is the main data for building 3D models, as well as attribute data of architectural models, such as the name of model components, component type, component coding, topological relationship between components, geometric attributes of components (such as length, width, height, area, volume, etc.) and other business or professional attribute data. When using professional BIM modeling software to create BIM models, a large amount of geometric model mesh data (Mesh) and attribute data will be carried. Due to the large volume of BIM models, client computers are required to have strong performance to view and browse, which is not conducive to the display and dissemination of models. Therefore, it is necessary to lightweight the BIM model in order to reduce the storage size of the BIM model and reduce the number of geometric patches of the BIM model (the basic component unit of the model mesh data is the patch), so that the model can be displayed smoothly on the client. Revit software is the most widely used BIM modeling tool, which has good three-dimensional presentation and a lot of detailed information. However, due to its large size, the computer configuration requirements are high, and the model often freezes when opened. Model lightweighting is to solve the problem caused by the large size of the model, and also to make it possible to display the model on the browser side.

[0003] The model lightweight workflow and optimization mainly include two parts: compression optimization of model storage and rendering loading (see the optimization process Figure 1 ). First, use the API provided by the Revit software to obtain the rvt file containing geometric information, attribute information, and texture map information for the Revit model. Use the IExporterIFC development plug-in provided by the RevitSDK to export the IFC model file, and then convert the IFC file into a JSON format file. If there are multiple files (one model for each floor), merge the files. Then optimize the storage of the model building elements in the file. The optimization can include reducing the merge of mesh classes and parametric representation conversion.

[0004] Combined with WebGL and Three.js rendering framework, the JSON file of the Revit model is parsed and rendered to the browser to achieve lightweight display. Among them, the ObjectLoder function provided in Three.js converts the model into a geometric implementation of triangular facets. After the geometric transformation, the triangular face model can be simplified, and the octree algorithm and LOD algorithm model are applied to load and render on demand. The rendering process is to send the hierarchical triangular face model into the WebGL rendering pipeline to achieve lightweight display of the model (optimizing rendering speed and rendering fluency). In order to ensure the rendering speed and rendering fluency, the on-demand loading method is generally adopted. In this way, the original model needs to be simplified in advance and models of different precisions are loaded at the same time. On-demand loading includes two considerations: one is that the accuracy of the model gradually decreases from near to far from the camera, and the other is that the accuracy of smaller objects is lower and the accuracy of larger objects is higher. The LOD level corresponds to the fineness from high to low from high to low, and the method of reducing the accuracy is mainly to apply the relevant algorithms of triangular mesh simplification. The processing methods for triangular facets include: vertex deletion method, edge folding method and triangle folding simplification method. The problem with these methods is that the geometry of the model changes, which will affect the rendering of the BIM model. Summary of the invention

[0005] To this end, the present invention provides a lightweight rendering method and device for a Revit model, which processes the mesh of the Revit model in layers, determines the difference information between meshes of different layers, and adds incremental difference information to objects of different layers as required during rendering, so as to render objects of different layers. The present invention loads and renders display content of different layers on demand, reduces the amount of calculation, and improves the calculation speed. The specific technical scheme is as follows:

[0006] To achieve the above object, an embodiment of the present invention provides a lightweight rendering method for a Revit model, comprising the steps of:

[0007] Obtaining a mesh of a Revit model, and performing layered processing on the mesh;

[0008] Extract incremental difference information between meshes at different levels;

[0009] Traverse all objects in the scene and determine the mesh level corresponding to the object;

[0010] Incrementally load each mesh level in the scene and batch render all objects at the same level.

[0011] Furthermore, the mesh is processed in layers, specifically: a triangular mesh surface reduction algorithm is used to reduce the mesh surface according to different surface reduction ratios to obtain meshes of different layers.

[0012] Furthermore, the meshes of adjacent levels are differentiated to obtain the incremental difference information between the meshes of different levels.

[0013] Furthermore, the triangular mesh surface reduction algorithm comprises the steps of:

[0014] S1 initializes the error matrix of each vertex of the mesh;

[0015] S2 calculates the replacement points of the collapsed edge for the two vertices of each edge and calculates the shrinkage cost;

[0016] S3 sorts the shrinkage costs according to their magnitude, and removes the edge with the smallest shrinkage cost;

[0017] S4 removes all connecting edges of the two vertices, and updates the error matrix of the vertex and its adjacent nodes;

[0018] Steps S1-S4 are repeated until there are no collapsed edges.

[0019] Further, the mesh grid is divided into 10 different levels; determining the level of the mesh grid corresponding to the object includes the steps of:

[0020] Calculate the distance from the center of each object's bounding box to the camera;

[0021] Sort the distances corresponding to all objects by size and set thresholds every 10 percentiles;

[0022] The distance from the object to the camera is compared with the threshold, the threshold range where the object is located is determined, and the level of the mesh where the object is located is determined.

[0023] A second aspect of the present invention provides a lightweight rendering device for a Revit model, comprising:

[0024] A layering module is used to obtain the mesh grid of the Revit model and perform layering processing on the mesh grid;

[0025] The extraction module is used to extract the incremental difference information between meshes at different levels;

[0026] A determination module, used to traverse all objects in the scene and determine the level of the mesh corresponding to the object;

[0027] The rendering module is used to incrementally load each mesh level in the scene and batch render all objects at the same level.

[0028] Furthermore, the hierarchical module uses a triangular mesh surface reduction algorithm to reduce the mesh surface according to different surface reduction ratios to obtain mesh surfaces of different levels.

[0029] Furthermore, the extraction module is used to find the difference between mesh grids at adjacent levels to obtain the incremental difference information between mesh grids at different levels.

[0030] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the processor processes the Revit model lightweight rendering method.

[0031] A fourth aspect of the present invention further provides an electronic device, the electronic device comprising:

[0032] processor; and,

[0033] A memory is arranged to store computer executable instructions, which, when executed, cause the processor to perform the Revit model lightweight rendering method.

[0034] The present invention provides a lightweight rendering method and device for a Revit model. The method obtains a mesh grid of a Revit model, processes the mesh grid in layers; extracts incremental difference information between mesh grids of different layers; traverses all objects in the scene to determine the layer of the mesh grid corresponding to the object; and uses the layer of the mesh grid where the currently rendered object is located as a reference to load incremental difference information to render objects of other layers. The mesh grid of the Revit model is processed in layers to determine the difference information between mesh grids of different layers. When rendering, incremental difference information is added to objects of different layers as required to render objects of different layers. The present invention loads and renders display content of different layers on demand, reducing the amount of calculation and improving the calculation speed. BRIEF DESCRIPTION OF THE DRAWINGS

[0035] Figure 1 This is a flow chart of a lightweight rendering method for a Revit model provided in Example 1 of the present invention. DETAILED DESCRIPTION

[0036] In order to clearly and comprehensively present the technical solution of the present invention, the present invention is described below in conjunction with the accompanying drawings, but the scope of the present invention is not limited thereto.

[0037] See also Figure 1 A flow chart of a lightweight rendering method for a Revit model provided in Embodiment 1 of the present invention includes:

[0038] L1: Obtain the mesh of the Revit model and perform layered processing on the mesh.

[0039] The Revit model contains a large number of mesh grids, each mesh grid represents a certain type of object in the Revit model. Such objects in the Revit model present different states and display ranges due to their different distances from the camera. In order to render the Revit model more conveniently and efficiently, the present invention performs layered rendering on the mesh grids, reduces the data loaded during the rendering process, and improves the rendering efficiency.

[0040] In an embodiment of the present invention, a mesh is composed of triangular facets, and the number of triangular facets in meshes of different levels is also different. Based on this principle, the present invention adopts a triangular mesh face reduction algorithm to reduce the mesh according to different face reduction ratios, and obtains meshes of different levels.

[0041] The above-mentioned face reduction ratio refers to the ratio of reduced triangular facets to total triangular facets. Different face reduction ratios correspond to different mesh levels. For example, when the face reduction ratio is 0.3 or 0.5, a small face reduction ratio means that fewer triangular facets are reduced, and the number of triangular facets corresponding to the object to be rendered is more, indicating that the corresponding level is higher. Preferably, the mesh of the present invention is divided into 10 levels.

[0042] The triangular mesh reduction algorithm includes the following steps:

[0043] S1 initializes the error matrix for each vertex of the mesh.

[0044] The error is Delta = vT(Q)v, and the error matrix Q is the sum of the quadratic error matrices of all planes connected to the vertex, and the formula is as follows.

[0045] Among them, the vertex vector is v = [vx, vy, vz, 1].

[0046]

[0047] Each plane can be solved by substituting the coordinates of the three vertices of the triangle into the formula ax+by+cz+d=0, and then adding the formula (a2+b2+c2=1) to obtain the values ​​of a, b, c, and d.

[0048] If the vector entered is a vertex coordinate, the error matrix is ​​0.

[0049] S2 calculates the replacement point of the collapsed edge for the two vertices of each edge, calculates the shrinkage cost, and selects the point with the smallest shrinkage cost as the replacement point.

[0050] Assume that the vertices of each edge are v1 and v2, calculate the replacement point of the collapsed edge based on the vertex, and calculate the shrinkage cost of the collapsed edge.

[0051] The optimal replacement point for vertices v1 and v2 is calculated by selecting the point with the smallest shrinkage cost between v1 and v2. The shrinkage cost is the error Delta calculated by the sum of the error matrices Q1 and Q2 of v1 and v2 and the position vector of the replacement point.

[0052] S3 sorts the shrinkage costs according to their magnitude, and removes the edge with the smallest shrinkage cost.

[0053] Every time one or more edges are removed, one or more triangles will be deleted accordingly, thus completing the face reduction.

[0054] S4 removes all connecting edges between the two vertices, and updates the error matrix of the vertex and its adjacent nodes.

[0055] After completing one face reduction process, reselect the vertices and calculate the error matrix, and continue the next round of face reduction operation, looping steps S1-S4 until there are no collapsed edges.

[0056] L2: Extract incremental difference information between meshes at different levels.

[0057] Since the mesh grid is divided into many different levels, the number of triangles included in the mesh grid of each level is different. Therefore, in order to obtain the incremental difference information between adjacent mesh grids, the present invention subtracts the mesh grids of the adjacent levels to obtain mesh grids of different levels.

[0058] When on-demand loading is required, the incremental difference information is directly added to the existing level, so that meshes at different levels can be rendered.

[0059] L3: Traverse all objects in the scene and determine the mesh level corresponding to the object.

[0060] For a specific scene, we need to render the objects at which level, and we need to call the mesh pairs at which level to render accordingly, so we need to layer the objects. In an embodiment of the present invention, layering the objects includes:

[0061] The distance of each object is calculated by calculating the distance (d) from the center of the bounding box to the camera. All d are sorted from large to small. Assuming they are divided into 10 levels, a threshold is taken for every 10 percentile, from the 10th percentile to the 90th percentile, which is 10 range thresholds t.

[0062] The outer bounding box is calculated by taking the three largest points and the three smallest points in the x, y, and z dimensions. The average of the 18 points is the center point.

[0063] For each object, the distance d is compared with the threshold t to determine the LOD level of the object. The formula for calculating the level is:

[0064]

[0065] L4: Incrementally load each mesh level in the scene and batch render all objects at the same level.

[0066] Assuming that the current level is the lowest level mesh rendering, when we render a higher level mesh, we only need to load the incremental difference information based on the lowest level to achieve the rendering of the higher level mesh and batch render all objects at the same level.

[0067] The present invention provides a lightweight rendering method and device for a Revit model. The method obtains a mesh grid of a Revit model, processes the mesh grid in layers; extracts incremental difference information between mesh grids of different layers; traverses all objects in the scene to determine the layer of the mesh grid corresponding to the object; and uses the layer of the mesh grid where the currently rendered object is located as a reference to load incremental difference information to render objects of other layers. The mesh grid of the Revit model is processed in layers to determine the difference information between mesh grids of different layers. When rendering, incremental difference information is added to objects of different layers as required to render objects of different layers. The present invention loads and renders display content of different layers on demand, reducing the amount of calculation and improving the calculation speed.

[0068] A second aspect of the present invention provides a lightweight rendering device for a Revit model, comprising:

[0069] A layering module is used to obtain the mesh grid of the Revit model and perform layering processing on the mesh grid;

[0070] The extraction module is used to extract the incremental difference information between meshes at different levels;

[0071] A determination module, used to traverse all objects in the scene and determine the level of the mesh corresponding to the object;

[0072] The rendering module is used to incrementally load each mesh level in the scene and batch render all objects at the same level.

[0073] Furthermore, the hierarchical module uses a triangular mesh surface reduction algorithm to reduce the mesh surface according to different surface reduction ratios to obtain mesh surfaces of different levels.

[0074] Furthermore, the extraction module is used to find the difference between mesh grids at adjacent levels to obtain the incremental difference information between mesh grids at different levels.

[0075] A third aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the processor processes the Revit model lightweight rendering method.

[0076] A fourth aspect of the present invention further provides an electronic device, the electronic device comprising:

[0077] processor; and,

[0078] A memory is arranged to store computer executable instructions, which, when executed, cause the processor to perform the Revit model lightweight rendering method.

[0079] Although the present invention has been described in detail above by general description and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made to the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all belong to the scope of protection claimed by the present invention.

Claims

1. A lightweight rendering method for a Revit model, characterized in that: Includes steps: Obtaining mesh grids of the Revit model, and processing the mesh grids in layers, wherein each mesh grid represents a certain type of object in the Revit model, and such objects in the Revit model present different states and display ranges due to different distances from the camera; Extract the incremental difference information between meshes of different levels. The number of triangles in meshes of different levels is different. The difference of meshes of adjacent levels is calculated to obtain the incremental difference information between meshes of different levels. Traverse all objects in the scene and determine the mesh level corresponding to the object; Incrementally load each mesh level in the scene and batch render all objects at the same level.

2. The lightweight rendering method of Revit model according to claim 1, characterized in that: The mesh is layered, specifically: a triangular mesh surface reduction algorithm is used to reduce the surface of the mesh according to different surface reduction ratios, and meshes of different levels are obtained.

3. The lightweight rendering method of Revit model according to claim 2, characterized in that: The triangular mesh surface reduction algorithm comprises the steps of: S1 initializes the error matrix of each vertex of the mesh; S2 calculates the replacement point of the collapsed edge for the two vertices of each edge, calculates the shrinkage cost, and selects the point with the smallest shrinkage cost as the replacement point; S3 sorts the shrinkage costs according to their magnitude, and removes the edge corresponding to the minimum shrinkage cost; S4 removes all connecting edges of the two vertices and updates the error matrix of the vertex and its adjacent nodes; Steps S1-S4 are repeated until there are no collapsed edges.

4. The lightweight rendering method of Revit model according to claim 1, characterized in that: The mesh grid is divided into 10 different levels; determining the level of the mesh grid corresponding to the object includes the steps of: Calculate the distance from the center of each object's bounding box to the camera; Sort the distances corresponding to all objects by size and set thresholds every 10 percentiles; The distance from the object to the camera is compared with the threshold, the threshold range where the object is located is determined, and the level of the mesh where the object is located is determined.

5. A lightweight rendering device for Revit models, characterized in that: include: A layering module is used to obtain mesh grids of the Revit model and perform layered processing on the mesh grids, wherein each mesh grid represents a certain type of object in the Revit model. Such objects in the Revit model have different states and display ranges due to different distances from the camera; The extraction module is used to extract the incremental difference information between meshes of different levels. The number of triangles in meshes of different levels is different. The meshes of adjacent levels are subtracted to obtain the incremental difference information between meshes of different levels. A determination module, used to traverse all objects in the scene and determine the mesh level corresponding to the object; The rendering module is used to incrementally load each mesh level in the scene and batch render all objects at the same level.

6. The lightweight rendering device for Revit model according to claim 5, characterized in that: The layering module uses a triangular mesh surface reduction algorithm to reduce the mesh surface according to different surface reduction ratios to obtain mesh surfaces of different levels.

7. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the processor processes the lightweight rendering method for a Revit model according to any one of claims 1 to 4.

8. An electronic device, comprising: processor; as well as, A memory arranged to store computer executable instructions, which, when executed, cause the processor to execute the Revit model lightweight rendering method described in any one of claims 1-4.

Citation Information

Patent Citations

  • Rendering method and device for semitransparent object in scene and electronic equipment

    CN109741413A

  • Image rendering method and device and electronic equipment

    CN112370777A

  • Telescopic BIM model lightweight scheme

    CN112434365A