Three-dimensional rapid modeling and dynamic updating method for railway line
Technical Field
The invention belongs to the technical field of traffic construction, and particularly relates to a three-dimensional rapid modeling and dynamic updating method for a railway line
Background
The three-dimensional line design can be combined with real-scene terrains, a real model of a line design result is quickly constructed in the line design process, the influence of the terrains and geologies on the horizontal and vertical line design is conveniently and fully considered, the quality of the design result is improved, and the three-dimensional line design method becomes an important means for promoting the intelligent and digital upgrading of railways. And the live-action three-dimensional modeling technology is the basic and core technology of three-dimensional design. Therefore, three-dimensional modeling methods for railway and highway lines are actively explored by various departments, universities and design institutions. After more than twenty years of exploration, abundant research results are obtained in the fields of terrain modeling, roadbed modeling, terrain and line model fusion and the like.
The prior art and the prior art have realized static integral modeling of three-dimensional scenes of railway lines. When the line design is finished, a railway line patch model is constructed by using the horizontal and vertical line design results, and then the model is exported and stored as a three-dimensional universal format file. And when the display is needed, loading the three-dimensional model into a three-dimensional rendering engine to browse and roam. The static integral modeling technology is mainly used for displaying three-dimensional line schemes, has higher requirements on fluency during roaming browsing, and has less limitation on modeling time. The three-dimensional visual design requires that the line scheme is frequently modified by designers in the design process, so that the requirements of rapid modeling and dynamic updating of the three-dimensional scene of the railway line are met. Therefore, when the static global modeling technique is applied to three-dimensional design, the following two problems are mainly faced: firstly, the modeling speed is low, most of the existing methods are serial modeling, the modeling is sequentially carried out according to the advancing direction of the line, the modeling time is long, and particularly, the modeling is obvious when a long line engineering is modeled. Secondly, the method comprises the following steps: the model is difficult to modify dynamically. The line as a whole has an associated coupling relationship among all parts, and local modification can cause the line to change as a whole, and the three-dimensional model can change along with the change, so that the overall reconstruction consumes too much computing resources, and the reconstruction time is too long.
The three-dimensional design of the railway line is an important springboard for the intelligent and informatization of the railway, and the development and application of the three-dimensional visual design of the railway are restricted due to the slow modeling speed and the difficulty in updating and modifying the model, so that a method for rapidly modeling and dynamically updating the three-dimensional line is urgently needed to solve the problem.
Disclosure of Invention
The invention mainly aims to provide a railway line three-dimensional rapid modeling and dynamic updating method, which adopts technical means such as parallel computation, GPU cooperative three-dimensional rapid modeling, adaptive three-dimensional model local updating based on a minimum influence domain principle and the like to realize rapid construction of a railway line three-dimensional model, and when line data is changed, the three-dimensional model can quickly respond to the change of the line data to realize dynamic refreshing.
Therefore, the three-dimensional rapid modeling and dynamic updating method for the railway line provided by the embodiment of the invention comprises the following steps:
s1, quickly constructing three-dimensional model of line
Decoupling a three-dimensional model of a railway line, constructing a bridge model, a tunnel model and a roadbed model into a discrete line elementary model by using discrete cross section data, introducing a geometry shader in a GPU programmable pipeline in the construction process of the line elementary model, rapidly expanding geometric data, introducing parallel computation, and simultaneously processing and constructing a plurality of elementary models;
then, constructing a three-dimensional model scene tree of the railway line for managing the line primitive model, accelerating the rendering of the scene, and utilizing a hash table to complete the mapping relation of the line based on the model name and the storage position of the line;
s2, determining the minimum influence domain of the three-dimensional model of the line
Based on the rule that in the process of designing a line, the transmission of horizontal and vertical influence domains is unidirectional, the plane influence domains can be transmitted to a longitudinal section and a cross section, the influence domains of the longitudinal section can be transmitted to the cross section, and the influence domain range of the cross section is only transmitted between the cross sections;
s3, dynamically updating the three-dimensional model of the line
Based on the steps S1 and S2, the outdated data in the three-dimensional scene tree of the line model are removed, the line primitive model in the influence domain range is placed into the scene tree, and the splicing of the existing primitive model and the newly added primitive model is completed, wherein the scene tree and the hash table constructed in the step S1 are used for realizing the removal of the outdated primitive model and the addition of the newly added primitive model.
Specifically, the discrete line element model in the step S1 is generated by two methods, wherein the roadbed section is generated by a non-parametric modeling method, and data points of front and rear sections are connected according to rules; the bridge and tunnel sections are generated by adopting a parametric modeling method, the central coordinates of the primitives are sent to a GPU (graphics processing unit) memory, and the geometric shader in the programmable pipeline is utilized to realize the expansion of geometric data and generate a bridge and tunnel primitive model.
Specifically, the step S2 specifically includes the following steps:
s2-1, plane influence domain determination
Defining a plane influence domain range after modifying the plane intersection position according to that when the intersection point is a starting point, the influence domain is a slow straight point from the starting point to a next intersection point, when the intersection point is an end point, the influence domain is a slow straight point from the end point to a previous intersection point, and when the intersection point is a middle point, the influence domain is a slow straight point from the slow point of the previous intersection point to the next intersection point;
meanwhile, according to the condition that the current intersection point is the starting point or the latter intersection point is the end point, the straight and slow point is the starting point position, the slow and slow point is the end point position, and the plane influence domain range after the radius and the slow length of the curve are modified can be defined.
S2-2, determination of influence domain of vertical section
When the slope changing point and the elevation of the longitudinal section are independently modified, the range of the influence area is a mileage interval from the previous slope changing point to the next slope changing point; due to the coupling relation between the plane and the vertical section, after the plane is modified, the vertical section is also influenced, and the vertical section influence domain is a two slope changing point interval containing the plane influence domain;
after the plane is modified, the line mileage system is also changed, so that the mileage of the variable slope point needs to be adjusted, and the adjustment can be divided into three parts: (1) no adjustment is needed before the longitudinal section influences the domain; (2) In the range of the influence domain of the longitudinal section, adjusting the variable slope point in an equal ratio by using a projection transformation method or according to the proportional relation between the slope length before and after the change of the line and the length of the influence domain of the longitudinal section, quickly adjusting the variable slope point to be close to the design of the original longitudinal section of the line, detecting the slope and the slope length in an adjustment interval, and if the variable slope point does not meet the standard requirement, adjusting the mileage and the elevation of the variable slope point according to the design standard of the line selection of the railway until the variable slope point meets the requirement; (3) After the longitudinal section influence domain, the adjusted variable slope point mileage is equal to the variable slope point mileage before adjustment plus the change amount of the line length.
And S2-3, determining the range of the cross section influence domain according to the ranges of the longitudinal section influence domain and the plane influence domain.
Specifically, step S3 includes the following specific processes:
s3-1, dynamic scene construction
S3-2, cross section data update
Based on the minimum influence domain of the cross section calculated and obtained in the step S2, updating the original cross section data, wherein the specific process of updating comprises (1) the cross section data before the influence domain range is kept unchanged, (2) the cross section data in the influence domain range is deleted from the cross section array, and the newly obtained cross section data is inserted into the cross section array; (3) And updating the mileage information according to the cross section data after the influence domain range.
S3-3, three-dimensional primitive model update
Obtaining the storage position of the three-dimensional primitive model by means of hash table query, extracting the three-dimensional primitive model from the tree structure according to the storage position, and dividing the line into a first section, a second section and a third section according to the range of an influence area; the first section is a section from a line starting point to a line starting point, the second section is a section from a line starting point to an influence area end point, and the third section is a section from an influence area end point to a line end point;
the spatial position of the three-dimensional model of the line in the first section and the name of the primitive model are not changed, and the model in the section is continuously used; changing the spatial position of the line three-dimensional model and the name of the primitive model in the second section, deleting the original primitive model, and reconstructing a new line primitive model by using cross section data; the spatial position of the three-dimensional line model in the third section is not changed, the names of the primitive models are changed, and only the names of the line primitive models need to be modified in the section;
and S3-4, updating the hash table.
Specifically, in the process of updating the hash table: when the primitive model is positioned from the starting point of the line to the starting point of the influence domain, the data in the hash table is kept unchanged; when the primitive model is positioned from the starting point to the end point of the influence domain, deleting the original data in the hash table, and inserting a storage address of the newly added three-dimensional primitive model; when the primitive model is located from the end point of the influence domain to the end point of the line, only the key value in the hash table needs to be updated, that is: name of line primitive model.
Compared with the prior art, at least one embodiment of the invention has the following beneficial effects:
1. after deep analysis is carried out on the three-dimensional model of the land road traffic line, discrete processing is carried out based on common points of the road bed and the bridge model, the three-dimensional primitive model is uniformly constructed and only associated with cross section data, and therefore large-scale parallel operation is facilitated, and modeling efficiency is greatly improved.
2. For the bridge tunnel model, a parameterized modeling mode is adopted, data transmitted into a GPU video memory are effectively reduced, a geometry shader in a programmable pipeline is used, the expansion of the geometry data is achieved, and the modeling efficiency is improved.
3. And the minimum influence domain criterion in the line change design is provided and finally summarized into the minimum influence domain range of the cross section, and the three-dimensional modeling and the design change are finally summarized into the operation on the cross section, thereby forming the basis of the dynamic updating method.
In conclusion, the method combines technical means such as parallel computing, GPU cooperative three-dimensional rapid modeling and adaptive three-dimensional model local updating based on the minimum influence domain principle, achieves rapid construction of the three-dimensional model of the road traffic, can rapidly respond to the three-dimensional model when line data is changed, achieves dynamic refreshing, can be applied to three-dimensional forward design of the road traffic, and can meet the drawn requirement.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a real-time dynamic construction method of a three-dimensional model according to an embodiment of the present invention.
FIG. 2 is a diagram of a line primitive model scene tree structure according to an embodiment of the present invention
FIG. 3 is a hash table structure of a line primitive model according to an embodiment of the present invention
Fig. 4 is a diagram illustrating relationships between data in a dynamic update according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without inventive step based on the embodiments of the present invention, are within the scope of protection of the present invention.
In the description of the present invention, it is to be understood that the terms "central," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," "circumferential," and the like are used in the orientations and positional relationships indicated in the drawings for convenience in describing the invention and to simplify the description, and are not intended to indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and are therefore not to be considered limiting of the invention.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of the present invention, "a plurality" means two or more unless specifically defined otherwise.
Referring to fig. 1, a method for three-dimensional rapid modeling and dynamic updating of a railway line includes the following steps:
s1-quickly constructing a three-dimensional model of the line.
By deeply researching the components and the model characteristics of the railway line model, the three-dimensional model of the railway line is decoupled, and the bridge, tunnel and roadbed models are abstracted and unified into a line element model by using discrete cross section data. In the process of building the primitive model, a geometric shader in a GPU programmable pipeline is introduced to quickly expand geometric data, and meanwhile, due to the fact that decoupling processing is carried out on the primitive model, parallel computing can be introduced to simultaneously process and build a plurality of primitive models, and quick building of the railway line three-dimensional model is accelerated. Then, a three-dimensional model scene tree of the railway line is constructed to manage the line primitive model and accelerate the rendering of the scene. And finally, utilizing the hash table to complete the mapping relation of the line based on the model name and the storage position thereof, and laying a data structure foundation, a scene foundation and a model foundation for the dynamic updating of the subsequent steps.
Specifically, the rapid construction of the three-dimensional line model specifically comprises the following processes:
s1-1, constructing a minimum modeling element.
Constructing roadbed, bridge and tunnel models into discrete line element models by using discrete cross section data;
s1-2. The discrete line primitive model is generated by two methods.
The roadbed section is generated by adopting a non-parametric modeling method, and data points of the front and rear sections are connected according to rules; the bridge and tunnel sections are generated by adopting a parametric modeling method, the central coordinates of the primitives are sent to a GPU (graphics processing unit) video memory, and a geometric shader in a programmable pipeline is utilized to realize the expansion of geometric data and generate a bridge and tunnel primitive model.
S1-3, based on the steps S1-1 and S1-2, all modeling elements are independent, so that large-scale parallel modeling can be realized, and the modeling time is greatly shortened; the data expansion capability of the GPU geometry shader is utilized, the data size transmitted into the GPU video memory is reduced, and the modeling efficiency can be greatly improved.
S1-4, organizing and managing the line base meta-model by using a scene tree structure, improving the speed of scene cutting, increasing the frame rate during rendering, and laying a scene organization foundation for subsequent dynamic updating, wherein the scene tree structure is shown in FIG. 2; and the mapping from the line base element model name to the storage position of the line base element model in the scene tree is completed by adopting a hash table, and the hash table is shown in figure 3, so that the basis of a data structure is laid for the dynamic updating in the subsequent steps.
S2-determination of minimum influence domain of three-dimensional line model
In a general route design process, a route of a railway has three dimensions of information, namely: plane, longitudinal section, cross section. The three dimensions are associated and coupled with each other, one dimension is adjusted, and the other two dimensions are changed. By analyzing and researching the line design process, the following rule is obtained: the longitudinal section and the cross section can be changed by adjusting the plane; adjusting the longitudinal section and changing the cross section; adjusting the cross section only affects itself. Based on the rule, a minimum influence domain rule of a line design process and a three-layer structure of influence domain transmission are provided, namely, the influence domains are transmitted in a single direction among planes, vertical sections and cross sections. And according to different adjustment strategies, defining an influence range, and further transmitting the influence range downwards, namely completing the determination of the minimum influence domain. Cross-sectional designs within the domain of influence are then automatically reconstructed.
The method for determining the minimum influence domain of the three-dimensional model of the line specifically comprises the following steps:
and S2-1, determining a plane influence domain, predefining common plane modification operation, and reserving a program interface to facilitate subsequent expansion. Take the modified plane intersection position as an example: (1) When the intersection point is a starting point (end point), the influence domain is a slow straight point (straight slow point) from the starting point (end point) to a next intersection point (previous intersection point); (2) When the intersection point is the middle point, the influence domain is from the straight point of the previous intersection point to the straight point of the next intersection point. Stipulating: when the former intersection point is the starting point or the latter intersection point is the end point, the straight point is the starting point position, and the slow point is the end point position.
And S2-2, determining the influence domain of the longitudinal section. (1) When the slope changing point and the elevation of the longitudinal section are independently modified, the range of the influence area is a mileage interval from the previous slope changing point to the next slope changing point; (2) Due to the coupling relation between the plane and the vertical section, after the plane is modified, the vertical section is also affected, and the vertical section affected zone is an interval of two slope changing points containing the plane affected zone.
And S2-3, automatically adjusting the longitudinal section. After the plane is modified, the route mileage system is changed, so that the mileage at the slope change point needs to be adjusted. The adjustment can be divided into three parts: (1) The mileage data of the variable slope points before the influence domain of the longitudinal section does not need to be adjusted; (2) The method comprises the steps that slope point mileage data of a variable slope point in a longitudinal section influence domain range are subjected to equal-ratio adjustment by a projection transformation method or according to the proportional relation between the slope length before and after line change and the longitudinal section influence domain length, the variable slope point is quickly adjusted to be close to the original longitudinal section design of a line, after automatic adjustment, the slope and the slope length in an adjustment interval are detected, and if the slope and the slope length do not meet the standard requirements, the mileage and the elevation of the variable slope point are adjusted according to the railway route selection design standard until the slope and the slope length meet the requirements; (3) And (4) variable slope point mileage data after the longitudinal section influence domain, wherein the adjusted variable slope point mileage is equal to the variable slope point mileage before adjustment plus the change of the line length.
And S2-4, determining a cross section influence domain. In the current design process, the transmission of the horizontal and vertical influence domains is unidirectional, and the horizontal influence domains can be transmitted to the vertical section and the transverse section; the vertical section influence domain is transferred to the horizontal section; the area of influence of the cross section is itself. Any modification made to the line can ultimately be attributed to a modification to the cross-section, thereby determining the minimum area of influence for the cross-section.
S3-dynamic update of three-dimensional model of line
Based on the step S1 and the step S2, the outdated data in the three-dimensional scene tree of the line model is removed, and the line primitive model in the influence domain range is put into the scene tree, so that the splicing of the existing primitive model and the newly added primitive model is completed. In the process of removing the overdue primitive model and adding the newly added primitive model, the scene tree and the hash table constructed in the step S1 are used for implementation.
Specifically, the dynamic updating of the three-dimensional line model specifically includes the following steps:
and S3-1, constructing a dynamic scene. Data preparation of the three-dimensional model is completed based on step S1, and data management of the three-dimensional model is realized in step S2. At this time, a dynamic three-dimensional primitive model tree is already owned.
And S3-2, updating cross section data. The minimum influence domain of the cross section is calculated based on step S2. And updating the original cross section data. (1) Keeping the cross section data in the influence domain range unchanged (2), deleting the cross section data from the cross section array, and inserting the newly obtained cross section data into the cross section array; (3) And updating the mileage information according to the cross section data after the influence domain range.
And S3-3, updating the three-dimensional primitive model. Every two adjacent cross sections correspond to a three-dimensional primitive model, and the corresponding relation forms the basis for driving the three-dimensional primitive model to be updated by updating the data of the cross sections. And (3) obtaining the storage position of the three-dimensional primitive model by inquiring the hash table in the step (S2-3) according to the known name of the three-dimensional primitive model, and extracting the three-dimensional primitive model from the tree structure in the step (S2-3) according to the storage position. The line is divided into three sections according to the range of the influence domain, namely a section from the line starting point to the starting point of the influence domain (a first section), a section from the starting point of the influence domain to the end point of the influence domain (a second section), and a section from the end point of the influence domain to the end point of the line (a third section). The spatial position of the three-dimensional model of the line in the first section and the name of the primitive model are not changed, and the model in the section is continuously used; changing the spatial position of the three-dimensional model of the line in the second section and the names of the primitive models, deleting the original primitive models, and reconstructing a new line primitive model by using cross section data; the spatial position of the three-dimensional model of the line in the third section is not changed, the name of the primitive model is changed, and the name of the line primitive model in the section is only required to be modified.
And S3-4, updating the hash table. For the updating operation of the three-dimensional primitive model in the step S3-3, a hash table needs to be maintained at the same time, wherein when the primitive model is located from the line starting point to the influence domain starting point, data in the hash table is kept unchanged; when the primitive model is positioned from the starting point to the end point of the influence domain, deleting the original data in the hash table, and inserting a storage address of the newly added three-dimensional primitive model; when the primitive model is located from the end point of the influence domain to the end point of the line, only the key value in the hash table needs to be updated, that is: name of line primitive model. The relationship among the scene tree in S3-1, the cross section array in S3-2, and the hash table in S3-4 is shown in FIG. 4.
Unless otherwise indicated, any of the above-described embodiments of the present invention disclose numerical ranges, which are preferred ranges, and any person skilled in the art would understand that: the preferred ranges are merely those values which are obvious or representative of the technical effect which can be achieved. Since the numerical values are too numerous to be exhaustive, some of the numerical values are disclosed in the present invention to illustrate the technical solutions of the present invention, and the above-mentioned numerical values should not be construed as limiting the scope of the present invention.
Meanwhile, if the invention as described above discloses or relates to parts or structural members fixedly connected to each other, the fixedly connected parts can be understood as follows, unless otherwise stated: a detachable fixed connection (for example using bolts or screws) is also understood as: non-detachable fixed connections (e.g. riveting, welding) can, of course, also be replaced by one-piece structures (e.g. manufactured in one piece using a casting process) (unless it is obvious that one-piece processes cannot be used).
In addition, terms used in any technical solutions disclosed in the present invention to indicate positional relationships or shapes include approximate, similar or approximate states or shapes unless otherwise stated. Any part provided by the invention can be assembled by a plurality of independent components or can be manufactured by an integral forming process.
The above examples are merely illustrative for clearly explaining the present invention and do not limit the embodiments. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. Nor is it intended to be exhaustive of all embodiments. And obvious variations or modifications are intended to be within the scope of the present invention.