Disclosure of Invention
In order to solve one or more of the technical problems, the invention provides the method for improving the first screen performance of the system by optimizing the loading and rendering of three-dimensional data, reducing the loading amount for a plurality of times, and adjusting the precision of the model in real time by adding a corresponding incremental network according to the viewpoint position. To this end, the present invention provides solutions in various aspects as follows.
In a first aspect, the present invention provides a model lightweight-based three-dimensional visualization method for a WEB terminal, which is characterized by comprising:
building a BIM model of engineering information;
carrying out light weight treatment on the built BIM model;
extracting engineering information data from the BIM model after light weight processing and carrying out scene fine granularity and progressive loading pretreatment on the engineering information data; the scene fine granularity is used for acquiring the communication relation among different floors of a building and the distribution positions of the floors and the number of the floors;
rendering the user data through a web browser of a client, and sending the rendered HTML document to the web browser; the rendering refers to writing relevant parameters into a web browser template;
each DIV layer is layered according to DIV and independently used as a data interface to be loaded asynchronously, and each DIV layer only keeps the DIV label of the outermost layer when a page is initialized;
after the user performs interaction, the browser makes independent judgment, and the data is rendered again.
In another embodiment, building a BIM model of engineering information includes:
building a structural framework of the engineering project by utilizing finite element analysis software and combining construction drawings of the engineering project, and carrying out stress analysis on the finite element analysis software to verify whether the built structural framework is correct; if not, adjusting the structural framework;
exporting the structural skeleton and skeleton parameters from finite element analysis software and converting the structural skeleton and skeleton parameters into a format; inputting the BIM model into the BIM model to serve as framework parameters and a basic framework of the BIM model;
dividing the basic framework into a plurality of independent unit modules based on the construction drawing, taking a main body structure as a supporting piece of the unit modules, and constructing an auxiliary structure by taking the main body structure as a core;
laying construction processes of the main structure and the auxiliary structure based on the construction drawing, dividing construction tasks according to the construction processes, and marking sequence codes of the construction tasks;
and configuring the BIM model into a BIM main unit according to the unit module, and constructing a BIM subunit by taking the BIM main unit as a main line, wherein the BIM subunit is used for developing construction tasks corresponding to the auxiliary structure.
In another embodiment, partitioning the infrastructure includes:
importing the construction drawing into the identification model;
identifying a total graph and a partial graph in the construction drawing, and analyzing the association relationship between the partial graph and the total graph;
judging whether an auxiliary structure taking a main structure as a core and the main structure are contained in each sub-graph or not respectively;
the base frame is divided into a plurality of independent unit modules according to a division diagram including a main body structure and its subsidiary structure.
In another embodiment, the light-weight processing of the built BIM model includes:
dividing the constructed BIM model into N layers with different heights, wherein N is more than 3, the serial numbers of the N layers are respectively 0 and 1 … N-1, the division basis is a visual effect to be displayed, model data corresponding to the N layers are respectively represented, and the N layers comprise a base layer capable of directly displaying the three-dimensional visual effect and N-1 enhancement layers capable of displaying the three-dimensional visual effect in combination with the base layer;
respectively acquiring vertex compression rate corresponding to each layer, building space region corresponding to three-dimensional visual space displayed by each layer, geometric grid data corresponding to three-dimensional visual space displayed by each layer and building attribute data to be displayed in each layer;
generating target data sets X for each hierarchy respectivelyi The target data set refers to a data set composed of data of the hierarchy and the hierarchy below the hierarchy;
based on the target data sets X of the layers respectivelyi Generating per-layer output data set Li The specific generation method is as follows: when the hierarchy number is equal to 0, the output dataset of the layer is equal to X0 When the hierarchy sequence number is greater than 0, the output data set of the layer is equal to the difference set between the target data set of the layer and the target data set of the lower layer of the layer;
and carrying out adaptive rendering on each generated output data set.
In another embodiment, the generating of the target data set X for each leveli The method adopts a mode of compressing from high to low layer by layer, and comprises the following steps:
the original data of BIM model is marked as XN Initializing the value of i to N-1,
x is to bei Initialized to Li+1 ;
According to the space region to be covered by the ith layer, the model data L of the ith layer is obtainedi Filtering out data not belonging to the spatial region;
according to the component of the ith layer, the related data of the component not belonging to the ith layer is obtained from Xi Delete in;
According to the component attribute of the ith layer, constructing attribute data of the component attribute not belonging to the ith layer from Xi Delete in the middle;
compressing X according to the preset vertex compression rate of the ith layer on the premise of guaranteeing the geometric shapei The geometrical grid data of the building and of the component(s) to obtain the final target data set X of the ith layeri 。
In another embodiment, the scene fine granularity comprises the steps of:
analyzing the space object and the floor containing semantic information in the BIM model data to generate an initial space structure of the building;
analyzing the floor distribution condition of the whole building and the communication relation among floors by combining the initial space structure and the special components, respectively analyzing the communication relation inside each floor of the whole building by combining the initial space structure, and further generating a structure diagram for representing the division of indoor subspaces of the whole building and the connection relation among different subspaces;
loading and transmitting visible objects around the user virtual avatar so as to perform scene roaming; and judging the subspace of the virtual avatar of the user, calculating the object in the current viewing cone, and effectively controlling the data amount to be loaded in the current viewpoint range, namely loading only the object in the current viewing cone, thereby reducing the loading data amount and realizing the asymptotic transmission and loading of scene data.
In a second aspect, the present invention proposes an electronic device, including a processor and a memory, where the memory stores a computer program, where the computer program, when executed by the processor, implements the model-based lightweight three-dimensional visualization method for a WEB end of the present invention.
In a third aspect, the present invention proposes a computer readable storage medium having stored therein a computer program for implementing the model-lightweight WEB-side three-dimensional visualization method of the present invention when executed by a processor.
The beneficial effects of the invention are as follows: according to the method, the loading and rendering of the three-dimensional data are optimized, the loading capacity is reduced for a plurality of times, the precision of the model is adjusted in real time by adding the corresponding incremental network according to the viewpoint position, the first screen performance of the system is improved, the problem that the current three-dimensional system loads the white screen is avoided, and therefore better use experience is provided for users.
Further, geometric grid data are adopted for BIM model data to lighten, the model data are divided into different layers according to the display needs of users, component data, display precision, vertex compression rate and the like are set in each layer, a side folding algorithm is adopted to simplify grid deleting vertexes, so that the calculated amount is reduced, a half-side shrinkage scheme is adopted, namely, the shrunk vertexes are one of the original two vertexes, and new vertexes cannot be introduced; the server provides models with different precision requirements for different requesters without re-lightening. And simultaneously, a user is allowed to switch between models with different accuracies, so that the BIM model can adapt to terminals with different performances.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
WEB terminal three-dimensional visualization method embodiment based on model light weight:
as shown in fig. 1, the model-based lightweight WEB end three-dimensional visualization method of the invention comprises the following steps:
s1, building a BIM model of engineering information;
the BIM model is a building model established based on various related information data of a building engineering project, and simulates real information of a building through digital information simulation. The method is an integrated flow constructed based on design, construction, operation coordination and project information. By using BIM, construction companies can innovate, design and draw unified information in the whole process, and can communicate better through authenticity simulation and building visualization, so that project parties can know project basic information such as construction period, site real-time conditions, cost, environmental influence and the like.
S2, carrying out light weight treatment on the built BIM model;
the BIM model is a three-dimensional model, and the light weight of the three-dimensional model refers to a technology for optimizing the three-dimensional model to reduce the occupation of storage space and computing resources, thereby improving the processing speed and the system performance. In practical applications, since the three-dimensional model contains a large amount of data such as vertices, patches, textures, etc., the data amount needs to be reduced by means of a three-dimensional model lightweight technology in order to better adapt to various scenes and demands.
S3, extracting engineering information data from the BIM model after light weight processing and carrying out scene granularity and progressive loading pretreatment on the engineering information data; the scene fine granularity is used for acquiring the communication relation among different floors of a building and the distribution positions of the floors and the number of the floors;
s4, rendering the user data through a web browser of the client, wherein the rendering refers to writing relevant parameters into a web browser template and sending a rendered HTML document to the web browser;
s5, layering according to DIV in the secondary screen, wherein each layer is independently loaded asynchronously as a data interface, and each DIV layer only keeps the DIV label of the outermost layer when a page is initialized;
and S6, after the user performs interaction, the browser performs independent judgment, and the data is rendered again.
According to the method, the loading and rendering of the three-dimensional data are optimized, the loading capacity is reduced for a plurality of times, the precision of the model is adjusted in real time by adding the corresponding incremental network according to the viewpoint position, the first screen performance of the system is improved, the problem that the current three-dimensional system loads the white screen is avoided, and therefore better use experience is provided for users.
In another embodiment, as shown in fig. 2, building a BIM model of engineering information includes the steps of:
s1.1, building a structural framework of an engineering project by utilizing finite element analysis software and combining construction drawings of the engineering project, and carrying out stress analysis on the finite element analysis software to verify whether the built structural framework is correct; if not, adjusting the structural framework;
the engineering project can be a bridge, a railway or a building. The finite element analysis software can be LUSAS, MSC. Nastran, ansys, abaqus, LMS-Samtech, midas Civil and other software, preferably Midas Civil software is adopted in the embodiment, and the Midas Civil software is a tool for drawing and analyzing stress of a professional engineering construction structure framework.
In order to enable Midas Civil software to be communicated with BIM, the invention is provided with an export unit and an import unit, wherein the export unit is used for exporting a structure skeleton and skeleton parameters corresponding to the structure skeleton from Midas Civil software; the importing unit is used for transforming the structural framework and framework parameters corresponding to the structural framework into a basic framework and framework parameters accepted by the BIM model after the format conversion, and importing the basic framework and framework parameters into the BIM model.
S1.2, deriving a structural skeleton and skeleton parameters from finite element analysis software and converting the structural skeleton and skeleton parameters into a format; inputting the BIM model into the BIM model to serve as framework parameters and a basic framework of the BIM model;
s1.3, dividing the basic framework based on the construction drawing to divide the basic framework into a plurality of independent unit modules, taking a main body structure as a supporting piece of the unit modules, and constructing an auxiliary structure by taking the main body structure as a core;
s1.4, laying construction processes of a main structure and an auxiliary structure based on the construction drawing, dividing construction tasks according to the construction processes, and marking sequence codes of the construction tasks;
s1.5, configuring the BIM model into a BIM main unit according to the unit module, and constructing a BIM subunit by taking the BIM main unit as a main line, wherein the BIM subunit is used for developing construction tasks corresponding to an auxiliary structure;
and loading the construction task into the BIM main unit according to the sequence code, judging whether the construction task is used for constructing a main structure, if so, applying the construction task into the construction of the main structure by the BIM main unit according to the sequence code, otherwise, forwarding the construction task to a corresponding BIM subunit to finish the construction of the auxiliary structure.
In another embodiment, as shown in fig. 3, partitioning the infrastructure includes the steps of:
s1.3.1, importing the construction drawing into the identification model;
s1.3.2, identifying a total graph and a division graph in the construction drawing, and analyzing the association relationship between the division graph and the total graph;
s1.3.3, judging whether the auxiliary structure taking the main structure as a core and the main structure are contained in each sub-graph or not respectively;
s1.3.4 the foundation frame is divided into a plurality of individual unit modules according to a division drawing including the main structure and its subsidiary structure.
In another embodiment, as shown in fig. 4, the light-weight process for the built BIM model includes the following steps:
s2.1, dividing the constructed BIM model into N layers with different heights, wherein N is more than 3, the serial numbers of the N layers are respectively 0 and 1 … N-1, the division is based on visual effects to be displayed, model data corresponding to the N layers are respectively represented, and the N layers comprise a base layer capable of directly displaying the three-dimensional visual effects and N-1 enhancement layers capable of displaying the three-dimensional visual effects in combination with the base layer;
the higher the hierarchy, the higher the level of detail that can be exhibited; the high-level data depends on the low-level data, and is enhanced data of the low-level data. Model data corresponding to N layers can be respectively expressed as L0 、L1 、......、LN-1 Wherein N is an integer of 1 or more; wherein L is0 The corresponding layer is a basic layer capable of directly displaying three-dimensional visual effects; l (L)1 、......、LN-1 The corresponding hierarchy is capable of being matched with L0 In combination with an enhancement layer that displays a three-dimensional visual effect.
S2.2, respectively acquiring vertex compression rate corresponding to each layer, building space region corresponding to the three-dimensional visual space displayed by each layer, geometric grid data corresponding to the three-dimensional visual space displayed by each layer and building attribute data to be displayed in each layer;
and calculating the vertex compression rate according to the number of the deleted vertexes and the number of the original vertexes in the hierarchy, and dividing the number of the deleted vertexes by the number of the original vertexes to obtain the vertex compression rate. Geometric mesh data refers to mesh data for exhibiting geometric shapes; mesh data of the 3D model can be used as geometric Mesh data; the building attribute data refers to data representing the codes, shapes, names, types, materials, and physical topological relationships between the model elements. By building is meant a variety of facilities that the building contains, including building facilities and equipment facilities, such as house beams, electromechanical equipment, columns, walls, lines, doors, windows, furniture, floors, and the like.
S2.3, respectively generating a target data set X of each leveli The target data set refers to a data set composed of data of the hierarchy and the hierarchy below the hierarchy;
s2.4, respectively according to the target data sets X of each layeri Generating per-layer output data set Li The specific generation method is as follows: when the hierarchy number is equal to 0, the output dataset of the layer is equal to X0 When the hierarchy sequence number is greater than 0, the output data set of the layer is equal to the difference set between the target data set of the layer and the target data set of the lower layer of the layer;
and S2.5, performing self-adaptive rendering on each generated output data set.
First downloading layer 0 output data set L0 ' the frequency threshold value of rendering is set in advance, and then the output data sets L are sequentially processed0 ′、L1 ′…LN-1 ' rendering.
In the invention, geometric grids are adopted for carrying out data lightening on BIM model data, the model data is divided into different layers according to the display requirement of a user, component data, display precision, vertex compression rate and the like are set in each layer, a side folding algorithm is adopted for simplifying grid deletion vertexes, so that the calculated amount is reduced, and a half-side shrinkage scheme is adopted, namely, the contracted vertexes are one of the original two vertexes, and new vertexes cannot be introduced; the server provides models with different precision requirements for different requesters without re-lightening. While allowing the user to switch between models of different accuracy.
The BIM model data is lightened by adopting geometric grid data, the model data is divided into different layers according to the display needs of users, component data, display precision, vertex compression rate and the like are set in each layer, a side folding algorithm is adopted to simplify grid deletion vertexes, so that the calculated amount is reduced, a half-side shrinkage scheme is adopted, namely, the shrunk vertexes are one of the original two vertexes, and new vertexes cannot be introduced; the server provides models with different precision requirements for different requesters without re-lightening. And simultaneously, a user is allowed to switch between models with different accuracies, so that the BIM model can adapt to terminals with different performances.
As shown in FIG. 5, in another embodiment, the target data set X for each level is generatedi The method adopts a mode of compressing from high to low layer by layer, and comprises the following steps:
s2.3.1 the original data of BIM model is marked as XN Initializing the value of i to N-1,
S2.3.2X is giveni Initialized to Li+1 ;
S2.3.3 from the model data L of the ith layer according to the spatial region to be covered by the ith layeri Filtering out data not belonging to the spatial region;
s2.3.4 based on the component of the ith layer, correlating data of components not belonging to the ith layer with data from Xi Delete in the middle;
s2.3.5 according to the component attribute of the ith layer, the construction attribute data of the component attribute not belonging to the ith layer is obtained from Xi Delete in the middle;
s2.3.6 compressing X based on the preset vertex compression ratio of the ith layer on the premise of ensuring the geometric shapei The geometrical grid data of the building and of the component(s) to obtain the final target data set X of the ith layeri 。
In the layering lightweight process, the calculation amount of the system can be reduced by compressing the model layer by layer from a high-layer (high-precision) model to a low-layer (low-precision) model. In the process of data weight, a half-shrinkage edge compression method is adopted to simplify grid deleting vertexes, new vertexes are not introduced, the calculated amount is reduced, and the weight reduction process is accelerated.
In another embodiment, as shown in fig. 6, the scene refinement includes the steps of:
s3.1, analyzing space objects and floors containing semantic information in the BIM model data to generate an initial space structure of a building;
s3.2, analyzing the floor distribution condition of the whole building and the communication relation among floors by combining the initial space structure and the special components, respectively analyzing the communication relation inside each floor of the whole building by combining the initial space structure, and further generating a structure diagram for representing the division of indoor subspaces of the whole building and the connection relation among different subspaces;
s3.3, loading and transmitting visible objects around the user virtual avatar so as to perform scene roaming; and judging the subspace of the virtual avatar of the user, calculating the object in the current viewing cone, and effectively controlling the data amount to be loaded in the current viewpoint range, namely loading only the object in the current viewing cone, thereby reducing the loading data amount and realizing the asymptotic transmission and loading of scene data.
Electronic device embodiment:
as shown in fig. 7, the present invention further provides an electronic device, including a processor and a memory, where the memory stores computer program instructions that, when executed by the processor, implement the model-based lightweight three-dimensional visualization method for a WEB end according to the first aspect of the present invention.
The electronic device further comprises other components known to those skilled in the art, such as a communication bus and a communication interface, the arrangement and function of which are known in the art and are therefore not described in detail herein.
The memory of the present invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive example) of the computer-readable storage medium could include, for example: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer, for example, through the internet using an internet service provider.
Computer-readable storage medium embodiments:
the invention also provides a computer readable storage medium, wherein the storage medium stores a computer program, and the computer program is used for realizing the WEB terminal three-dimensional visualization method based on model weight in the first aspect of the invention when being executed by a processor.
In the description of the present specification, the meaning of "a plurality", "a number" or "a plurality" is at least two, for example, two, three or more, etc., unless explicitly defined otherwise.
While various embodiments of the present invention have been shown and described herein, it will be obvious to those skilled in the art that such embodiments are provided by way of example only. Many modifications, changes, and substitutions will now occur to those skilled in the art without departing from the spirit and scope of the invention. It should be understood that various alternatives to the embodiments of the invention described herein may be employed in practicing the invention.