A model display control method, device and medium based on a digital twin system

By using simplification rates in the digital twin system to simplify the model components and render and display control based on attribute data, the problem of slow speed of the digital twin system when loading complex and fine models is solved, and efficient model loading and display control is achieved.

CN119579751BActive Publication Date: 2025-05-30GUANGZHOU FRONTOP DIGITAL ORIGINALITY TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510131617.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-06
Publication Date
2025-05-30
Estimated Expiration
2045-02-06

AI Technical Summary

Technical Problem

Digital twin systems are slow to load complex and fine models, and traditional technologies and hardware are difficult to achieve real-time rendering and interaction, resulting in difficulty in controlling model display.

Method used

By obtaining comprehensive information of the model, the simplification rate is used to simplify the model components, reduce the amount of data, and render and display control based on the attribute data of the component set. The simplification rate is determined based on the distance between the component and the model surface and the degree of light and darkness of the material.

Benefits of technology

It significantly reduces the amount of data of the model, improves loading speed, improves system performance, and ensures that the simplified model maintains a high standard in visual quality, achieving effective display control of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119579751B_ABST
    Figure CN119579751B_ABST
Patent Text Reader

Abstract

The present invention discloses a model display control method, device and medium based on a digital twin system. The method includes: obtaining comprehensive information of a model; performing polygon simplification on components of the model according to the simplification rate of the components in the comprehensive information to obtain a simplified component set; rendering the component set according to the attribute data of the component set, and performing display control on the component set of the rendered model. The present invention proposes a model display control method, device and medium based on a digital twin system. Using the simplification rate to perform precise polygon simplification on model components significantly reduces the model data volume, thereby accelerating the loading speed and improving the system performance; using the attribute data of the component set for rendering and display control ensures that the model can still present high-quality visual effects after simplification, and can solve the problem that it is difficult to improve the loading speed of the model and thus perform effective display control on the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular, to a model display control method, device and medium based on a digital twin system. Background Art

[0002] In the physical world, large buildings often consist of basic components in the order of hundreds of thousands, millions or even tens of millions; the corresponding digital twin model has the characteristics of large file size, many types of components, and different component materials and fineness; based on the complex and fine model, the digital twin system can apply intelligent algorithms such as big data analysis and machine learning to realize intelligent monitoring and prediction of the system operation state. In traditional methods, the digital twin system creates a three-dimensional model by collecting data of the actual physical system, imports it into the system, and uses a rendering engine and an interactive control tool to load, display and control these complex and fine models.

[0003] However, because the model data of complex and fine models is huge and the loading process takes a long time, the digital twin system has a slow model loading speed; at the same time, due to the performance bottleneck of traditional technologies and hardware in processing high-precision models, it is difficult to achieve real-time rendering and interaction, so effective display control of the model also faces severe challenges. Summary of the Invention

[0004] The present invention provides a model display control method, device and medium based on a digital twin system to solve the problem of difficultly improving the model loading speed and thus effectively displaying and controlling the model.

[0005] Obtain the comprehensive information of the model;

[0006] Perform polygon simplification on the components of the model according to the simplification rate of the components in the comprehensive information to obtain a simplified component set; wherein, the simplification rate is determined according to the distance between the component and the model surface and the brightness of the component material after processing the comprehensive information in the way of mapping the component distance.

[0007] Render the component set according to the attribute data of the component set, and perform display control on the component set of the model after rendering.

[0008] The polygon simplification in the present invention can significantly reduce the data volume of the model, thereby reducing the loading time and improving the loading speed of the model. Since the rendering algorithm optimizes according to the attribute data of the components to restore the visual effect of the original model as much as possible, the rendering process can ensure that the simplified model still maintains a high visual quality. The display control allows users to perform interactive operations on the model as needed, which can ensure that users can accurately observe and operate the model, improving the usability and practicality of the model. Among them, for the simplification rate, the data mapping process can convert the comprehensive information of the model into a unified standard scale, facilitating subsequent quantitative analysis and comparison; moreover, the simplification rate is established based on factors such as the distance of the component from the model surface and the brightness and darkness of the model material. This means that during the simplification process, components that are farther from the model surface or have a lower brightness and darkness of the material will be simplified more. This method can significantly reduce the data volume of the model, especially those detail parts that have less impact on the overall visual effect, thereby reducing the data volume to be processed during loading, improving the loading speed, reducing lags and delays, and achieving effective display control of the model.

[0009] Compared with the prior art, the present invention uses the simplification rate to perform precise polygon simplification on the model components, significantly reducing the model data volume, thereby accelerating the loading speed and improving the system performance; using the attribute data of the component set for rendering and display control ensures that the model can still present a high-quality visual effect after simplification, so it can solve the problem of being difficult to improve the loading speed of the model and thus perform effective display control on the model.

[0010] As a preferred solution, the simplification rate is determined according to the distance between the component and the model surface and the brightness and darkness of the component material after processing the comprehensive information in the way of mapping the component distance, specifically:

[0011] According to the comprehensive information, calculate the distance between the mesh grid of each component and the mesh grid of the outer surface of the model respectively as the first distance set of the model;

[0012] Continuously map the first distance set to a preset numerical range, and establish a distance-based simplification rate linear equation according to the mapped first distance set;

[0013] Establish a simplification rate function according to the brightness and darkness of the component material in the model;

[0014] Calculate the simplification rate of the components in the comprehensive information according to the simplification rate linear equation and the simplification rate function.

[0015] In this preferred solution, by calculating the exact distance between the component mesh and the outer surface mesh of the model, the geometric relationships inside the model can be carefully captured, providing a reliable data basis for subsequent simplification operations; by continuously mapping the first distance set to a preset numerical range, the mapping rule can be adjusted as needed to adapt to different simplification requirements and accuracy requirements; by establishing a linear equation of the simplification rate based on distance, the linear relationship between distance and simplification rate can be intuitively reflected, making the simplification operation more scientific and reasonable. Considering the light and dark degree of the component materials in the model into the simplification rate function further improves the accuracy and adaptability of the simplification rate.

[0016] As a preferred solution, render the component set according to the attribute data of the component set, and perform display control on the component set of the model after rendering, specifically:

[0017] Classify the component set according to the component materials, and obtain the first component set by merging the component meshes of the same material;

[0018] Based on the first component set, merge the textures included in the mesh grids of each material type to obtain the second component set;

[0019] Render the second component set, and perform display control on the component set of the rendered model.

[0020] In this preferred solution, by merging the meshes of the same material, the number of material calls during rendering can be significantly reduced, thereby reducing the communication overhead between the CPU and GPU and improving the rendering efficiency. Merging meshes and textures can reduce the number of objects in memory, especially when there are a large number of similar objects in the scene, this method can significantly save memory resources.

[0021] As a preferred solution, classify the component set according to the component materials, and obtain the first component set by merging the component meshes of the same material, specifically:

[0022] Traverse each component in the component set to obtain a field data set related to the material;

[0023] If the field data in the field data set are equal, classify the corresponding components into one category to obtain the classification result of the component set;

[0024] Merge and mark the vertices of the mesh grids of the same material in the classification result of the component set to obtain the first component set.

[0025] In this preferred solution, classifying components of the same material into one category and merging their mesh grid vertices helps to maintain the consistency of the model in terms of materials and avoid problems of material confusion or inconsistency.

[0026] As a preferred solution, based on the first component set, the textures included in the mesh of each type of material are merged to obtain a second component set, specifically:

[0027] Based on the first component set, according to the total size of all small texture images and the target expansion size, the total size of the large texture image is calculated;

[0028] On the large texture image, a unique and non-overlapping designated position is determined for all the small texture images according to the total size, and all the small texture images are pasted to the designated position on the large texture image to obtain a transitional construction set containing the large texture image;

[0029] The texture coordinates of the large texture image in the transitional construction set are updated to obtain the second component set.

[0030] In this preferred solution, by determining a unique and non-overlapping designated position for all small texture images on the large texture image, the overlap and conflict of textures during the rendering process are avoided, and the accuracy and stability of rendering are improved. During the rendering process, since all textures are integrated in the large texture image, the number of texture switches can be reduced, thereby reducing the rendering overhead and improving the rendering efficiency.

[0031] As a preferred solution, the texture coordinates of the large texture image in the transitional construction set are updated to obtain the second component set, specifically:

[0032] The UV coordinates of each vertex in all the small texture images are obtained to get an initial coordinate set;

[0033] Based on the offset of all the small texture images in the large texture image and the initial coordinate set, the actual UV coordinate set is calculated according to the overall size of the large texture image;

[0034] The corresponding values of the texture coordinates of the large texture image in the transitional construction set are updated according to the actual UV coordinate set to obtain the second component set.

[0035] In this preferred solution, when calculating the actual UV coordinate set, the offset of the small texture images in the large texture image is considered. This method ensures that even after the small texture images are integrated into the large texture image, the textures can still be correctly mapped to the model surface. And, since the UV coordinates and offsets of each vertex are considered, the problems of texture breakage or misalignment during the rendering process can be avoided, which helps to maintain the texture consistency and continuity of the model surface.

[0036] As a preferred solution, the second component set is rendered, and display control is performed on the rendered model component set, specifically:

[0037] Set corresponding material parameters according to the material information of the second component set;

