3DTiles-based parametric modeling method
Through a parameterized modeling method based on 3DTiles, combined with a uniform global octree spatial index suitable for spherical surfaces, the problems of low loading efficiency, complex slices and polar calculation errors in the generation and rendering of three-dimensional geospatial data are solved, and the problem of low loading efficiency, complex slices and polar calculation errors in the generation and rendering of three-dimensional geospatial data is realized. Efficient data updates and stable visualizations.
Patent Information
- Application Number
- CN202411410245.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-02-07
AI Technical Summary
When generating and rendering three-dimensional geospatial data, the loading efficiency is low, the slicing process is complex and time-consuming, and the calculation error in polar regions is large, which affects the accuracy and processing efficiency of the data.
Using a parametric modeling method based on 3DTiles, the model and spatial index encoding within the LOD level are constructed by obtaining the parameterized data of objects, and the tile size is calculated using the uniform global octree spatial index method suitable for the sphere. Build a spatial index file and finally use the Cesium rendering engine to load the display modeled object.
Real-time incremental update of data is realized, the efficiency of data update is improved, maintenance costs are reduced, calculation errors in polar regions are avoided, smoother and consistent visual effects are provided, and the stability and reliability of the system are improved.
Smart Images

Figure CN119399389A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of geographic space three-dimensional data visualization, and in particular to a parameterized modeling method based on 3D Tiles. Background Art
[0002] 3DTiles is a data format for stream processing and rendering of three-dimensional geospatial data, such as photogrammetry and three-dimensional buildings. Based on the transmission of renderable hierarchical data structures and tile format sets, the client can render three-dimensional models based on 3DTiles data.
[0003] The current method of generating 3D tiles is to export common 3D models through manual modeling, and then convert them into 3D tiles through some slicing tools. Manual modeling requires a lot of manpower who are proficient in using modeling software, which is costly and time-consuming. The existing model formats (such as obj / fbx) have large data volumes, and cannot be efficiently loaded and displayed on the browser side due to computer memory and GPU limitations. Therefore, slicing is required to generate 3D tiles, but due to different modeling software and different modeling habits of modelers, it is impossible to simplify and slice in a unified way, resulting in a long slicing process and poor loading efficiency and effect of slicing results on the browser side.
[0004] The existing global construction of three-dimensional models is usually used to organize two-dimensional geographic spatial data, and does not effectively process height data. The three-dimensional model at this time cannot display the height changes of objects, resulting in low modeling accuracy. The existing octree spatial index used globally causes calculation errors due to infinite subdivision in the Arctic and Antarctic regions, affecting the accuracy and processing efficiency of polar region data. Summary of the invention
[0005] In view of the above analysis, an embodiment of the present invention aims to provide a parametric modeling method based on 3DTiles to solve the existing problems of low loading efficiency, complex and time-consuming slicing process and calculation errors in polar regions when efficiently generating and rendering three-dimensional geographic spatial data.
[0006] The purpose of the present invention is mainly achieved through the following technical solutions:
[0007] The present invention provides a parametric modeling method based on 3D Tiles, comprising the following steps:
[0008] Acquire parametric data of the object to be modeled; wherein the parametric data includes the shape, geometric characteristic parameters and geographical location of the object;
[0009] Based on the parameterized data, the LOD level range of the object to be modeled is obtained, and the model of the object to be modeled at each level within the LOD level range and the spatial index code are constructed; wherein the LOD level range includes a maximum LOD level to a minimum LOD level; the maximum LOD level and the minimum LOD level are determined based on a uniform global octree spatial index method applicable to a sphere;
[0010] Based on the object models to be modeled at each level and the spatial index codes, a spatial index file is constructed and the modeled objects are loaded and displayed using the Cesium rendering engine.
[0011] Furthermore, the homogenized global octree spatial indexing method suitable for a sphere is based on the WGS84 coordinate system, and the tile sizes of each LOD level in the x direction, y direction and z direction are calculated respectively, and based on the parametric data of the object to be modeled and the tile sizes of each LOD level in the x direction, y direction and z direction, the maximum LOD level and the minimum LOD level of the object to be modeled are obtained; wherein, when calculating the tile size in the x direction, the number of tiles in the x direction is changed according to the latitude value; the x direction is the east-west direction, the y direction is the north-south direction, and the z direction is the vertical direction.
[0012] Furthermore, the following formula is used to obtain the tile size of each LOD level in the x direction:
[0013] tilesizex zoomx =180 / tilecountx zoomx
[0014]
[0015] row zoomx =ceiling[(90-lat) / [180 / (2 zoomx )]]
[0016] Among them, tilesizex zoomx Indicates the tile size in the x direction at the zoomx level; tilecountx zoomx Indicates the number of tiles in the x direction at the zoomx level; row zoomx Indicates the row in the y direction of the tile in the zoomx-th level; lat indicates latitude.
[0017] Furthermore, the following formula is used to obtain the tile size of each LOD level in the y direction:
[0018] tilesizey zoomy =180 / (2 zoomy )
[0019] Among them, tilesizeyzoomy Indicates the tile size in the y direction at the zoomy level.
[0020] Furthermore, the following formula is used to obtain the tile size of each LOD level in the z direction:
[0021] tilesizez zoomz =half / (2 zoomz )
[0022] Among them, tilesizez zoomz Indicates the tile size in the z direction at the zoomz level; half means half of the equatorial circumference.
[0023] Furthermore, the minimum LOD level of the object to be modeled is obtained, including:
[0024] Constructing a minimum volume bounding box of the object to be modeled based on the geometric feature parameters and the geographical location of the parameterized data;
[0025] Based on the range of the minimum volume bounding box of the object to be modeled in the x direction and the maximum latitude value of the minimum volume bounding box, the minimum level of the tile size in the x direction is obtained as the minimum LOD level in the x direction;
[0026] Based on the range of the minimum volume bounding box of the object to be modeled in the y direction, the minimum level of the tile size in the y direction is obtained using the following formula as the minimum LOD level in the y direction:
[0027] zoom miny =floor[log2(180 / (maxy-miny)]
[0028] Among them, zoom miny Indicates the minimum LOD level in the y-axis direction; floor[] indicates rounding down; maxy indicates the maximum latitude value of the minimum volume bounding box of the object to be modeled; miny indicates the minimum latitude value of the minimum volume bounding box of the object to be modeled;
[0029] Based on the range of the minimum volume bounding box of the object to be modeled in the z direction, the minimum level of the tile size in the z direction is obtained using the following formula as the minimum LOD level in the z direction:
[0030] zoom minz =floor[log2(half / (maxz-minz)]
[0031] Among them, zoom minzIndicates the minimum LOD level in the z direction; floor[] indicates rounding down; half indicates half of the equatorial circumference; maxz indicates the maximum value of the minimum volume bounding box of the object to be modeled in the z direction; minz indicates the minimum value of the minimum volume bounding box of the object to be modeled in the z direction;
[0032] The minimum value of the minimum LOD level in the x direction, the minimum LOD level in the y direction, and the minimum LOD level in the z direction is used as the minimum LOD level of the object to be modeled.
[0033] Furthermore, the step of obtaining the minimum level of the tile size in the x direction as the minimum LOD level in the x direction based on the range of the minimum volume bounding box of the object to be modeled in the x direction and the maximum latitude value of the minimum volume bounding box includes:
[0034] Set the initial value of the iteration zoom minx is 0, and the following steps are executed in a loop:
[0035] Based on the maximum latitude value of the minimum volume bounding box of the object to be modeled, the size of each tile is obtained using the following formula:
[0036]
[0037] in, Indicates the zoom minx The tile size of the level in the x direction; Indicates the zoom minx The number of tiles in the x direction of the layer; Indicates the zoom minx The row in the y direction of the tile in the hierarchy; maxy represents the maximum latitude value of the minimum volume bounding box of the object to be modeled;
[0038] When the following equation is true, the zoom minx As the minimum LOD level in the x-axis direction, end the loop:
[0039]
[0040] Wherein, maxx represents the maximum longitude value of the minimum volume bounding box of the object to be modeled; minx represents the minimum longitude value of the minimum volume bounding box of the object to be modeled.
[0041] Furthermore, the maximum LOD level of the object to be modeled is obtained, including:
[0042] Based on the tile sizes of each LOD level in the x direction, y direction and z direction, the geometric errors of each LOD level in the x direction, y direction and z direction are obtained;
[0043] When the minimum parameter value among the geometric feature parameters of the object to be modeled is greater than the maximum geometric error in the x-direction, the level corresponding to the maximum geometric error in the x-direction is used as the maximum LOD level in the x-direction;
[0044] When the minimum parameter value among the geometric feature parameters of the object to be modeled is greater than the maximum geometric error in the y direction, the level corresponding to the maximum geometric error in the y direction is used as the maximum LOD level in the y direction;
[0045] When the minimum parameter value among the geometric feature parameters of the object to be modeled is greater than the maximum geometric error in the z direction, the level corresponding to the geometric error in the z direction is used as the maximum LOD level in the z direction;
[0046] The maximum value of the maximum LOD level in the x direction, the maximum LOD level in the y direction, and the maximum LOD level in the z direction is used as the maximum LOD level of the object to be modeled.
[0047] Furthermore, the geometric errors of each LOD level in the x direction, y direction and z direction are ratios of the tile sizes of each LOD level in the x direction, y direction and z direction to a preset screen resolution.
[0048] Further, constructing the models of the objects to be built at each level within the LOD level range, including: constructing a mesh three-dimensional model with the z-direction geometric error of each level within the LOD level range as a threshold as the model of the objects to be built at each level;
[0049] Constructing the spatial index code of the object to be modeled, including:
[0050] Based on the tile sizes of the minimum LOD level in the x-direction, the y-direction and the z-direction and the minimum volume bounding box size and the geographical location of the object to be modeled, a spatial index code of the minimum LOD level of the object to be modeled is obtained;
[0051] Each tile in the spatial index code of the minimum LOD level is recursively partitioned using an octree until the maximum LOD level is reached, thereby obtaining the spatial index code of each level of the object to be modeled from the minimum LOD level to the maximum LOD level.
[0052] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:
[0053] 1. The present invention adopts a uniform global octree spatial index suitable for spherical surfaces. Compared with the existing scheme that adopts a local spatial index, when new data is added, only the data in the spatial index that intersects with the updated data needs to be recalculated for the newly added data part, and there is no need to recalculate all the spatial indexes, thereby realizing real-time incremental update of data, improving the efficiency of data update, and reducing maintenance costs.
[0054] 2. The present invention uses a uniform global octree spatial index suitable for a spherical surface. By adjusting the block partitioning method, the block size in the Arctic and Antarctic regions is kept consistent with that in other regions, thereby achieving uniform block size on a global scale. During visualization, the uniform block size can provide a smoother and more consistent visual effect.
[0055] 3. The index block method of the present invention avoids calculation errors caused by infinite subdivision in the Arctic and Antarctic regions, avoids complex geometric calculations in polar regions, simplifies the data processing process, and helps to improve the stability and reliability of the system.
[0056] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] The drawings are only for the purpose of illustrating particular embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like components throughout the drawings.
[0058] Figure 1 A schematic diagram of a process of a parametric modeling method based on 3DTiles in an embodiment of the present invention;
[0059] Figure 2 A schematic diagram of traditional octree tile partitioning in an embodiment of the present invention;
[0060] Figure 3 This is a block diagram when the LOD level in the x direction is 1 in an embodiment of the present invention;
[0061] Figure 4 This is a block diagram when the LOD level in the x direction is 2 in an embodiment of the present invention;
[0062] Figure 5 This is a block diagram when the LOD level in the x direction is 3 in an embodiment of the present invention;
[0063] Figure 6The figure is a schematic diagram of a process for determining the minimum LOD level of an object to be modeled in an embodiment of the present invention. DETAILED DESCRIPTION
[0064] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0065] A specific embodiment of the present invention discloses a parametric modeling method based on 3DTiles, such as Figure 1 As shown, the steps S1 to S3 are included:
[0066] Step S1, obtaining parametric data of an object to be modeled; wherein the parametric data includes the shape, geometric feature parameters and geographical location of the object.
[0067] Specifically, the object to be modeled in this embodiment is a three-dimensional solid model. According to the geometric characteristics of the three-dimensional solid, it is abstracted into a point, line or surface solid model, mapped into variable parameters, and the model size, shape, etc. are described by controlling the value of each parameter. Exemplarily, the three-dimensional solid model can be a linear solid model, used to represent roads, rivers, pipelines, cables, etc., whose geometric characteristic parameters are line width or diameter, and whose geographical location is the coordinates of the vertices on the line; a surface solid model, used to represent the roof, wall, flat ground, etc. of a building, whose geometric characteristic parameters are the outer contour polygon of the face, and whose geographical location is the vertex coordinates of the polygon; a cylinder model, used to represent pipelines, poles, columns, etc., whose geometric characteristic parameters are radius and height, and whose geographical location is the center coordinates of the bottom circle; a rectangular parallelepiped / cube model, used to represent containers, rooms, warehouses, etc., whose geometric characteristic parameters are its length, width, and height, and its geographical location is the coordinates of a fixed angle; a sphere model, whose parameters are radius, and its geographical location is the coordinates of the center of the sphere; a cone model, whose geometric characteristic parameters are the bottom radius and height, and its geographical location is the vertex coordinates and the coordinates of the center of the bottom circle.
[0068] Step S2, obtaining the LOD level range of the object to be modeled based on the parameterized data, and constructing the model of the object to be modeled at each level within the LOD level range and the spatial index code; wherein the LOD level range includes the maximum LOD level to the minimum LOD level; determining the maximum LOD level and the minimum LOD level based on a uniform global octree spatial indexing method applicable to a sphere.
[0069] Specifically, the LOD level range dynamically adjusts the detail complexity of the model according to the distance or viewing angle between the user and the scene. The maximum LOD level represents the highest level of detail, which is used for close-up observation and contains the most geometric details. The minimum LOD level represents the lowest level of detail, which is used for long-distance observation and contains the least geometric details. The LOD level range is determined by determining the visualization requirements of the object to be modeled at different viewing distances based on the parametric data of the object to be modeled, and calculating the different levels of detail corresponding to each level from the maximum LOD level to the minimum LOD level.
[0070] Furthermore, the homogenized global octree spatial indexing method suitable for a sphere is based on the WGS84 coordinate system, and the tile sizes of each LOD level in the x direction, y direction and z direction are calculated respectively, and based on the parametric data of the object to be modeled and the tile sizes of each LOD level in the x direction, y direction and z direction, the maximum LOD level and the minimum LOD level of the object to be modeled are obtained; wherein, when calculating the tile size in the x direction, the number of tiles in the x direction is changed according to the latitude value; the x direction is the east-west direction, the y direction is the north-south direction, and the z direction is the vertical direction.
[0071] Specifically, Figure 2 As shown, in high latitudes (close to the North and South Poles), traditional octree indexing will generate many very thin tiles, which will reduce indexing efficiency and complicate data management. In this embodiment, in high latitudes, by adjusting the block rules, the number and size of tiles are reduced, so that the shape of the tiles is more uniform.
[0072] The WGS84 coordinate system is a global reference coordinate system, in which the x-direction is longitude, indicating the angle between a location and the prime meridian, with the longitude ranging from -180 degrees to +180 degrees; the y-direction is latitude, indicating the angle between a location and the equator, with the latitude ranging from -90 degrees to +90 degrees; the z-direction is altitude, indicating the altitude of a location, measured upward from sea level.
[0073] Furthermore, the following formula is used to obtain the tile size of each LOD level in the x direction:
[0074] tilesizex zoomx =180 / tilecountx zoomx
[0075]
[0076] row zoomx =ceiling[(90-lat) / [180 / (2 zoomx )]]
[0077] Among them, tilesizex zoomx Indicates the tile size in the x direction at the zoomx level; tilecountx zoomx Indicates the number of tiles in the x direction at the zoomx level; row zoomx Indicates the row in the y direction of the tile in the zoomx-th level; lat indicates latitude; floor[] indicates the floor rounding function; ceiling[] indicates the ceiling rounding function.
[0078] Specifically, in the global octree spatial index, when the LOD level is level 0, it is the coarsest level, covering the entire earth. Level 1 is to perform octree segmentation based on level 0. In this implementation, in high-latitude areas near the North and South Poles, the tile size is increased by reducing the number of tile blocks. Therefore, for a latitude lat, first calculate its row number. Once the row number is obtained, the number of tiles in the x direction can be calculated. The row number is calculated by comparing the latitude lat with the latitude step associated with the LOD level, and the latitude step is 180 / (2 zoomx ).
[0079] For example, when the x-direction LOD level (zoomx) is 1, Figure 3 As shown, there is a total of 1 row in the northeast hemisphere, the number of blocks in the first row is 2, and the size of each block is 90 degrees; when the x-direction LOD level (zoomx) is 2, such as Figure 4 As shown, there are 2 rows in the northeast hemisphere. The number of blocks in the first row is 2, and the size of each block is 90 degrees. The number of blocks in the second row is 4, and the size of each block is 45 degrees. When the x-direction LOD level (zoomx) is 3, as shown Figure 5 As shown, there are 4 rows in the northeastern hemisphere. The number of blocks in the first row is 2, and the size of each block is 90 degrees. The number of blocks in the second row is 4, and the size of each block is 45 degrees. The number of blocks in the third row is 8, and the size of each block is 22.5 degrees. The number of blocks in the fourth row is 8, and the size of each block is 22.5 degrees. That is, as the row number increases, the latitude decreases, the length of the latitude becomes longer, and the number of blocks increases. Conversely, when the row number decreases, the latitude increases, the length of the latitude shrinks, and the number of blocks decreases. This makes the size of all blocks in the x direction relatively uniform, which helps to balance the coverage area of tiles globally.
[0080] Furthermore, the following formula is used to obtain the tile size of each LOD level in the y direction:
[0081] tilesizey zoomy =180 / (2 zoomy )
[0082] Among them, tilesizey zoomy Indicates the tile size in the y direction at the zoomy level.
[0083] Specifically, in the y direction, the total latitude range of the earth is 180 degrees, and the tile size in the y direction of each level is equal to the latitude of the earth.
[0084] Furthermore, the following formula is used to obtain the tile size of each LOD level in the z direction:
[0085] tilesizez zoomz =half / (2 zoomz )
[0086] Among them, tilesizez zoomz Indicates the tile size in the z direction at the zoomz level; half means half of the equatorial circumference.
[0087] Specifically, in this embodiment, in order to maintain consistency with the geographic coordinate system and ensure that changes in tile size at different LOD levels match changes in longitude and latitude, when calculating the tile size in the height z direction, the equatorial semi-circumference provides a reference length related to the earth's surface to simplify the calculation of tile size.
[0088] Further, such as Figure 6 As shown, obtaining the minimum LOD level of the object to be modeled includes steps S201 to S205:
[0089] Step S201: construct a minimum volume bounding box of the object to be modeled based on the geometric feature parameters and the geographical location of the parameterized data.
[0090] Specifically, the AABB method is used to determine the eight vertex coordinates of the minimum volume bounding box based on the geometric feature parameters of the object to be modeled, namely the maximum coordinate value and the minimum coordinate value in the x-axis, y-axis and z-axis directions, to construct the minimum volume bounding box of the object to be modeled.
[0091] Based on the geographic location of the object to be modeled, the longitude and latitude coordinates of the eight vertices of the minimum volume bounding box are obtained, thereby obtaining the maximum longitude / latitude value and the minimum longitude / latitude value of the minimum volume bounding box, which is used to quickly determine the location of the object in the world. Exemplarily, the longitude and latitude coordinates of the eight vertices of the minimum volume bounding box can be obtained using GIS software.
[0092] Step S202: Based on the range of the minimum volume bounding box of the object to be modeled in the x direction and the maximum latitude value of the minimum volume bounding box, the minimum level of the tile size in the x direction is obtained as the minimum LOD level in the x direction.
[0093] Specifically, by calculating the x-direction tile size that is smaller than the x-direction range (i.e., longitude difference) of the minimum volume bounding box of the object to be modeled for the first time, the obtained LOD level is the minimum LOD level in the x-direction, which is the beginning of displaying details of the object to be modeled in the x-direction. At higher LOD levels, the tile size is smaller, and more details of the object to be modeled can be displayed. By ensuring that higher-detail data is loaded and rendered only when the user needs it, the amount of data transmission can be significantly reduced and rendering efficiency can be improved, which helps to optimize resource usage.
[0094] Further, obtaining the minimum level of the tile size in the x direction as the minimum LOD level in the x direction includes the following steps:
[0095] Set the initial value of the iteration zoom minx is 0, and the following steps are executed in a loop:
[0096] Based on the maximum latitude value of the minimum volume bounding box of the object to be modeled, the size of each tile is obtained using the following formula:
[0097]
[0098] in, Indicates the zoom minx The tile size of the level in the x direction; Indicates the zoom minx The number of tiles in the x direction of the layer; Indicates the zoom minx The row in the y direction of the tile in the hierarchy; maxy represents the maximum latitude value of the minimum volume bounding box of the object to be modeled;
[0099] When the following equation is true, the zoom minx As the minimum LOD level in the x-axis direction, end the loop:
[0100]
[0101] Wherein, maxx represents the maximum longitude value of the minimum volume bounding box of the object to be modeled; minx represents the minimum longitude value of the minimum volume bounding box of the object to be modeled.
[0102] Step S203: Based on the range of the minimum volume bounding box of the object to be modeled in the y direction, the minimum level of the tile size in the y direction is obtained using the following formula as the minimum LOD level in the y direction:
[0103] zoom miny =floor[log2(180 / (maxy-miny)]
[0104] Among them, zoomminy Indicates the minimum LOD level in the y-axis direction; floor[] indicates rounding down; maxy indicates the maximum latitude value of the minimum volume bounding box of the object to be modeled; miny indicates the minimum latitude value of the minimum volume bounding box of the object to be modeled.
[0105] Specifically, by calculating the tile size in the y direction for the first time being smaller than the range of the minimum volume bounding box of the object to be modeled in the y direction (i.e., the latitude difference), the obtained LOD level is used as the minimum LOD level in the y direction, which is the beginning of displaying details of the object to be modeled in the y direction.
[0106] Step S204: When the minimum volume bounding box of the object to be modeled is within the range in the z direction, the minimum level of the tile size in the z direction is obtained using the following formula as the minimum LOD level in the z direction:
[0107] zoom minz =floor[log2(half / (maxz-minz)]
[0108] Among them, zoom minz Indicates the minimum LOD level in the z direction; floor[] means rounding down; half means half of the equatorial circumference; maxz means the maximum value of the minimum volume bounding box of the object to be modeled in the z direction; minz means the minimum value of the minimum volume bounding box of the object to be modeled in the z direction.
[0109] Specifically, by calculating the first time that the tile size in the z direction is smaller than the range of the minimum volume bounding box of the object to be modeled in the z direction (i.e., the height difference), the obtained LOD level is the minimum LOD level in the z direction, which is the beginning of displaying details of the object to be modeled in the z direction.
[0110] Step S205: The minimum value among the minimum LOD level in the x direction, the minimum LOD level in the y direction and the minimum LOD level in the z direction is used as the minimum LOD level of the object to be modeled.
[0111] Specifically, the minimum value of the minimum LOD levels in the three directions is taken as the minimum LOD level of the object to be modeled, ensuring that the model can be rendered with appropriate details in all directions and avoiding excessive details in one direction, thereby optimizing rendering performance and resource usage.
[0112] Further, obtaining the maximum LOD level of the object to be modeled includes steps S211 to S215:
[0113] Step S211: Based on the tile sizes of each LOD level in the x direction, y direction and z direction, obtain the geometric errors of each LOD level in the x direction, y direction and z direction.
[0114] Specifically, the geometric error is a measure of the degree of approximation between the approximate geometric model drawn by the computer and the ideal mathematical model. The geometric error provides a quantitative indicator for controlling the degree of simplification of the model at different LOD levels. The smaller the error value, the richer the details of the model; the larger the error value, the simpler the model.
[0115] Furthermore, the geometric errors of each LOD level in the x direction, y direction and z direction are ratios of the tile sizes of each LOD level in the x direction, y direction and z direction to a preset screen resolution.
[0116] Specifically, for each direction, the ratio of the tile size in each direction to the screen resolution is calculated, which represents the actual physical size of each pixel at the current LOD level. This ratio is the geometric error, which represents the maximum allowable error of switching from a simplified model at the current LOD level to a more detailed model on the screen. Exemplarily, in this embodiment, the preset screen resolution is 512.
[0117] Step S212: When the minimum parameter value of the geometric feature parameters of the object to be modeled is greater than the maximum geometric error in the x direction, the level corresponding to the maximum geometric error in the x direction is used as the maximum LOD level in the x direction.
[0118] Specifically, the maximum LOD level is the most detailed level at which the model can be rendered. When all details of the model need to be clearly displayed, the maximum LOD level can ensure that all details are rendered. Therefore, the maximum LOD level is determined using the minimum parameter value among the geometric feature parameters of the object to be modeled to ensure that all features of the object to be modeled can be displayed in detail.
[0119] When the minimum parameter value of the geometric feature parameters of the object to be modeled is greater than the geometric error in the x-direction for the first time, the LOD level corresponding to the current geometric error is used as the maximum LOD level for displaying the details in the x-direction.
[0120] Step S213: When the minimum parameter value of the geometric feature parameters of the object to be modeled is greater than the maximum geometric error in the y direction, the level corresponding to the maximum geometric error in the y direction is used as the maximum LOD level in the y direction.
[0121] Specifically, when the minimum parameter value of the geometric feature parameters of the object to be modeled is greater than the geometric error in the y direction for the first time, the LOD level corresponding to the current geometric error is used as the maximum LOD level for detail display in the y direction.
[0122] Step S214: When the minimum parameter value of the geometric feature parameters of the object to be modeled is greater than the maximum geometric error in the z direction, the level corresponding to the geometric error in the z direction is used as the maximum LOD level in the z direction.
[0123] Specifically, when the minimum parameter value of the geometric feature parameters of the object to be modeled is greater than the geometric error in the z direction for the first time, the LOD level corresponding to the current geometric error is used as the maximum LOD level for displaying details in the z direction.
[0124] Step S215: The maximum value of the maximum LOD level in the x direction, the maximum LOD level in the y direction, and the maximum LOD level in the z direction is used as the maximum LOD level of the object to be modeled.
[0125] Specifically, this embodiment selects the maximum LOD level in the x-direction, y-direction and z-direction as the maximum LOD level of the entire object to be modeled, so as to ensure that the visual quality is not affected by insufficient details when observing in any direction, and to ensure that the object to be modeled can be rendered with appropriate details in all directions.
[0126] Furthermore, constructing the models of the objects to be built at each level within the LOD level range includes: using the mesh three-dimensional model constructed with the z-direction geometric error of each level within the LOD level range as a threshold as the model of the objects to be built at each level.
[0127] Specifically, a mesh 3D model is a geometric structure composed of vertices, edges, and faces, which is used to represent 3D objects in computer graphics. The complexity of a mesh 3D model varies at different LOD levels. A high-level mesh 3D model contains more vertices and faces to provide more detailed geometric information.
[0128] In scenes such as terrain browsing and architectural visualization, height information in the z direction is often the main factor in distinguishing different features to ensure correct visual representation. Therefore, this embodiment uses the geometric error in the z direction of each level within the LOD level range as a threshold to construct a mesh three-dimensional model of the object to be built at each level.
[0129] Exemplarily, when constructing mesh three-dimensional models at each level, the embodiment of the present invention adopts the Douglas-Peucker algorithm, uses the z-direction geometric error of each level as a threshold, and performs polygon simplification to generate models for display at each level, finding a balance between reducing the number of vertices and maintaining visual quality.
[0130] Furthermore, constructing the spatial index code of the object to be modeled includes:
[0131] Based on the tile sizes of the minimum LOD level in the x, y and z directions and the minimum volume bounding box size and the geographical location of the object to be modeled, a spatial index code of the minimum LOD level of the object to be modeled is obtained.
[0132] Specifically, the global octree spatial index used in this embodiment provides a globally consistent block strategy. Since the index structure is fixed, the calculation of determining the location of the data block only needs to be performed once and the calculation result can be reused, which reduces the repeated calculation process and improves efficiency. By calculating the spatial index of the minimum LOD level, data in a specific area can be quickly located and accessed to display the object to be modeled.
[0133] Use the following formula to obtain the maximum and minimum index values of each direction in the minimum LOD level of the object to be modeled:
[0134] MinX Index zoommin =floor((minx+180) / tilesizex zoommin )
[0135] MaxXIndex zoommin =ceiling((maxx+180) / tilesizex zoommin )
[0136] MinYIndex zoommin =floor((miny+90) / tilesizey zoommin )
[0137] MaxYIndex zoommin =ceiling((maxy+90) / tilesizey zoommin )
[0138] MinZIndex zoommin =floor(minz / tilesizez zoommin )
[0139] MaxZIndex zoommin =ceiling(maxz / tilesizez zoommin )
[0140] Among them, zoommin represents the minimum LOD level of the object to be modeled; MinXIndex zoommin Indicates the minimum x-direction index value in the minimum LOD level of the object to be modeled; minx indicates the minimum longitude value in the x-direction of the minimum volume bounding box of the object to be modeled; tilesizex zoomminIndicates the x-direction tile size of the object to be modeled at the minimum LOD level; MaxXIndex zoommin Indicates the maximum x-direction index value in the minimum LOD level of the object to be modeled; maxx indicates the maximum longitude value in the x-direction of the minimum volume bounding box of the object to be modeled; MinYIndex zoommin represents the minimum y-direction index value in the minimum LOD level of the object to be modeled; miny represents the minimum latitude value of the minimum volume bounding box of the object to be modeled in the y direction; tilesizey zoommin Indicates the y-direction tile size of the object to be modeled in the minimum LOD level; MaxYIndex zoommin Indicates the maximum value of the y-direction index in the minimum LOD level of the object to be modeled; maxy indicates the maximum latitude value of the minimum volume bounding box of the object to be modeled in the y direction; MinZIndex zoommin represents the minimum index value in the z direction of the minimum LOD level of the object to be modeled; minz represents the minimum value in the z direction of the minimum volume bounding box of the object to be modeled; tilesizez zoommin Indicates the z-direction tile size of the object to be modeled in the minimum LOD level; MaxZIndex zoommin It represents the maximum value of the z-direction index in the minimum LOD level of the object to be modeled; maxz represents the maximum value of the minimum volume bounding box of the object to be modeled in the z-direction; floor[] represents the rounding down function; ceiling[] represents the rounding up function.
[0141] In this embodiment, since the longitude value range in the acquired geographic location is -180 degrees to +180 degrees, and the latitude value range is -90 degrees to 90 degrees, in order to avoid the index code being a negative number, the longitude value range is adjusted to 0-360 degrees, and the latitude value range is adjusted to 0-180 degrees, and then the spatial index code of the minimum bounding box of the object to be modeled is calculated. Specifically, the spatial index code is set to zoom_xindex_yindex_zindex; where zoom represents the LOD level; xindex represents the index in the x direction under the current LOD level; yindex represents the index in the y direction under the current LOD level; and zindex represents the index in the z direction under the current LOD level.
[0142] Furthermore, each tile in the spatial index code of the minimum LOD level is recursively partitioned using an octree until the maximum LOD level is reached, thereby obtaining the spatial index code of each level of the object to be modeled from the minimum LOD level to the maximum LOD level.
[0143] Specifically, when recursively partitioning each tile of the minimum LOD level by the octree, for each tile of the new LOD level, determine its node position in the octree partitioned by the parent tile, and calculate the spatial index code of each child node at the corresponding LOD level globally.
[0144] Step S3: Based on the models of the objects to be modeled at each level and the spatial index codes, a spatial index file is constructed and the modeled objects are loaded and displayed using the Cesium rendering engine.
[0145] Specifically, the Cesium rendering engine is a virtual globe developed based on JavaScript and running in a browser. It can be zoomed out to the entire globe or zoomed in to any corner of the globe. During the zooming process, the Cesium rendering engine can calculate the LOD level and range data that should be displayed in real time, and then request the corresponding blocks for display.
[0146] The spatial index file is named tileset.json, which is the central file that describes the structure and hierarchy of the 3D Tiles dataset, including: the bounding box range value of the minimum bounding box of the object to be modeled, the geometric error corresponding to the minimum LOD level, and the json file name of the sub-block named with the spatial index code. The json file of the sub-block of the object to be modeled includes: the sub-block bounding box range value, the geometric error corresponding to the LOD level of the displayed sub-block, the file name of the lower LOD level sub-block contained in the current sub-block, and the three-dimensional file (i.e., b3dm file) used for rendering of the current sub-block. Exemplarily, the tileset.json file and its sub-block json files can be constructed using Cesium's 3D Tiles converter or a custom programming language (such as JavaScript, Python, etc.).
[0147] In summary, the parametric modeling method based on 3D Tiles according to an embodiment of the present invention has the following beneficial effects:
[0148] 1. The present invention adopts a uniform global octree spatial index suitable for spherical surfaces. Compared with the existing scheme that adopts a local spatial index, when new data is added, only the data in the spatial index that intersects with the updated data needs to be recalculated for the newly added data part, and there is no need to recalculate all the spatial indexes, thereby realizing real-time incremental update of data, improving the efficiency of data update, and reducing maintenance costs.
[0149] 2. The present invention uses a uniform global octree spatial index suitable for a spherical surface. By adjusting the block partitioning method, the block size in the Arctic and Antarctic regions is kept consistent with that in other regions, thereby achieving uniform block size on a global scale. During visualization, the uniform block size can provide a smoother and more consistent visual effect.
[0150] 3. The index block method of the present invention avoids calculation errors caused by infinite subdivision in the Arctic and Antarctic regions, avoids complex geometric calculations in polar regions, simplifies the data processing process, and helps to improve the stability and reliability of the system.
[0151] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A parametric modeling method based on 3DTiles, characterized in that: The steps include: Acquire parametric data of the object to be modeled; wherein the parametric data includes the shape, geometric characteristic parameters and geographical location of the object; Based on the parameterized data, the LOD level range of the object to be modeled is obtained, and the model of the object to be modeled at each level within the LOD level range and the spatial index code are constructed; wherein the LOD level range includes a maximum LOD level to a minimum LOD level; the maximum LOD level and the minimum LOD level are determined based on a uniform global octree spatial index method applicable to a sphere; Based on the object models to be modeled at each level and the spatial index codes, a spatial index file is constructed and the modeled objects are loaded and displayed using the Cesium rendering engine.
2. The method according to claim 1, characterized in that: The homogenized global octree spatial indexing method suitable for a spherical surface is based on the WGS84 coordinate system, and the tile sizes of each LOD level in the x direction, y direction and z direction are calculated respectively, and based on the parameterized data of the object to be modeled and the tile sizes of each LOD level in the x direction, y direction and z direction, the maximum LOD level and the minimum LOD level of the object to be modeled are obtained; wherein, when calculating the tile size in the x direction, the number of tiles in the x direction is changed according to the latitude value; the x direction is the east-west direction, the y direction is the north-south direction, and the z direction is the vertical direction.
3. The method according to claim 2, characterized in that: Use the following formula to get the tile size of each LOD level in the x direction: tilesizex zoomx =180 / tilecountx zoomx row zoomx =ceiling[(90-lat) / [180 / (2 zoomx )]] Among them, tilesizex zoomx Indicates the tile size in the x direction at the zoomx level; tilecountx zoomx Indicates the number of tiles in the x direction at the zoomx level; row zoomx Indicates the row in the y direction of the tile in the zoomx-th level; lat indicates latitude.
4. The method according to claim 2, characterized in that: Use the following formula to get the tile size of each LOD level in the y direction: tilesizey zoomy =180 / (2 zoomy ) Among them, tilesizey zoomy Indicates the tile size in the y direction at the zoomy level.
5. The method according to claim 2, characterized in that: Use the following formula to get the tile size of each LOD level in the z direction: tilesizez zoomz =half / (2 zoomz ) Among them, tilesizez zoomz Indicates the tile size in the z direction at the zoomz level; half means half of the equatorial circumference.
6. The method according to any one of claims 2 to 5, characterized in that: Obtaining the minimum LOD level of the object to be modeled, including: Constructing a minimum volume bounding box of the object to be modeled based on the geometric feature parameters and the geographical location of the parameterized data; Based on the range of the minimum volume bounding box of the object to be modeled in the x direction and the maximum latitude value of the minimum volume bounding box, the minimum level of the tile size in the x direction is obtained as the minimum LOD level in the x direction; Based on the range of the minimum volume bounding box of the object to be modeled in the y direction, the minimum level of the tile size in the y direction is obtained using the following formula as the minimum LOD level in the y direction: zoom miny =floor[log2(180 / (maxy-miny)] Among them, zoom miny Indicates the minimum LOD level in the y-axis direction; floor[] indicates rounding down; maxy indicates the maximum latitude value of the minimum volume bounding box of the object to be modeled; miny indicates the minimum latitude value of the minimum volume bounding box of the object to be modeled; Based on the range of the minimum volume bounding box of the object to be modeled in the z direction, the minimum level of the tile size in the z direction is obtained using the following formula as the minimum LOD level in the z direction: zoom minz =floor[log2(half / (maxz-minz)] Among them, zoom minz Indicates the minimum LOD level in the z direction; floor[] indicates rounding down; half indicates half of the equatorial circumference; maxz indicates the maximum value of the minimum volume bounding box of the object to be modeled in the z direction; minz indicates the minimum value of the minimum volume bounding box of the object to be modeled in the z direction; The minimum value among the minimum LOD level in the x direction, the minimum LOD level in the y direction, and the minimum LOD level in the z direction is used as the minimum LOD level of the object to be modeled.
7. The method according to claim 6, characterized in that: The step of obtaining the minimum level of the tile size in the x direction as the minimum LOD level in the x direction based on the range of the minimum volume bounding box of the object to be modeled in the x direction and the maximum latitude value of the minimum volume bounding box includes: Set the initial value of the iteration zoom minx is 0, and the following steps are executed in a loop: Based on the maximum latitude value of the minimum volume bounding box of the object to be modeled, the size of each tile is obtained using the following formula: in, Indicates the zoom minx The tile size of the layer in the x direction; Indicates the zoom minx The number of tiles in the x direction of the layer; Indicates the zoom minx The row in the y direction of the tile in the hierarchy; maxy represents the maximum latitude value of the minimum volume bounding box of the object to be modeled; When the following equation is true, the zoom minx As the minimum LOD level in the x-axis direction, end the loop: Wherein, maxx represents the maximum longitude value of the minimum volume bounding box of the object to be modeled; minx represents the minimum longitude value of the minimum volume bounding box of the object to be modeled.
8. The method according to claim 2, characterized in that: Obtaining the maximum LOD level of the object to be modeled, including: Based on the tile sizes of each LOD level in the x direction, y direction and z direction, the geometric errors of each LOD level in the x direction, y direction and z direction are obtained; When the minimum parameter value among the geometric feature parameters of the object to be modeled is greater than the maximum geometric error in the x-direction, the level corresponding to the maximum geometric error in the x-direction is used as the maximum LOD level in the x-direction; When the minimum parameter value among the geometric feature parameters of the object to be modeled is greater than the maximum geometric error in the y direction, the level corresponding to the maximum geometric error in the y direction is used as the maximum LOD level in the y direction; When the minimum parameter value among the geometric feature parameters of the object to be modeled is greater than the maximum geometric error in the z direction, the level corresponding to the geometric error in the z direction is used as the maximum LOD level in the z direction; The maximum value of the maximum LOD level in the x direction, the maximum LOD level in the y direction, and the maximum LOD level in the z direction is used as the maximum LOD level of the object to be modeled.
9. The method according to claim 8, characterized in that: The geometric errors of each LOD level in the x direction, y direction and z direction are the ratios of the tile sizes of each LOD level in the x direction, y direction and z direction to the preset screen resolution.
10. The method according to claim 8, characterized in that: Constructing models of objects to be built at each level within the LOD level range, including: using mesh three-dimensional models constructed with the z-direction geometric errors of each level within the LOD level range as thresholds as models of objects to be built at each level; Constructing the spatial index code of the object to be modeled, including: Based on the tile sizes of the minimum LOD level in the x-direction, the y-direction and the z-direction and the minimum volume bounding box size and the geographical location of the object to be modeled, a spatial index code of the minimum LOD level of the object to be modeled is obtained; Each tile in the spatial index code of the minimum LOD level is recursively partitioned using an octree until the maximum LOD level is reached, thereby obtaining the spatial index code of each level of the object to be modeled from the minimum LOD level to the maximum LOD level.