High-precision priority display method for three-dimensional model
Technical Field
The invention relates to a three-dimensional visual high-precision model priority display method, in particular to a high-precision priority display method for a three-dimensional model.
Background
In smart city or CIM field, three-dimensional visualization is a very common technical means, has different production means to three-dimensional model, and the cost is different, and the precision is also different. According to the precision, 7 grades are defined for the three-dimensional model: the CIM 1-CIM 7 are higher in grade, and the accuracy of the model is higher. In a city-level three-dimensional visualization solution, because the production cost of a model at a lower level is lower, generally, a low-level model (CIM 1-CIM 2) is adopted in a scene with a large area, a medium-high level model (CIM 3-CIM 4) is adopted in a scene with a key area, and a high-level model (CIM 5-CIM 7) is generally adopted in a key cell or building. In a comprehensive urban three-dimensional visualization solution, three-dimensional models of different grades are basically displayed at the same time. Therefore, the range of models with different grades is required to be perfectly butted, and the models cannot be lacked or overlapped, otherwise, the display effect is poor, and the scheme of the smart city cannot be accurately supported. Currently, when dealing with models of different grades, it is necessary to refer to the range of models of other grades to perform trimming and filling, for example: a city whole-city range is a low-level model, a street is a middle-level three-dimensional model, and the low-level model within the street range needs to be manually removed when the low-level model is displayed in an overlapping mode. If there is a level of models that needs to be adjusted twice, the range of other models is also adjusted manually, as in the example above: a middle-level model of a street is additionally arranged in the city, and the low-level model of the newly-added street range needs to be manually removed.
Disclosure of Invention
The invention provides a high-precision priority display method of a three-dimensional model, which solves the problem that a high-level model automatically covers a low-level model for display, and adopts the following technical scheme:
a high-precision priority display method for a three-dimensional model comprises the following steps:
s1: preparing data of the three-dimensional models in different levels, acquiring the polygonal range of the three-dimensional model in each level, and adding the three-dimensional models in different levels into a three-dimensional scene;
s2: and for the three-dimensional models with different levels, a recursive algorithm is adopted, and the models with the high level are laminated from the models with the low level until the three-dimensional model with the lowest level is laminated.
Further, step S1 includes the following steps:
s11: creating three-dimensional models with different accuracies for the content of the three-dimensional scene, and dividing the three-dimensional models into seven levels from low to high according to the accuracies, namely CIM 1-CIM 7;
s12: acquiring a polygon range of each level three-dimensional model, and storing specific data of the polygon range into a PostgreSQL database;
s13: adding three-dimensional models of different grades into the same three-dimensional scene;
s14: a minimum altitude value for the current three-dimensional scene is determined and stored to a PostgreSQL database.
Further, step S2 includes the following steps:
s21: completing the covering of the next CIM6 grade model by the highest grade CIM7 grade model;
s22: taking the polygon range of the union of the CIM7 grade model and the CIM6 grade model as the range of the CIM6 grade model, and covering the next grade CIM5 grade model by the CIM6 grade model;
s23: and repeating the capping operation of the steps S21-S22, performing the capping operation on the next level by taking the new polygon range formed after capping of each level as a result, and if a model of a certain level does not exist, skipping the capping calculation of the level until the capping of the CIM1 level model is finished.
Further, in step S21, the capping process includes the steps of:
s211: firstly, calculating the intersection of the polygon range of the CIM7 level model and the polygon range of the CIM6 level model to obtain an intersection polygon range;
s212: then screening out all CIM6 grade models in the range of the intersection polygon;
s213: then hiding the independent single three-dimensional model in the CIM6 level model in the range;
s214: and finally, setting the heights of all triangular patches of the non-singletized three-dimensional model in the CIM6 level model in the range as the lowest altitude value of the current three-dimensional scene.
Further, in step S22, a union of the polygon range of the CIM7 hierarchical model and the polygon range of the CIM6 hierarchical model is calculated to obtain a union polygon range, and the union polygon range is processed by using a union function of the graphics engine.
Further, after step S2 is completed, the three-dimensional model file at a certain level in the three-dimensional scene is updated, and only the new three-dimensional model needs to be updated and stored in the polygon range corresponding to the level in the PostgreSQL database, and then step S2 is invoked, so as to implement the docking of model ranges at different levels.
Further, after step S2 is completed, when the model display state is selected again, the three-dimensional model file of the level that needs to be displayed is determined, and step S2 is invoked to implement the capping process of the new three-dimensional model.
The high-precision priority display method of the three-dimensional model realizes that the high-level model automatically covers the low-level model when different-level models exist in the three-dimensional display page at the same time. When the three-dimensional model of each grade is manufactured, cutting is not needed according to the range of other grade models; when the range of the model of a certain level is changed, the models of other levels are not required to follow the change any more. The labor cost is greatly reduced, and perfect butt joint of different levels of model ranges can be realized without shortage and overlapping.
Drawings
FIG. 1 is a schematic flow chart of a high-precision priority display method of the three-dimensional model;
FIG. 2 is a schematic diagram of a CIM7 class model capping to a CIM6 class model;
FIG. 3 is a schematic diagram of capping of a CIM6 class model to a CIM5 class model;
FIG. 4 is a schematic diagram of a high-level model recursively capping to a low-level model;
FIG. 5 is a schematic diagram of a final display of the urban scene in the embodiment.
Detailed Description
The high-precision priority display method of the three-dimensional model adopts the strategies of hiding low-level models and displaying high-level models in the same range aiming at independent single three-dimensional models (such as building models); for a flaky non-monomorphic three-dimensional model (such as a terrain model), the height of all triangular patches (which are computer graphics terms and are the minimum units of graphics in a display memory and are similar to atoms in physics) of a low-level model in the same range is set as the minimum altitude value of the current city, and the high-level model is normally displayed.
The high-precision priority display method of the three-dimensional model comprises the following steps:
s1: preparing data of different levels of the three-dimensional model, acquiring a polygon range of the three-dimensional model of each level, and adding the three-dimensional models of different levels into a three-dimensional scene; an example is illustrated in which:
s11: the three-dimensional scene in a certain embodiment is an urban scene, three-dimensional models with different precisions are created for urban contents (including buildings and ground), and the three-dimensional models are divided into seven levels according to the precisions from low to high: CIM 1-CIM 7;
s12: acquiring a Polygon (Polygon) range of each grade three-dimensional model, and storing specific data of the Polygon (Polygon) range into a PostgreSQL database;
s13: the three-dimensional models with different grades are added into the same three-dimensional scene, namely the urban scene, and the urban scene can be built by using an Explorer loading model in DTS platform software of the flight technology.
S14: a minimum altitude value for the current city is determined and stored to the PostgreSQL database.
S2: and for the three-dimensional models with different levels, a recursive algorithm is adopted, and the models with the high level are laminated from the models with the low level until the three-dimensional model with the lowest level is laminated. The details are as follows:
s21: as shown in FIG. 2, the CIM7 grade model covers the CIM6 grade model, and the method comprises the following operation steps:
s211: firstly, calculating the intersection of a range of a CIM7 grade model Polygon (Polygon) and a range of a CIM6 grade model Polygon (Polygon) to obtain an intersection Polygon (Polygon) range; this step can be handled using the intersection-taking function of the existing graphics engine; this step can be handled using the interject function in turf.
S212: then screening out all CIM6 grade models in the range of the intersection Polygon (Polygon); this step can be handled using the functions of existing graphics engines that can determine whether a model belongs to a specified polygon range; this step can be handled, for example, using the boleagontains function in turf.js, which can determine whether a model belongs to a specified polygon range;
s213: then hiding the independent single three-dimensional model (such as a building model) in the CIM6 level model in the range, wherein the step can be processed by using a hiding function of an existing graphic engine; for example, this step may be processed using the tilelayer. hideActor (id, objectId, fn) function in the Cloud second development API in the DTS platform software of the flight technology;
s214: and finally, setting the heights of all triangular patches of the non-singleton three-dimensional model (such as a terrain model) in the CIM6 level model in the range as the lowest altitude value of the current city.
S22: as shown in FIG. 3, the CIM6 grade model covers the CIM5 grade model, and the method comprises the following operation steps:
s221: firstly, calculating a union of a range of a CIM7 level model Polygon (Polygon) and a range of a CIM6 level model Polygon (Polygon) to obtain a union Polygon (Polygon) range; this step can be handled using the union function of the existing graphics engine; js, this step may be processed using the union function in turf, and may return the union range of the two polygon ranges.
S222: and then, the union Polygon (Polygon) range is used as a CIM6 grade model range to be capped to a CIM5 grade model range, and the step of capping specifically can repeat the step S21 to complete the capping of the CIM6 grade model to the CIM5 grade model.
S23: as shown in fig. 4, the capping operations in steps S21-S22 are repeated, the new polygon range formed after capping of each level is used as a result, the capping operation is performed on the next level, if there is no model of a certain level, the capping calculation of the level is skipped until the capping of the CIM1 level model is completed, and the final display effect of the city scene is shown in fig. 5.
S3: after a new three-dimensional model is added or the display state of the model is selected again, the mode of 'refreshing' is clicked on a scene interface to trigger gland calculation, and perfect butt joint of the same-level model range can be achieved without shortage and overlapping.
The method has the following effects: and updating the three-dimensional model file of a certain grade in the scene every time, namely only updating the Polygon (Polygon) range corresponding to the grade stored in the PostgreSQL database, and calling the interactive logic once to realize perfect butt joint of the model ranges of different grades without shortage and overlap.
When a new three-dimensional model is added, the level of the new three-dimensional model is determined based on the accuracy, and the capping process of the new three-dimensional model is performed based on the polygon range in step S2.
The re-checking of the model display state means that it is determined whether or not to display the three-dimensional models of some levels, and after the three-dimensional models of some levels are selected for display, the capping process of the new three-dimensional model is performed according to step S2.
The high-precision priority display method of the three-dimensional model realizes that the high-level model automatically covers the low-level model when different-level models exist in the three-dimensional display page at the same time. When the three-dimensional model of each grade is manufactured, cutting is not needed according to the range of other grade models; when the range of the model of a certain level is changed, the models of other levels are not required to follow the change any more. The labor cost is greatly reduced, and perfect butt joint of different levels of model ranges can be realized without shortage and overlapping.