[0038] Generate texture data based on the texture map of the second component set and activate the texture unit corresponding to the texture data;

[0039] Generate a rendering image of the second component set according to the material parameters, the texture data, and the mesh data of the second component set, and display the model in the rendering window in the form of the rendering image;

[0040] Control the second component set of the model according to the unique identifier of the component in the second component set.

[0041] In this preferred solution, corresponding material parameters are set according to the material information of the second component set, which can precisely control the material performance of the model, such as color, glossiness, transparency, etc., thereby enhancing the visual effect of the model. Generating texture data based on the texture map of the second component set and activating the corresponding texture unit can ensure the precise mapping and display of the texture on the model surface, which helps to improve the detail expressiveness and realism of the model.

[0042] As a preferred solution, polygon simplification is performed on the components of the model according to the simplification rate of the components in the comprehensive information to obtain a simplified component set, specifically:

[0043] Establish a simplification rate target according to the simplification rate of the components in the comprehensive information;

[0044] Establish a Laplacian matrix based on the mesh in the model and perform eigenvalue decomposition to obtain an eigenvalue set;

[0045] Obtain several eigenvalues less than a preset value in the eigenvalue set, remove the eigenvectors corresponding to the several eigenvalues, and obtain a spectral simplification result;

[0046] Evaluate the influence degree of each vertex and edge on the overall shape of the mesh according to the shape characteristics of the mesh in the model to obtain an importance evaluation result;

[0047] Remove vertices and edges that do not meet the preset conditions according to the importance evaluation result to obtain a shape simplification result;

[0048] Perform iterative simplification processing on the components of the model until the spectral simplification result or the shape simplification result meets the simplification rate target to obtain the simplified component set.

[0049] In this preferred solution, an important feature of the digital twin city is dynamic visualization and intelligent deduction. Complex models may make dynamic visualization blurred or difficult to understand, and may also make the results of intelligent deduction inaccurate or difficult to interpret. Therefore, the model functions may be difficult to implement or the effects may be greatly reduced. Through eigenvalue decomposition and importance evaluation, unnecessary details that do not affect the overall shape or function of the model can be identified and removed, thereby reducing the complexity of the model; by removing redundant information, the simplified model can more accurately reflect the core features and laws of the urban system, thereby improving the accuracy and credibility of the intelligent deduction results; moreover, the clarity and fluency of dynamic visualization can be improved, enabling users to more easily understand and use the digital twin city system.

[0050] As a preferred solution, the influence degree of each vertex and edge on the overall shape of the grid is evaluated according to the shape characteristics of the grid in the model, and the importance evaluation result is obtained. Specifically:

[0051] According to the concavity and convexity of the grid in the model, the curvature calculation result is calculated;

[0052] According to the side lengths and angles of the triangles connected to the grid vertices in the model, the geometric feature calculation result is calculated;

[0053] According to the grid side length in the model and the flatness of the triangles on both sides of the edge, the edge importance influence result is calculated;

[0054] According to the preset weight coefficient set, linear combination calculation is performed on the curvature calculation result, the geometric feature calculation result, and the edge importance influence result to obtain the importance evaluation result.

[0055] In this preferred solution, the models that need to be controlled in the digital twin city usually contain a large number of grid elements and complex geometric shapes, which makes it particularly difficult to evaluate the importance of each element. By calculating the curvature of the grid, the geometric features of the triangles connected to the vertices, and the importance influence of the edges, various shape, size, and topological structure features of the grid elements in the model can be captured; this solution formulates a unified and comprehensive evaluation standard for different grid elements, which can effectively solve the problem of evaluating the importance of grid elements in the digital twin city model and provide a more accurate and reliable basis for model simplification.

[0056] This application also provides a model display control device based on the digital twin system, which is applicable to the digital twin city system and includes an information module, a simplification module, and a control module;

[0057] Among them, the information module is used to obtain the comprehensive information of the model;

[0058] The simplification module is used to perform polygon simplification on the components of the model according to the simplification rate of the components in the comprehensive information, so as to obtain a set of simplified components; wherein, the simplification rate is determined according to the distance between the component and the model surface and the brightness of the component material after processing the comprehensive information in the way of mapping the component distance.

[0059] The control module is used to render the set of components according to the attribute data of the set of components, and perform display control on the set of components of the model after rendering.

[0060] As a preferred solution, the simplification module includes a distance unit, a mapping unit, a function unit and a simplification rate unit;

[0061] Among them, the distance unit is used to calculate the distance between the mesh of each component and the mesh of the outer surface of the model according to the comprehensive information, as the first distance set of the model;

[0062] The mapping unit is used to continuously map the first distance set to a preset numerical range, and establish a linear equation of the simplification rate based on distance according to the mapped first distance set;

[0063] The function unit is used to establish a simplification rate function according to the brightness of the component material in the model;

[0064] The simplification rate unit is used to calculate the simplification rate of the components in the comprehensive information according to the linear equation of the simplification rate and the simplification rate function.

[0065] As a preferred solution, the control module includes a material unit, a texture unit and a rendering unit;

[0066] Among them, the material unit is used to classify the set of components according to the component material, and obtain a first set of components by merging the component meshes of the same material;

[0067] The texture unit is used to merge the textures included in the mesh of each material category based on the first set of components, so as to obtain a second set of components;

[0068] The rendering unit is used to render the second set of components, and perform display control on the set of model components after rendering.

[0069] As a preferred solution, the material unit includes a field subunit, a classification subunit and a marking subunit;

[0070] Among them, the field subunit is used to traverse each component in the set of components to obtain a field data set related to the material;

[0071] The classification subunit is used to classify the corresponding components into one category if the field data in the field dataset are equal, so as to obtain the classification result of the component set;

[0072] The marking subunit is used to merge and mark the mesh vertices of the same material in the classification result of the component set to obtain the first component set.

[0073] As a preferred solution, the texture unit includes a size subunit, a pasting subunit, and an updating subunit;

[0074] Among them, the size subunit is used to calculate the total size of the large texture image based on the first component set, according to the total size of all small texture images and the target expansion size;

[0075] The pasting subunit is used to determine a unique and non-overlapping specified position for all the small texture images on the large texture image according to the total size, and paste all the small texture images to the specified position of the large texture image to obtain a transitional construction set containing the large texture image;

[0076] The updating subunit is used to update the texture coordinates of the large texture image in the transitional construction set to obtain the second component set.

[0077] As a preferred solution, the updating subunit is specifically:

[0078] Obtain the UV coordinates of each vertex in all the small texture images to obtain an initial coordinate set;

[0079] According to the offset of all the small texture images in the large texture image and the initial coordinate set, calculate the actual UV coordinate set based on the overall size of the large texture image;

[0080] Update the corresponding values of the texture coordinates of the large texture image in the transitional construction set according to the actual UV coordinate set to obtain the second component set.

[0081] As a preferred solution, the rendering unit includes a parameter subunit, an activation subunit, a display subunit, and a control subunit;

[0082] Among them, the parameter subunit is used to set corresponding material parameters according to the material information of the second component set;

[0083] The activation subunit is used to generate texture data according to the texture map of the second component set and activate the texture unit corresponding to the texture data;

[0084] The display subunit is configured to generate a rendered image of the second component set according to the material parameter, the texture data, and the mesh data of the second component set, and display the model in the rendering window in the form of the rendered image;

[0085] The control subunit is configured to control the second component set of the model according to the unique identifier of the component in the second component set.

[0086] As a preferred solution, the simplification module includes a target unit, a feature unit, a spectrum unit, a shape unit, a simplification unit, and a component set unit;

[0087] Among them, the target unit is configured to establish a simplification rate target according to the simplification rate of the component in the comprehensive information;

[0088] The feature unit is configured to establish a Laplace matrix based on the mesh in the model and perform eigenvalue decomposition to obtain an eigenvalue set;

[0089] The spectrum unit is configured to obtain a plurality of eigenvalues less than a preset value in the eigenvalue set, remove the eigenvectors corresponding to the plurality of eigenvalues, and obtain a spectrum simplification result;

[0090] The shape unit is configured to evaluate the influence degree of each vertex and edge on the overall shape of the mesh according to the shape characteristics of the mesh in the model, and obtain an importance evaluation result;

[0091] The simplification unit is configured to remove vertices and edges that do not meet the preset conditions according to the importance evaluation result, and obtain a shape simplification result;

[0092] The component set unit is configured to perform iterative simplification processing on the components of the model until the spectrum simplification result or the shape simplification result meets the simplification rate target, and obtain the simplified component set.

[0093] As a preferred solution, the shape unit includes a curvature subunit, a side length subunit, a flatness subunit, and a combination subunit;

[0094] Among them, the curvature subunit is configured to calculate a curvature calculation result according to the concavity and convexity of the mesh in the model;

[0095] The side length subunit is configured to calculate a geometric feature calculation result according to the side length and angle of the triangle connected to the mesh vertex in the model;

[0096] The flatness subunit is configured to calculate an edge importance influence result according to the mesh side length in the model and the flatness of the triangles on both sides of the edge;

[0097] The combinatorial subunit is configured to perform a linear combination calculation on the curvature calculation result, the geometric feature calculation result, and the edge importance influence result according to a preset weight coefficient set, so as to obtain the importance evaluation result.

[0098] The present application also provides a storage medium, on which a computer program is stored. The computer program is called and executed by a computer to implement the above-mentioned model display control method based on a digital twin system. Description of the Drawings

[0099] Figure 1 is a schematic flowchart of a model display control method based on a digital twin system provided by an embodiment of the present application;

[0100] Figure 2 is a simplified rate curvature graph based on distance provided by an embodiment of the present application;

[0101] Figure 3 is a simplified rate curve graph based on material shading provided by an embodiment of the present application;

[0102] Figure 4 is a technical implementation flowchart provided by an embodiment of the present application;

[0103] Figure 5 is a schematic structural diagram of a model display control device based on a digital twin system provided by an embodiment of the present application. Detailed Embodiments

[0104] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative efforts shall fall within the protection scope of the present application.

[0105] In the description of the present application, it should be understood that the terms "first" and "second" are only used for descriptive purposes, and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present application, unless otherwise stated, the meaning of "several" is two or more.

[0106] A model display control method based on a digital twin system provided by an embodiment of the present application is mainly applied to situations where it is necessary to accelerate the model loading speed of a digital twin city system and improve the rendering efficiency, so as to effectively control the display of the model.

[0107] Embodiment 1:

[0108] Please refer to Figure 1 , an embodiment of the present application provides a model display control method based on a digital twin system, which is applicable to a digital twin city system and includes S1 to S3. The specific implementation steps are as follows:

[0109] S1. Obtain the comprehensive information of the model.

[0110] Step S1 of the embodiment of the present application is specifically:[[]]

[0111] Load the model through the digital twin city system, open and parse the model file, and obtain the model component list; among them, the "digital twin city system" is a technical system that transforms all aspects of the physical world of a city into digital form. Through real-time data exchange and simulation analysis between the cyber space and the physical world, it can achieve comprehensive monitoring, prediction, and optimization of the city's operating state;

[0112] Traverse each component of the model according to the model component list, obtain the attribute information of each component, and store the attribute information in the database table (inf table) according to preset rules;

[0113] Obtain the geometric information (mesh) of each component, and store the geometric information in the database mesh table according to preset rules;

[0114] The comprehensive information of the model is composed of the separated attribute information and geometric information.

[0115] Among them, each row record in the inf table represents the attribute information of the component. The record contains two fields: featureId and inf, where featureId is the component id parsed from the model file, and inf is the attribute set of the component. The example is as follows: featureId: "90b2daded26f183e3ddeb5ca17c8e00a", inf: "{"name": "wall", "attribute 1": "100 cubic", "attribute 2": "built in August 2021"}";

[0116] Each row record in the mesh table represents the geometric information of a component, where featureId is the unique identifier of the component, and value is the mesh data of the component; the mesh data includes the vertex coordinates of the triangular mesh (such as a vertex is "{x, y, z}"), vertex normal, texture data (texture image file path), texture coordinates {u, v}, material information (diffuse reflection, specular reflection parameters, ambient light, glossiness), etc. parameters.

[0117] S2. Simplify the components of the model according to the simplification rate of the components in the comprehensive information to obtain a set of simplified components; wherein, the simplification rate is determined according to the distance between the component and the model surface and the light and dark degree of the component material after processing the comprehensive information in the way of mapping the component distance.

[0118] Step S2 of the embodiment of the present application includes S2.1 to S2.2, wherein S2.1 is the process of calculating the simplification rate, and S2.2 is the process of simplifying the model according to the simplification rate. Specifically:

[0119] S2.1. According to the comprehensive information, calculate the distance between the mesh of each component and the mesh of the outer surface of the model respectively as the first distance set of the model. The example is as follows: The computational geometry algorithms library (CGAL for short) can be used to calculate the outer surface mesh of the model, and then calculate the distance between the component mesh and the outer surface mesh of the model to obtain the distance d of the component; correspondingly, there is a maximum component distance and a minimum component distance ; wherein, "mesh grid" is a data structure composed of elements such as vertices, edges, and faces (usually triangles or quadrilaterals).

[0120] Continuously map the first distance set to the space of [0-1], and establish a linear equation of the simplification rate based on the mapped first distance set ; wherein, for the mapped first distance set, the maximum value of d is 1, the minimum value is 0, and the intermediate values are taken at equal ratio differences;

[0121] Establish a simplification rate function m(x) according to the light and dark degree of the component material in the model;

[0122] According to the linear equation of the simplification rate and the simplification rate function m(x), calculate the simplification rate of the components in the comprehensive information .

[0123] Among them, the intermediate value is:

[0124]

[0125] The linear equation of the simplification rate is:

[0126]

[0127] The simplification rate function is:

[0128]

[0129] The simplification rate is:

[0130]

[0131] Wherein, x represents the distance of each component from the model surface, represents the maximum value of the distance between the component and the model surface; represents the simplification rate (such as 0.8) adopted when the component is closest to the surface, represents the simplification rate (such as 0.3) adopted when the component is farthest from the surface;

[0132] represents the reference simplification rate set when the material is extremely bright or extremely dark; b represents the value of x when the maximum simplification rate is obtained, and c is a preset parameter, is a mathematical constant, represents the light and dark degree of the material;

[0133] is a preset value, which can be set according to experience, for example if 0.8 is taken, then m(x) adopts 0.2; a more complex weight calculation method can also be set, for example can be designed as a function with distance as the independent variable, and the influence weight of d(x) on the total simplification rate is different at different distances, so as to achieve more precise simplification rate control.

[0134] For the application of the embodiments of the present application, please refer to Figures 2 - 3 ;

[0135] Figure 2 is the distance-based simplification rate curve diagram provided by the embodiments of the present application, indicating and the value-taking situation; Figure 2 In, for the simplification rate linear equation in terms of, , it can be seen that the smaller the distance, the closer the component is to the model surface, and the larger the simplification rate that needs to be set. And the simplification rate is the percentage value of the number of triangular faces retained.

[0136] Figure 3 is the simplification rate curve diagram based on the light and dark degree of the material provided by the embodiments of the present application. Among them, the 4 curves represent examples when c takes four values. In actual application, one can be selected according to specific circumstances; the x-axis represents the light and dark value of the material, and the value range is [0,1]; the y-axis represents the simplification rate corresponding to a certain light and dark, and the value range is ( , according to Figure 3That is, (0.3, 0.8]. It can be seen from the curve that when it is extremely dark, x = 0.0, and at this time the simplification rate is close to 0.3; when it is extremely bright, x = 1.0, and at this time the simplification rate is close to 0.3. However, when the light and dark value takes values between 0 and 1, it is simplified into a parabolic change situation.

[0137] In Figure 3 , for the simplification rate function m(x), c affects the width of the protruding part of the curve. Because the value of x in this simplification function is in [0 - 1], m(x) is in ( interval, and the opening of the curve is downward; the smaller c is, the narrower the protruding part of the curve is, indicating that when x is in a small range (narrow interval) of light and dark intervals, the simplification rate changes more significantly than in other intervals. It can be seen that the light and dark degree and the simplification rate are not in a linear increasing or decreasing relationship, but a curve, indicating that in a certain interval of light and dark, the simplification rate is large, and it decreases symmetrically in other regions. Among them, " " represents the set maximum simplification rate.

[0138] In Figure 3 , = 0.3, + = 0.8, that is, range = 0.5. When the curve peaks, x = 0.5, that is, b = 0.5. Among them, x represents the light and dark degree of the material, which is obtained by adding the diffuse brightness, specular brightness, ambient brightness, and shininess {value} of the material (diffuse reflection, specular reflection, and ambient light use three-channel data, such as {r, g, b}, and shininess is single-channel data. Each channel value of all parameters is between 0 and 1):

[0139]

[0140] When the material is extremely bright (x = 1) and extremely dark (x = 0), the simplification rate of this part is 0.3 (the number of triangular faces needs to be reduced to 30% of the original); when the material is between extremely bright and extremely dark, the simplification rate is 0.8 (the number of triangular faces is reduced to 80% of the original); therefore, through the designed simplification rate function m(x), the difference degree of the simplification rate between components can be adjusted.

[0141] From Figure 3As can be seen from the curve, by setting the four parameters, it is possible to achieve when the light and darkness obtain the maximum or minimum simplification rate; it is also possible to achieve whether the simplification rate changes smoothly or rapidly in different light and darkness intervals. In practical applications, it is necessary to retain as many triangular meshes as possible for some components of certain materials, while retaining as few triangular meshes as possible for other components. For example: if it is required that when the light and darkness are between 0.4 and 0.6, the model retains more triangles (the simplification rate is large), and when reaching other light and darkness levels, the model is as small as possible, then c can take a relatively small value.

[0142] In this embodiment, S2.1 can accurately capture the geometric relationship inside the model by calculating the exact distance between the component mesh and the outer surface mesh of the model, providing a reliable data basis for subsequent simplification operations; continuously mapping the first distance set to a preset numerical range, the mapping rule can be adjusted according to needs to adapt to different simplification requirements and accuracy requirements; establishing a linear equation of the simplification rate based on the distance can intuitively reflect the linear relationship between the distance and the simplification rate, making the simplification operation more scientific and reasonable. Incorporating the light and darkness level of the component material in the model into the consideration range of the simplification rate function further improves the accuracy and adaptability of the simplification rate;

[0143] Moreover, the simplification rate function constructed in this embodiment can ensure that the simplification rate is between and the maximum values. By inputting different light and darkness values according to the function algorithm, the corresponding simplification rate can be obtained.

[0144] S2.2. Establish a simplification rate target according to the simplification rate of the component in the comprehensive information ;

[0145] Regard the mesh in the model as a graph structure, establish the corresponding Laplace matrix and perform eigenvalue decomposition to obtain the eigenvalue set and the corresponding eigenvector set; among them, the Laplace matrix can reflect the connection relationship and boundary conditions between the mesh vertices, the eigenvalue represents the spectral information of the mesh, and the eigenvector represents different spectral components of the mesh;

[0146] Obtain several eigenvalues in the eigenvalue set that are less than the preset value, remove the eigenvectors corresponding to the several eigenvalues, and obtain the spectral simplification result.

[0147] Obtain the key shape features of the mesh in the model, such as edges, corners, curvatures, etc., to obtain the shape feature set;

[0148] Based on the shape feature set, calculate the curvature calculation result according to the concave and convex degree of the mesh in the model;

[0149] Based on the shape feature set, calculate the geometric feature calculation result according to the side lengths and angles of the triangles connected to the mesh vertices in the model;

[0150] Based on the shape feature set, the edge importance influence result is calculated according to the grid side length and the flatness of the triangles on both sides of the edge in the model;

[0151] The importance evaluation result is obtained by performing a linear combination calculation on the curvature calculation result, the geometric feature calculation result, and the edge importance influence result according to the preset weight coefficient set;

[0152] Vertices and edges that do not meet the preset conditions are removed according to the importance evaluation result to obtain the shape simplification result.

[0153] Software such as MeshLab is used to perform iterative simplification processing on the components of the model until the spectrum simplification result or the shape simplification result meets the simplification rate target, and a simplified component set is obtained; among them, "MeshLab" is an open-source, portable, and extensible three-dimensional geometric processing system, mainly used for interactive processing and unstructured editing of three-dimensional triangular meshes.

[0154] An example is as follows: Input a mesh with 1 million triangles and a simplification rate target, and MeshLab will return a new mesh with the number of triangles being "1 million × simplification rate"; moreover, the simplification of the component mesh affects the data of the three fields of "Points (vertices), Normals (normals), and Texturecoords (texture coordinates)" in the data structure.

[0155] Among them, the specific calculation method of the curvature calculation result is:

[0156] Combined with the shape feature set, a three-dimensional modeling software is used to read the model, extract the grid vertex coordinates in the model, record the three-dimensional positions of each vertex, and extract the grid edge and face information, record the two endpoints of each edge and the vertices included in each face, to obtain the basic information of the grid;

[0157] Based on the basic information, the features of the grid are extracted at different scales to obtain multi-scale features; the multi-scale features are fused by feature stitching to obtain a feature set.

[0158] Based on the feature set, the global stiffness matrix is assembled according to the stiffness matrix of the grid elements and the node connection relationship in the model; according to the global shape constraint conditions, corresponding displacements or forces are applied to the boundary nodes of the model as boundary conditions; internal constraints are established according to the geometric relationships or topological structures in the model;

[0159] Based on the global stiffness matrix, boundary conditions, and internal constraints, a finite element equation is established; the finite element equation is solved to obtain the displacement vector of the nodes.

[0160] Based on the displacement vector and the material constitutive relationship of the model, the curvature calculation result is calculated.

[0161] Among them, the specific calculation method of the weight coefficient set is as follows:

[0162] Perform standardization processing on the curvature calculation results, geometric feature calculation results, and edge importance influence results, and calculate the covariance matrix between each index based on the standardized data;

[0163] Perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues and corresponding eigenvectors; according to the magnitudes of the eigenvalues, select the top k principal components with eigenvalues greater than 1 as the principal component set;

[0164] Calculate the principal component linear combination coefficient set and the variance contribution rate set based on the eigenvectors of the principal component set and the original data; and calculate the weight coefficient set based on the principal component linear combination coefficient set and the variance contribution rate set.

[0165] An important feature of the digital twin city is dynamic visualization and intelligent deduction. Complex models may make dynamic visualization blurred or difficult to understand, and may also make the results of intelligent deduction inaccurate or difficult to interpret. Therefore, the model functions may be difficult to implement or the effects may be greatly reduced. In this embodiment S2.2, through eigenvalue decomposition and importance evaluation, it is possible to identify and remove unnecessary details in the model that do not affect the overall shape or function, thereby reducing the complexity of the model; by removing redundant information, the simplified model can more accurately reflect the core features and laws of the urban system, thereby improving the accuracy and credibility of the intelligent deduction results; and, the clarity and fluency of dynamic visualization can be improved, enabling users to more easily understand and use the digital twin city system;

[0166] In addition, the models that need to be controlled in the digital twin city usually contain a large number of mesh elements and complex geometries, which makes it particularly difficult to evaluate the importance of each element. By calculating the curvature of the mesh, the geometric features of the triangles connected to the vertices, and the importance influence of the edges, it is possible to capture various shape, size, and topological structure features of the mesh elements in the model; this solution formulates a unified and comprehensive evaluation standard for different mesh elements, which can effectively solve the problem of evaluating the importance of mesh elements in the digital twin city model, and provide a more accurate and reliable basis for model simplification.

[0167] S3. Render the component set according to the attribute data of the component set, and perform display control on the component set of the rendered model.

[0168] Step S3 in the embodiment of this application includes S3.1 to S3.4. Among them, S3.1 is the process of performing merging processing to establish the first component set, S3.2 is the process of performing picture pasting based on the first component set to establish the second component set, S3.3 is the process of performing model display based on the second component set, and S3.4 is the process of performing model control based on the second component set. Specifically:

[0169] S3.1. Traverse each component in the component set to obtain a field data set related to the material (Materal field data);

[0170] If the field data in the field data set are equal, then classify the corresponding components into one category to obtain the component set classification result;

[0171] Merge and mark the mesh vertices of the same material in the component set classification result to obtain the first component set. Specifically: Combine n features in the same material into one, including the materialId (unique identifier of the material), the common Materal (material), Texture (texture information), as well as the merged Points, Normals, and Texturecoords; and for each vertex in Points, a "feature1_id" is added, and this "id" is the component id (component identifier), which can be used to identify which component in the original model file this point belongs to, and this id is used for subsequent rendering and control operations.

[0172] In S3.1 of this embodiment, by merging the meshes of the same material, the number of material calls during rendering can be significantly reduced, thereby reducing the communication overhead between the Central Processing Unit (CPU) and the Graphics Processing Unit (GPU), and improving the rendering efficiency. Merging meshes and textures can reduce the number of objects in memory. Especially when there are a large number of similar objects in the scene, this method can significantly save memory resources;

[0173] Moreover, classifying components of the same material into one category and merging their mesh vertices helps to maintain the consistency of the model in terms of materials, avoiding problems such as material confusion or inconsistency.

[0174] S3.2. Based on the first component set, calculate the total size of the large texture image according to the total size of all small texture images and the target expansion size;

[0175] On the large texture image, determine a unique and non-overlapping specified position for all small texture images according to the total size, and paste all small texture images to the specified position of the large texture image to obtain a transitional construction set containing the large texture image;

[0176] Obtain the UV coordinates of each vertex in all small texture images to obtain an initial coordinate set; wherein, the UV coordinates refer to the pixels or texels in the texture image corresponding to the mesh vertices.

[0177] Based on the offsets of all small texture images in the large texture image and the initial coordinate set, calculate the actual UV coordinate set based on the overall size of the large texture image.

[0178] Update the corresponding texture coordinate values of the large texture image in the transition construction set according to the actual UV coordinate set to obtain a second component set.

[0179] The example is as follows: The pixels of a certain texture image are 256×256, and the texture coordinates are (20, 30). The corresponding pixel is the position in the texture image that is 20 pixels horizontally to the right and 30 pixels vertically upward with the lower right corner as the origin. If this texture image is merged into the lower right corner (40, 50) of a 4096×4096 large png with the lower right corner as the origin. Then the new texture coordinates need to be calculated considering the position of the texture image in the large png and updated to (20 + 40, 30 + 50). If one large png is not enough, multiple large pngs may be required, and the texture coordinates can be calculated according to the corresponding large png; wherein, "png" refers to an image file format, full name Portable Network Graphics (Portable Network Graphics).

[0180] In this embodiment S3.2, by determining unique and non-overlapping specified positions for all small texture images on the large texture image, the overlap and conflict of textures during the rendering process are avoided, improving the accuracy and stability of rendering. During the rendering process, since all textures are integrated in the large texture image, the number of texture switches can be reduced, thereby reducing the rendering overhead and improving the rendering efficiency;

[0181] Moreover, when calculating the actual UV coordinate set, the offsets of the small texture images in the large texture image are considered. This method ensures that even after the small texture images are integrated into the large texture image, the textures can still be correctly mapped to the model surface. In addition, due to considering the UV coordinates and offsets of each vertex, the problems of texture breakage or misalignment during the rendering process can be avoided, which helps to maintain the texture consistency and continuity of the model surface.

[0182] S3.3. Prepare a 3D rendering environment, including setting up the rendering window and view frustum and other preparatory work for conventional 3D rendering;

[0183] Set the corresponding material parameters (Materal) according to the material information of the second component set.

[0184] Generate texture data based on the texture map of the second component set and activate the texture unit corresponding to the texture data; transfer data such as the vertices, normals, and texture coordinates of multiple meshes to the graphics processing unit at one time, so as to batch draw mesh data;

[0185] Generate a rendering image of the second component set according to the material parameters, texture data, and mesh data of the second component set, and display the model in the rendering window of the 3D rendering environment in the form of the rendering image.

[0186] In this embodiment S3.3, setting corresponding material parameters according to the material information of the second component set can accurately control the material performance of the model, such as color, glossiness, transparency, etc., so as to enhance the visual effect of the model. Generating texture data based on the texture map of the second component set and activating the corresponding texture unit can ensure the accurate mapping and display of the texture on the model surface, which helps to improve the detail expression and realism of the model.

[0187] S3.4. The user clicks on a certain position in the model with the mouse, the system captures the mouse click event and records the click position;

[0188] According to the mouse click position, the digital twin city system generates a ray starting from the observation point and passing through the click position; use the ray to perform an intersection test with the meshes in the model, especially for the merged meshes with different materials, so as to determine which merged mesh the ray intersects with;

[0189] In the intersecting merged mesh, further calculate which triangle the ray intersects with; after determining the intersecting triangle, check the vertex information of the triangle, extract the featureid (unique identifier) from the vertices of the triangle, and use the obtained featureid to look up the corresponding attribute data in the info attribute table for display;

[0190] According to the user's needs or the preset logic of the digital twin city system, perform control operations such as display, hiding, and deletion on the components in the second component set with a specific featureid, so as to achieve the purpose of controlling the model.

[0191] It should be noted that the processes of processing, displaying, and controlling the model in this application are all completed based on the digital twin city system.

[0192] To apply the embodiments of this application, please refer to Figure 4 , Figure 4 is the technical implementation flow chart provided by the embodiments of this application, indicating the general process of processing, displaying, and controlling the model according to the digital twin city system in this embodiment 1.

[0193] Overall, this embodiment has the following beneficial effects:

[0194] The polygon simplification in this application can significantly reduce the data volume of the model, thereby reducing the loading time and improving the loading speed of the model. Since the rendering algorithm optimizes according to the attribute data of the components to restore the visual effect of the original model as much as possible, the rendering process can ensure that the simplified model still maintains a high visual quality. The display control allows users to interact with the model according to their needs, ensuring that users can accurately observe and operate the model, improving the usability and practicality of the model. Among them, for the simplification rate, the data mapping process can convert the comprehensive information of the model into a unified standard scale for subsequent quantitative analysis and comparison; moreover, the simplification rate is established based on factors such as the distance of the component from the model surface and the brightness and darkness of the model material. This means that during the simplification process, components farther from the model surface or with lower brightness and darkness of the material will be simplified more. This method can significantly reduce the data volume of the model, especially those details that have less impact on the overall visual effect, thereby reducing the data volume to be processed during loading, improving the loading speed, reducing stuttering and latency, and achieving effective display control of the model;

[0195] In summary, this application improves the speed of loading complex and detailed models and the rendering frame rate of complex and detailed models in the digital twin system, and can also maintain the integrity of the model attribute data, facilitating the system to query the attributes of components and control the display and hiding.

[0196] Embodiment 2:

[0197] Please refer to Figure 5 , the embodiment of this application provides a model display control device based on a digital twin system, applicable to a digital twin city system, including an information module 10, a simplification module 20, and a control module 30;

[0198] Among them, the information module 10 is used to obtain the comprehensive information of the model;

[0199] The simplification module 20 is used to perform polygon simplification on the components of the model according to the simplification rate of the components in the comprehensive information to obtain a set of simplified components; among them, the simplification rate is determined according to the distance between the component and the model surface and the brightness and darkness of the component material after processing the comprehensive information in the way of mapping the component distance;

[0200] The control module 30 is used to render the set of components according to the attribute data of the set of components and perform display control on the set of components of the rendered model.

[0201] In one embodiment, the information module 10 is specifically:

[0202] Load the model through the digital twin city system, open and parse the model file, and obtain the model component list; among them, the "digital twin city system" is a technical system that transforms all aspects of the physical world of the city into digital form. Through real-time data exchange and simulation analysis between the cyber space and the physical world, it can achieve comprehensive monitoring, prediction, and optimization of the city's operating status;

[0203] Traverse each component of the model according to the model component list, obtain the attribute information of each component, and store the attribute information in the database table (inf table) according to the preset rules;

[0204] Obtain the geometric information (mesh) of each component, and store the geometric information in the database mesh table according to the preset rules;

[0205] The comprehensive information of the model is composed of the separated attribute information and geometric information.

[0206] Among them, each row record in the inf table represents the attribute information of the component. The record contains two fields: featureId and inf, where featureId is the component id parsed from the model file, and inf is the set of component attributes. The example is as follows: featureId: "90b2daded26f183e3ddeb5ca17c8e00a", inf: "{"name": "wall", "attribute 1": "100 cubic", "attribute 2": "built in August 2021"};

[0207] Each row record in the mesh table represents the geometric information of a component, where featureId is the unique identifier of the component, and value is the mesh data of the component; the mesh data includes the vertex coordinates of the triangular mesh (such as a vertex is "{x, y, z}"), vertex normal, texture data (texture picture file path), texture coordinates {u, v}, material information (diffuse reflection, specular reflection parameters, ambient light, glossiness), and other parameters.

[0208] In one embodiment, the simplification module 20 includes a distance unit, a mapping unit, a function unit, a simplification rate unit, a target unit, a feature unit, a spectrum unit, a curvature subunit, a side length subunit, a flat subunit, a combination subunit, a simplification unit, and a component set unit; among them, the distance unit, the mapping unit, the function unit, and the simplification rate unit are the processes of calculating the simplification rate, and the target unit, the feature unit, the spectrum unit, the curvature subunit, the side length subunit, the flat subunit, the combination subunit, the simplification unit, and the component set unit are the processes of simplifying the model according to the simplification rate;

[0209] Among them, the distance unit is used to calculate the distance between the mesh of each component and the mesh of the outer surface of the model according to the comprehensive information, as the first distance set of the model. The example is as follows: The Computational Geometry Algorithms Library (CGAL for short) can be used to calculate the mesh of the outer surface of the model, and then calculate the distance between the component mesh and the outer surface mesh of the model to obtain the distance d of the component; correspondingly, there is a maximum component distance and a minimum component distance ; among them, "mesh" is a data structure composed of elements such as vertices, edges, and faces (usually triangles or quadrilaterals).

[0210] The mapping unit is used to continuously map the first distance set to the space of [0-1], and establish a linear equation of the reduction rate based on the mapped first distance set ; among them, for the mapped first distance set, the maximum value of d is 1, the minimum value is 0, and the intermediate values are taken at equal ratio differences;

[0211] The function unit is used to establish a reduction rate function m(x) according to the light and dark degree of the component material in the model;

[0212] The reduction rate unit is used to calculate the reduction rate of the component in the comprehensive information according to the linear equation of the reduction rate and the reduction rate function m(x) .

[0213] Among them, the intermediate value is:

[0214]

[0215] The linear equation of the reduction rate is:

[0216]

[0217] The reduction rate function is:

[0218]

[0219] The reduction rate is:

[0220]

[0221] Among them, x represents the distance of each component from the model surface, represents the maximum value of the distance between the component and the model surface; Indicates the simplification rate (e.g., 0.8) used when the component is closest to the surface. Indicates the simplification rate (e.g., 0.3) used when the component is farthest from the surface.

[0222] Indicates the reference simplification rate set when the material is extremely bright or extremely dark; b represents the value of x when obtaining the maximum simplification rate, and c is a preset parameter. Is a mathematical constant. Indicates the brightness and darkness degree of the material.

[0223] Is a preset value, which can be set according to experience. For example, If it takes 0.8, then m(x) adopts 0.2; a more complex weight calculation method can also be set, such as Can be designed as a function with distance as the independent variable. At different distances, the influence weight of d(x) on the total simplification rate Is also different, so as to achieve more precise control of the simplification rate.

[0224] For applying the embodiments of the present application, please refer to Figures 2 - 3 ;

[0225] Figure 2 Is the distance-based simplification rate curve diagram provided by the embodiments of the present application, indicating And The value-taking situation is shown; Figure 2 In, for the simplification rate linear equation In terms of, , it can be seen that the smaller the distance, the closer the component is to the model surface, and the larger the simplification rate that needs to be set. And the simplification rate is the percentage value of the number of triangular faces retained.

[0226] Figure 3 Is the simplification rate curve diagram based on the material brightness and darkness provided by the embodiments of the present application. Among them, the 4 curves represent examples when c takes four values. In actual application, one can be selected according to specific situations; the x-axis represents the material brightness and darkness value, and the value ranges from [0, 1]; the y-axis represents the simplification rate corresponding to a certain brightness and darkness, and the value ranges from ( , according to Figure 3 Is (0.3, 0.8]. It can be seen from the curve: when it is extremely dark, x = 0.0, and at this time the simplification rate is close to 0.3; when it is extremely bright, x = 1.0, and at this time the simplification rate is close to 0.3, but when the brightness and darkness value takes values between 0 and 1, it is thus simplified to a parabolic change situation.

[0227] In Figure 3 For the simplification rate function m(x), c affects the width of the protruding part of the curve because the x value in this simplification function ranges from [0 - 1], and m(x) is in ( Interval, and the curve opens downward; the smaller c is, the narrower the protruding part of the curve is, indicating that when x is in a certain small range (narrow interval) of light and dark intervals, the simplification rate changes significantly compared to other intervals; it can be seen that the light and dark degree and the simplification rate are not linearly increasing or decreasing relationships, but a curve, indicating that in a certain interval of light and dark, the simplification rate is large, and it symmetrically decreases in other regions; among them, " " represents the set maximum simplification rate.

[0228] In Figure 3 medium, = 0.3, + = 0.8, that is, range = 0.5, and when the curve peaks, x = 0.5, that is, b = 0.5. Among them, x represents the light and dark degree of the material, which is obtained by adding the diffuse brightness, specular brightness, ambient brightness, and shininess {value} of the material (diffuse reflection, specular reflection, and ambient light use three-channel data, such as {r, g, b}, and the shininess is single-channel data, and the value of each channel in all parameters ranges from 0 to 1):

[0229]

[0230] When the material is extremely bright (x = 1) and extremely dark (x = 0), the simplification rate of this part is 0.3 (the number of triangular faces needs to be reduced to 30% of the original); when the material is between extremely bright and extremely dark, the simplification rate is 0.8 (reduced to 80% of the original number of triangular faces); therefore, through the designed simplification rate function m(x), the difference degree of the simplification rate between components can be adjusted.

[0231] From Figure 3 's curve, it can be seen that by setting 4 parameters, it is possible to achieve when the light and dark degree obtains the maximum or minimum simplification rate; it is also possible to achieve whether the simplification rate changes smoothly or rapidly in different light and dark intervals. In practical applications, it is necessary to make some components of certain materials retain as many triangular meshes as possible, while other components need to retain as few triangular meshes as possible. For example: If it is necessary to achieve that when the light and dark are between 0.4 and 0.6, the model retains more triangles (the simplification rate is large), and when it reaches other light and dark degrees, the model is as small as possible, then c can take a smaller value.

[0232] In this embodiment, the distance unit, mapping unit, function unit, and reduction rate unit can accurately capture the geometric relationships inside the model by calculating the exact distance between the component mesh and the outer surface mesh of the model, providing a reliable data basis for subsequent simplification operations; continuously mapping the first distance set to a preset numerical range, the mapping rule can be adjusted according to needs to adapt to different simplification requirements and accuracy requirements; establishing a linear equation of the reduction rate based on distance can intuitively reflect the linear relationship between distance and reduction rate, making the simplification operation more scientific and reasonable. Incorporating the light and dark degree of the component material in the model into the consideration scope of the reduction rate function further improves the accuracy and adaptability of the reduction rate;

[0233] Moreover, the reduction rate function constructed in this embodiment can ensure that the reduction rate is between and the maximum values. By inputting different light and dark values according to this function algorithm, the corresponding reduction rate can be obtained.

[0234] The target unit is used to establish a reduction rate target according to the reduction rate of the components in the comprehensive information ;

[0235] The feature unit is used to regard the mesh in the model as a graph structure, establish the corresponding Laplacian matrix and perform eigenvalue decomposition to obtain an eigenvalue set and the corresponding eigenvector set; among them, the Laplacian matrix can reflect the connection relationship and boundary conditions between mesh vertices, the eigenvalue represents the spectral information of the mesh, and the eigenvector represents different spectral components of the mesh;

[0236] The spectrum unit is used to obtain several eigenvalues in the eigenvalue set that are less than a preset value, remove the eigenvectors corresponding to the several eigenvalues, and obtain a spectrum simplification result.

[0237] The curvature sub-unit is used to obtain the key shape features of the mesh in the model, such as edges, corners, curvature, etc., to obtain a shape feature set;

[0238] The curvature sub-unit is also used to calculate a curvature calculation result based on the shape feature set according to the concave and convex degree of the mesh in the model;

[0239] The side length sub-unit is used to calculate a geometric feature calculation result based on the shape feature set according to the side length and angle of the triangle connected to the mesh vertex in the model;

[0240] The flat sub-unit is used to calculate an edge importance influence result based on the shape feature set according to the mesh side length in the model and the flatness of the triangles on both sides of the edge;

[0241] A combinatorial subunit for performing a linear combination calculation on the curvature calculation result, geometric feature calculation result, and edge importance influence result according to a preset weight coefficient set to obtain an importance evaluation result;

[0242] A simplification unit for removing vertices and edges that do not meet the preset conditions according to the importance evaluation result to obtain a shape simplification result.

[0243] A component set unit for iteratively simplifying the components of the model using software such as MeshLab until the spectrum simplification result or shape simplification result meets the simplification rate target to obtain a simplified component set; where "MeshLab" is an open-source, portable, and extensible 3D geometric processing system mainly used for interactive processing and unstructured editing of 3D triangular meshes.

[0244] For example: Input a mesh containing 1 million triangles and a simplification rate target, MeshLab will return a new mesh with the number of triangles being "1 million × simplification rate"; and the component mesh simplification affects the data of the three fields "Points (vertices), Normals (normals), and Texturecoords (texture coordinates)" in the data structure.

[0245] Among them, the specific calculation method of the curvature calculation result is:

[0246] Combined with the shape feature set, use 3D modeling software to read the model, extract the mesh vertex coordinates in the model, record the 3D positions of each vertex, and extract the mesh edge and face information, record the two endpoints of each edge and the vertices included in each face to obtain the basic information of the mesh;

[0247] According to the basic information, extract the features of the mesh at different scales to obtain multi-scale features; fuse the multi-scale features by feature stitching to obtain a feature set.

[0248] Based on the feature set, assemble the global stiffness matrix according to the stiffness matrix of the mesh elements and the node connection relationship in the model; according to the global shape constraint conditions, apply corresponding displacements or forces to the boundary nodes of the model as boundary conditions; establish internal constraints according to the geometric relationships or topological structures in the model;

[0249] According to the global stiffness matrix, boundary conditions, and internal constraints, establish a finite element equation; solve the finite element equation to obtain the displacement vector of the nodes.

[0250] According to the displacement vector and the material constitutive relationship of the model, calculate the curvature calculation result.

[0251] Among them, the specific calculation method of the weight coefficient set is:

[0252] Standardize the curvature calculation results, geometric feature calculation results, and edge importance influence results, and calculate the covariance matrix between various indicators based on the standardized data;

[0253] Perform eigenvalue decomposition on the covariance matrix to obtain eigenvalues and corresponding eigenvectors; according to the magnitudes of the eigenvalues, select the top k principal components with eigenvalues greater than 1 as the principal component set;

[0254] Calculate the principal component linear combination coefficient set and variance contribution rate set based on the eigenvectors of the principal component set and the original data; and calculate the weight coefficient set based on the principal component linear combination coefficient set and variance contribution rate set.

[0255] An important feature of the digital twin city is dynamic visualization and intelligent deduction. Complex models may make dynamic visualization blurred or difficult to understand, and may also make the results of intelligent deduction inaccurate or difficult to interpret. Therefore, it may be difficult to implement the model functions or the effects may be greatly reduced. The target unit, feature unit, spectrum unit, curvature subunit, side length subunit, flat subunit, combination subunit, simplification unit, and component set unit in this embodiment can identify and remove unnecessary details in the model that do not affect the overall shape or function through eigenvalue decomposition and importance evaluation, thereby reducing the complexity of the model; by removing redundant information, the simplified model can more accurately reflect the core features and laws of the urban system, thereby improving the accuracy and credibility of the intelligent deduction results; and, the clarity and fluency of dynamic visualization can be improved, enabling users to more easily understand and use the digital twin city system;

[0256] In addition, the models that need to be controlled in the digital twin city usually contain a large number of mesh elements and complex geometries, which makes it particularly difficult to evaluate the importance of each element. By calculating the curvature of the mesh, the geometric features of the triangles connected to the vertices, and the importance influence of the edges, various shape, size, and topological structure features of the mesh elements in the model can be captured; this solution formulates a unified and comprehensive evaluation standard for different mesh elements, which can effectively solve the problem of evaluating the importance of mesh elements in the digital twin city model and provide a more accurate and reliable basis for model simplification.

[0257] In one embodiment, the control module 30 includes a field subunit, a classification subunit, a marking subunit, a sizing subunit, a pasting subunit, an updating subunit, a parameter subunit, an activation subunit, a display subunit, and a control subunit. Among them, the field subunit, the classification subunit, and the marking subunit are processes for performing merging processing to establish a first component set. The sizing subunit, the pasting subunit, and the updating subunit are processes for performing picture pasting based on the first component set to establish a second component set. The parameter subunit, the activation subunit, and the display subunit are processes for performing model display based on the second component set. The control subunit is a process for performing model control based on the second component set.

[0258] Among them, the field subunit is used to traverse each component in the component set to obtain a field data set related to the material (Materal field data).

[0259] The classification subunit is used to classify the corresponding components into one category if the field data in the field data set is equal, to obtain a component set classification result.

[0260] The marking subunit is used to merge and mark the mesh vertices of the same material in the component set classification result to obtain a first component set. Specifically, n features in the same material are combined into one, including the materialId (unique identifier of the material), the common Materal (material), the Texture (texture information), as well as the merged Points, Normals, and Texturecoords. And, for each vertex in the Points, a "feature1_id" is added, and this "id" is the component id (component identifier), which can be used to identify which component in the original model file this point belongs to, and this id is used for subsequent rendering and control operations.

[0261] In this embodiment, the field subunit, the classification subunit, and the marking subunit can significantly reduce the number of material calls during rendering by merging meshes of the same material, thereby reducing the communication overhead between the Central Processing Unit (CPU) and the Graphics Processing Unit (GPU), and improving the rendering efficiency. Merging meshes and textures can reduce the number of objects in memory. Especially when there are a large number of similar objects in the scene, this method can significantly save memory resources.

[0262] Moreover, classifying components of the same material into one category and merging their mesh vertices helps to maintain the consistency of the model in terms of material, avoiding problems of material confusion or inconsistency.

[0263] A size subunit, configured to calculate the total size of the large texture image based on the first component set according to the total size of all small texture images and the target expansion size;

[0264] A pasting subunit, configured to determine a unique and non-overlapping specified position for all small texture images on the large texture image according to the total size, and paste all small texture images to the specified position of the large texture image to obtain a transition construction set including the large texture image;

[0265] An updating subunit, configured to obtain the UV coordinates of each vertex in all small texture images to obtain an initial coordinate set; wherein, the UV coordinate refers to the pixel or texel in the texture image corresponding to the mesh vertex;

[0266] The updating subunit is further configured to calculate an actual UV coordinate set based on the overall size of the large texture image according to the offset of all small texture images in the large texture image and the initial coordinate set;

[0267] The updating subunit is further configured to update the corresponding values of the texture coordinates of the large texture image in the transition construction set according to the actual UV coordinate set to obtain a second component set.

[0268] The example is as follows: The pixels of a certain texture image are 256×256, and the texture coordinates are (20, 30). The corresponding pixel is the position in the texture image with the lower right corner as the origin, 20 pixels horizontally to the right, and 30 pixels vertically upward. If this texture image is merged to the position of (40, 50) with the lower right corner as the origin in a 4096×4096 large png. Then the new texture coordinates need to be calculated considering the position of the texture image in the large png and updated to (20 + 40, 30 + 50). If one large png is not enough, multiple large pngs may be required, and the texture coordinates can be calculated according to the corresponding large png; wherein, "png" refers to an image file format, full name Portable Network Graphics (Portable Network Graphics).

[0269] In this embodiment, the size subunit, the pasting subunit, and the updating subunit determine a unique and non-overlapping specified position for all small texture images on the large texture image, avoiding the overlap and conflict of textures during the rendering process, and improving the accuracy and stability of rendering. During the rendering process, since all textures are integrated in the large texture image, the number of texture switches can be reduced, thereby reducing the rendering overhead and improving the rendering efficiency;

[0270] Moreover, when calculating the actual UV coordinate set, the offset of the small texture image within the large texture image is taken into account. This approach ensures that even after the small texture image is integrated into the large texture image, the texture can still be correctly mapped onto the model surface. Additionally, by considering the UV coordinates and offsets of each vertex, issues such as texture breaks or misalignments during the rendering process can be avoided, contributing to maintaining the texture consistency and continuity of the model surface.

[0271] A parameter subunit for preparing the 3D rendering environment, including preparatory work for conventional 3D rendering such as setting up the rendering window and view frustum.

[0272] The parameter subunit is also used to set corresponding material parameters (Materal) according to the material information of the second component set.

[0273] An activation subunit for generating texture data based on the texture map of the second component set and activating the texture unit corresponding to the texture data; passing data such as vertices, normals, and texture coordinates of multiple meshes to the graphics processing unit at once, thereby batch rendering mesh data.

[0274] A display subunit for generating a rendering image of the second component set based on the material parameters, texture data, and mesh data of the second component set, and displaying the model in the form of the rendering image in the rendering window of the 3D rendering environment.

[0275] In this embodiment, the parameter subunit, activation subunit, and display subunit set corresponding material parameters according to the material information of the second component set, which can precisely control the material performance of the model, such as color, glossiness, transparency, etc., thereby enhancing the visual effect of the model. Generating texture data based on the texture map of the second component set and activating the corresponding texture unit can ensure the accurate mapping and display of the texture on the model surface, contributing to improving the detail expressiveness and realism of the model.

[0276] A control subunit for the user to click on a certain position in the model through the mouse. The system captures the mouse click event and records the click position.

[0277] The control subunit is also used to generate a ray starting from the observation point and passing through the click position according to the mouse click position; performing an intersection test between the ray and the meshes in the model, especially for merged meshes with different materials, so as to determine which merged mesh the ray intersects with.

[0278] The control sub-unit is also used to further calculate which triangle the ray intersects in the intersecting merged grid; after determining the intersecting triangle, it checks the vertex information of the triangle, extracts the featureid (unique identifier) from the vertices of the triangle, and uses the obtained featureid to look up the corresponding attribute data in the info attribute table for display;

[0279] The control sub-unit is also used to perform control operations such as display, hiding, and deletion on the components with specific featureids in the second component set according to the user's needs or the preset logic of the digital twin city system, so as to achieve the purpose of controlling the model.

[0280] It should be noted that the processes of processing, displaying, and controlling the model in this application are all completed based on the digital twin city system.

[0281] To apply the embodiments of this application, please refer to Figure 4 , Figure 4 is the technical implementation flow chart provided by the embodiments of this application, which shows the general process of processing, displaying, and controlling the model according to the digital twin city system in this second embodiment.

[0282] Overall, this embodiment has the following beneficial effects:

[0283] The polygon simplification in this application can significantly reduce the data volume of the model, thereby reducing the loading time and improving the loading speed of the model. Since the rendering algorithm is optimized according to the attribute data of the components to restore the visual effect of the original model as much as possible, the rendering process can ensure that the simplified model still maintains a high visual quality. The display control allows users to perform interactive operations on the model according to their needs, which can ensure that users can accurately observe and operate the model, improving the usability and practicality of the model. Among them, for the simplification rate, the data mapping process can convert the comprehensive information of the model into a unified standard scale, which is convenient for subsequent quantitative analysis and comparison; and the simplification rate is established based on factors such as the distance of the component from the model surface and the brightness and darkness of the model material. This means that during the simplification process, components that are farther from the model surface or have a lower brightness and darkness of the material will be simplified more. This method can significantly reduce the data volume of the model, especially those detail parts that have less impact on the overall visual effect, thereby reducing the data volume to be processed during loading, improving the loading speed, reducing stuttering and latency, and achieving effective display control of the model;

[0284] In summary, this application improves the loading speed of complex and detailed models and the rendering frame rate of complex and detailed models in the digital twin system, and can also maintain the integrity of the model attribute data, facilitating the system to query and display / hide control the components.

[0285] Embodiment 3:

[0286] An embodiment of the present application provides a computer-readable storage medium, which includes a stored computer program. When the computer program runs, it controls the device where the computer-readable storage medium is located to execute the model display control method based on a digital twin system described above.

[0287] Among them, for the model display control method based on a digital twin system, if it is implemented in the form of a software functional unit and used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, to implement all or part of the processes in the above embodiment methods of the present invention, it can also be completed by a computer program instructing relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, the steps of the above various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file, or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc.

[0288] The above are the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art in the technical field of the present invention, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements are also regarded as the protection scope of the present invention.

Claims

1. A model display control method based on a digital twin system, characterized in that: Applicable to digital twin city systems, including: Get comprehensive information about the model; The components of the model are polygonally simplified according to the simplification rate of the components in the comprehensive information to obtain a simplified component set; wherein the simplification rate is determined according to the distance between the component and the model surface and the lightness and darkness of the component material after processing the comprehensive information in a manner of mapping the component distance; Rendering the component set according to the attribute data of the component set, and performing display control on the component set of the model after rendering; The polygon simplification of the components of the model according to the simplification rate of the components in the comprehensive information to obtain a simplified component set is specifically: Establishing a simplification rate target according to the simplification rate of the component in the comprehensive information; Establishing a Laplace matrix according to the grid in the model and performing eigenvalue decomposition to obtain an eigenvalue set; Acquire a number of eigenvalues ​​less than a preset value in the eigenvalue set, remove eigenvectors corresponding to the number of eigenvalues, and obtain a spectrum simplification result; According to the shape characteristics of the mesh in the model, the influence of each vertex and edge on the overall shape of the mesh is evaluated to obtain an importance evaluation result; According to the importance evaluation result, vertices and edges that do not meet the preset conditions are removed to obtain a shape simplification result; The components of the model are iteratively simplified until the spectrum simplification result or the shape simplification result meets the simplification rate target, thereby obtaining the simplified component set.

2. A model display control method based on a digital twin system according to claim 1, characterized in that: The simplification rate is determined by processing the comprehensive information in a manner of mapping the component distance, according to the distance between the component and the model surface and the brightness of the component material, specifically: According to the comprehensive information, respectively calculating the distance between the mesh of each component and the mesh of the outer surface of the model as the first distance set of the model; Continuously mapping the first distance set to a preset value range, and establishing a distance-based simplification rate linear equation according to the mapped first distance set; Establishing a simplification rate function according to the lightness and darkness of the component material in the model; The simplification rate of the component in the comprehensive information is calculated according to the simplification rate linear equation and the simplification rate function.

3. A model display control method based on a digital twin system according to claim 1, characterized in that: Rendering the component set according to the attribute data of the component set, and performing display control on the component set of the model after rendering, specifically: Classifying the component set according to component material, and obtaining a first component set by merging component meshes of the same material; Based on the first component set, the textures contained in the mesh grids in each type of material are merged to obtain a second component set; The second component set is rendered, and display control is performed on the rendered model component set.

4. A model display control method based on a digital twin system as claimed in claim 3, characterized in that: The component set is classified according to the component material, and the first component set is obtained by merging the component meshes of the same material, specifically: Traversing each component in the component set to obtain a field data set related to the material; If the field data in the field data set are equal, the corresponding components are classified into one category to obtain a component set classification result; The mesh vertices of the same material in the component set classification results are merged and marked to obtain the first component set.

5. A model display control method based on a digital twin system as claimed in claim 3, characterized in that: Based on the first component set, the textures contained in the mesh grids in each type of material are merged to obtain the second component set, which is specifically: Based on the first component set, the total size of the large texture image is calculated according to the total size of all small texture images and the target expansion size; On the large texture picture, determining a unique and non-overlapping designated position for all the small texture pictures according to the total size, and pasting all the small texture pictures to the designated position of the large texture picture to obtain a transition construction set including the large texture picture; The texture coordinates of the large texture image in the transition building set are updated to obtain the second building block set.

6. A model display control method based on a digital twin system as claimed in claim 5, characterized in that: The texture coordinates of the large texture image in the transition building set are updated to obtain the second building block set, specifically: Obtain the UV coordinates of each vertex in all the small texture images to obtain an initial coordinate set; According to the offsets of all the small texture images in the large texture image and the initial coordinate set, an actual UV coordinate set is calculated based on the overall size of the large texture image; The corresponding values ​​of texture coordinates of the large texture image in the transition building set are updated according to the actual UV coordinate set to obtain the second component set.

7. A model display control method based on a digital twin system as claimed in claim 3, characterized in that: Rendering the second component set and performing display control on the rendered model component set is specifically as follows: Setting corresponding material parameters according to the material information of the second component set; Generating texture data according to the texture map of the second component set, and activating the texture unit corresponding to the texture data; generating a rendering image of the second component set according to the material parameters, the texture data and the mesh data of the second component set, and displaying the model in the form of the rendering image in a rendering window; The second component set of the model is controlled according to the unique identifier of the component in the second component set.

8. The model display control method based on the digital twin system according to claim 1, characterized in that: According to the shape characteristics of the mesh in the model, the influence of each vertex and edge on the overall shape of the mesh is evaluated to obtain the importance evaluation result, which is specifically: According to the concave-convex degree of the grid in the model, a curvature calculation result is calculated; Calculating the geometric feature calculation results according to the side lengths and angles of triangles connected to the mesh vertices in the model; According to the mesh edge length in the model and the flatness of the triangles on both sides of the edge, the edge importance influence result is calculated; The curvature calculation result, the geometric feature calculation result and the edge importance influence result are linearly combined and calculated according to a preset weight coefficient set to obtain the importance evaluation result.

9. A model display control device based on a digital twin system, characterized in that: Applicable to the digital twin city system, including information module, simplified module and control module; Wherein, the information module is used to obtain comprehensive information of the model; The simplification module is used to perform polygon simplification on the components of the model according to the simplification rate of the components in the comprehensive information to obtain a simplified component set; wherein the simplification rate is determined according to the distance between the component and the model surface and the lightness and darkness of the component material after processing the comprehensive information in a manner of mapping the component distance; The control module is used to render the component set according to the attribute data of the component set, and to perform display control on the component set of the model after rendering; The simplified module includes a target unit, a feature unit, a spectrum unit, a shape unit, a simplified unit and a component set unit; Wherein, the target unit is used to establish a simplification rate target according to the simplification rate of the component in the comprehensive information; The feature unit is used to establish a Laplace matrix according to the grid in the model and perform eigenvalue decomposition to obtain an eigenvalue set; The spectrum unit is used to obtain a number of eigenvalues ​​in the eigenvalue set that are smaller than a preset value, remove eigenvectors corresponding to the number of eigenvalues, and obtain a spectrum simplification result; The shape unit is used to evaluate the influence of each vertex and edge on the overall shape of the mesh according to the shape characteristics of the mesh in the model to obtain an importance evaluation result; The simplification unit is used to remove vertices and edges that do not meet preset conditions according to the importance evaluation result to obtain a shape simplification result; The component set unit is used to iteratively simplify the components of the model until the spectrum simplification result or the shape simplification result meets the simplification rate target, thereby obtaining the simplified component set.

10. A model display control device based on a digital twin system according to claim 9, characterized in that: The simplification module includes a distance unit, a mapping unit, a function unit and a simplification rate unit; The distance unit is used to calculate the distance between the mesh of each component and the mesh of the outer surface of the model according to the comprehensive information, as the first distance set of the model; The mapping unit is used to continuously map the first distance set into a preset value range, and establish a distance-based simplification rate linear equation according to the mapped first distance set; The function unit is used to establish a simplification rate function according to the lightness and darkness of the component material in the model; The simplification rate unit is used to calculate the simplification rate of the component in the comprehensive information according to the simplification rate linear equation and the simplification rate function.

11. A model display control device based on a digital twin system according to claim 9, characterized in that: The control module includes a material unit, a texture unit and a rendering unit; The material unit is used to classify the component set according to the component material, and obtain the first component set by merging the component meshes of the same material; The texture unit is used to merge the textures contained in the mesh grids in each type of material based on the first component set to obtain a second component set; The rendering unit is used to render the second component set and perform display control on the rendered model component set.

12. A model display control device based on a digital twin system according to claim 11, characterized in that: The material unit includes a field subunit, a classification subunit and a tag subunit; Wherein, the field subunit is used to traverse each component in the component set to obtain a field data set of related materials; The classification subunit is used to classify the corresponding components into one category if the field data in the field data set are equal, so as to obtain a component set classification result; The marking subunit is used to merge and mark mesh vertices of the same material in the component set classification result to obtain the first component set.

13. A model display control device based on a digital twin system according to claim 11, characterized in that: The texture unit includes a size subunit, a paste subunit and an update subunit; The size subunit is used to calculate the total size of the large texture image based on the first component set and the total size of all small texture images and the target expansion size; The pasting subunit is used to determine a unique and non-overlapping designated position for all the small texture images on the large texture image according to the total size, and paste all the small texture images to the designated position of the large texture image to obtain a transition construction set including the large texture image; The updating subunit is used to update the texture coordinates of the large texture image in the transition building set to obtain the second building block set.

14. A model display control device based on a digital twin system according to claim 13, characterized in that: The updating subunit is specifically: Obtain the UV coordinates of each vertex in all the small texture images to obtain an initial coordinate set; According to the offsets of all the small texture images in the large texture image and the initial coordinate set, an actual UV coordinate set is calculated based on the overall size of the large texture image; The corresponding values ​​of texture coordinates of the large texture image in the transition building set are updated according to the actual UV coordinate set to obtain the second component set.

15. The model display control device based on the digital twin system according to claim 11, characterized in that: The rendering unit includes a parameter subunit, an activation subunit, a display subunit and a control subunit; Wherein, the parameter subunit is used to set corresponding material parameters according to the material information of the second component set; The activation subunit is used to generate texture data according to the texture map of the second component set, and activate the texture unit corresponding to the texture data; The display subunit is used to generate a rendering image of the second component set according to the material parameters, the texture data and the mesh data of the second component set, and display the model in the form of the rendering image in a rendering window; The control subunit is used to control the second component set of the model according to the unique identifier of the component in the second component set.

16. A model display control device based on a digital twin system according to claim 9, characterized in that: The shape unit includes a curvature subunit, a side length subunit, a flat subunit and a combination subunit; Wherein, the curvature subunit is used to calculate the curvature calculation result according to the concavity and convexity of the grid in the model; The side length subunit is used to calculate the geometric feature calculation result according to the side length and angle of the triangle connected to the mesh vertex in the model; The flattening subunit is used to calculate the edge importance impact result according to the mesh edge length and the flatness of the triangles on both sides of the edge in the model; The combination subunit is used to perform linear combination calculation on the curvature calculation result, the geometric feature calculation result and the edge importance influence result according to a preset weight coefficient set to obtain the importance evaluation result.

17. A storage medium, characterized in that: The storage medium stores a computer program, which is called and executed by a computer to implement a model display control method based on a digital twin system as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Lightweight construction method for three-dimensional model of digital twin system

    CN117876560A

  • Three-dimensional model lightweight visualization method and device, terminal and storage medium

    CN118052942A

  • BIM rapid lightweight method

    CN118799529A