Vector pipeline three-dimensional instantiation coherent rendering method and system

By using a vector pipeline 3D instantiation coherent rendering method, the real-time and coherence issues in large-scale pipeline network scenarios are solved, achieving efficient and low-cost 3D rendering effects, which are suitable for complex pipeline network scenarios.

CN120807741AActive Publication Date: 2025-10-17NINGBO ZHENHAI PLANNING SURVEY DESIGN & RES INST
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202511033726.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-25
Publication Date
2025-10-17
Estimated Expiration
2045-07-25

AI Technical Summary

Technical Problem

Existing technologies are insufficient to meet the requirements of real-time performance and current availability in large-scale pipeline network scenarios, and there is also the problem of discontinuity at pipeline connections.

Method used

The method employs a vector pipeline 3D instantiation coherent rendering approach. By acquiring vector pipeline data, a basic 3D model set is constructed, pipeline connection point information is traversed, a coherently rendered pipeline system is established, and model transformation is performed during the graphics accelerator rendering stage to achieve coherent rendering of pipelines and connections.

Benefits of technology

It enables real-time 3D rendering of large-scale pipeline networks, reduces modeling costs and system implementation difficulty, improves rendering performance, adapts to pipeline data rendering in complex scenes, and ensures continuity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120807741A_ABST
    Figure CN120807741A_ABST
Patent Text Reader

Abstract

The invention discloses a vector pipeline three-dimensional instantiation coherent rendering method and system, and relates to the technical field of pipe network three-dimensional visualization. The method comprises the following steps: obtaining vector pipeline data, and analyzing to obtain pipeline data; constructing a basic three-dimensional model set; traversing the pipeline data, obtaining pipeline connection point information, constructing a first model matrix and first model data of each basic three-dimensional model, and establishing a coherent rendering pipeline system; traversing the basic three-dimensional model set, and instantiating and rendering a complete pipeline system according to the basic three-dimensional model and the corresponding first model matrix; in the graphics accelerator rendering stage, model transformation is carried out according to the transformation rule of the first model data, and coherent rendering of pipelines and pipeline joints is carried out. By analyzing the vector pipeline data, a coherent pipeline model is instantiated in real time, and a feasible low-cost path is provided for creating and rendering coherent three-dimensional pipelines in real time based on the vector pipeline data.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the technical field of three-dimensional visualization of pipe networks, and particularly relates to a three-dimensional instantiation coherent rendering method and system for vector pipelines. BACKGROUND

[0002] Most of the existing pipeline visualization schemes adopt three-dimensional modeling and then publish as 3dtiles services to realize three-dimensional visualization, which provides an effective scheme for the management of various pipelines. Although 3dtiles can provide better display effects, with the acceleration of the transformation of various pipelines and the continuous expansion of the pipeline scale, the traditional way has been difficult to adapt to the current real-time and present situation requirements. Moreover, this technical route needs to create three-dimensional models in advance and convert them into 3dtiles format, which requires a lot of time and high economic cost.

[0003] To this end, the existing scheme proposes to calculate the three-dimensional information of the pipe network in real time and render, which can partially solve the problems of real-time and present situation, but with the increasing scale of the pipe network, the rendering efficiency of this scheme will become worse and worse, and it is difficult to adapt to large-scale scenes. In addition, there are also researches that adopt a conventional instantiation scheme, which can solve the problem of large-scale rendering, but the conventional instantiation scheme will cause the problem of incoherence at the connection of each pipeline and model, and the display effect is not good.

[0004] The application proposes a three-dimensional instantiation coherent rendering method and system for vector pipelines, aiming to solve the problems of real-time pipeline updating, real-time visualization, present situation and coherence at the connection of the pipe network in a large-scale real-time pipe network updating scene. SUMMARY

[0005] The application aims to provide a three-dimensional instantiation coherent rendering method and system for vector pipelines to solve the problems that the existing schemes are difficult to meet the requirements of real-time and present situation, are difficult to adapt to large-scale scenes, and have the problem of incoherence at the connection of each pipeline and model.

[0006] To achieve the above-mentioned purpose, the application adopts the following technical scheme:

[0007] In a first aspect, the application proposes a three-dimensional instantiation coherent rendering method for vector pipelines, comprising the following steps:

[0008] S1, acquiring vector pipeline data and analyzing to obtain pipeline data;

[0009] S2, constructing a basic three-dimensional model set; the basic three-dimensional model is divided into pipeline main components, connecting components and transition components according to functions;

[0010] S3, traverse pipeline data, obtain pipeline connection point information; construct the first model matrix and the first model data of each basic three-dimensional model, and establish a pipeline system for coherent rendering;

[0011] S4, traverse the basic three-dimensional model set, and instantiate the complete pipeline system according to the basic three-dimensional model and the corresponding first model matrix;

[0012] S5, the model transformation is performed according to the transformation rule of the first model data in the rendering stage of the graphics accelerator, and the coherent rendering of the pipeline and the pipeline connection is performed.

[0013] Preferably, the S3 is specifically as follows:

[0014] S3.1, traverse the pipeline data, obtain the pipeline list associated with each pipeline connection point and the primary and secondary pipelines of the pipeline connection point, and calculate the first model matrix and the first model data of the basic three-dimensional model set associated with the pipeline of the pipeline connection point;

[0015] The basic three-dimensional model set associated with the pipeline of the pipeline connection point is calculated, specifically: selecting the primary and secondary pipelines and establishing the basic three-dimensional model components of the primary and secondary pipelines, traversing the remaining pipeline associated with the pipeline connection point, and establishing the basic three-dimensional model components of each pipeline;

[0016] S3.2, traverse the pipeline connection point information, and comprehensively construct the first model matrix and the first model data of the basic three-dimensional model of the pipeline system according to the first model matrix and the first model data of the basic three-dimensional model set associated with all pipeline connection points.

[0017] Preferably, the selection of the primary and secondary pipelines and the establishment of the basic three-dimensional model components of the primary and secondary pipelines are specifically as follows:

[0018] Selecting the primary and secondary pipelines: traversing the pipeline list associated with the pipeline connection point according to the descending order of the pipe diameter specification; judging whether it is a circular pipe or a square pipe according to the pipe diameter specification, if it is a circular pipe, sorting according to the radius, if it is a square pipe, sorting according to the minimum half of the side length, if there are the same values, sorting according to the traversal order;

[0019] The construction rule of the primary and secondary pipelines: the primary and secondary pipelines include pipeline body components, if the primary and secondary pipelines are not on a straight line, they also include connecting components, if the shapes of the connected components do not match, they also include transition components; solving the first model matrix and the first model data of the basic three-dimensional model component, the first model matrix is a transformation matrix composed of an offset matrix, a rotation matrix and a scaling matrix.

[0020] Preferably, the first model matrix of the connecting component is specifically as follows:

[0021] Let the included angle of the primary and secondary pipelines be 2*theta, and the turning radius be r, then the distance of the connecting component from the pipe point along the opposite direction of the primary pipeline is The center angle of the circle constructed by the connection member start-stop coordinates and the connection member center is π-2*θ; the coordinates (x o ,y o ,z o ) of the connection member center; therefore:

[0022] The offset matrix of the connection member is:

[0023] The scaling matrix of the connection member is m s , the rotation matrix of the connection member is m r ; the first model matrix of the connection member is m t ×m r ×m s .

[0024] Further, the scaling matrix of the connection member is as follows:

[0025] If the connection member is a circular pipe, let the inner ring radius be r inner , the outer ring radius be r outter , the circular pipe diameter radius be r connect , and the main pipe line diameter radius be r main ;

[0026] The scaling matrix of the connection member is:

[0027] If the connection member is a square pipe, let the inner ring radius be r inner , the outer ring radius be r outter , the square pipe diameter edge length be 2*r y , and the other edge length be 2*r xoz ; the main pipe line diameter radius is r main-y , and the corresponding connection member edge length is 2*r main-xoz ;

[0028] The scaling matrix of the connection member is:

[0029] Further, the rotation matrix of the connection member is as follows:

[0030] According to the vector of the connection member start point pointing to the connection member center and the vector of the main pipe line another pipe point pointing to the current pipe point, the normal vector direction r f1 of the plane formed by the two vectors is calculated.

[0031] According to the vector (0, 0, -1) and the vector (1, 0, 0), the normal vector direction r f2 of the plane formed by the two vectors is calculated.

[0032] Solve r f2 turn to rf1 the rotation angle and the rotation axis;

[0033] Based on the rotation angle and the rotation axis, the rotation matrix m r1 is solved using the Rodrigues rotation formula;

[0034] The tangent direction of the starting point of the connecting member axis after transformation is rotated to the tangent direction of the main pipeline pointing to the connecting member with r f1 as the rotation axis, and the rotation matrix m r2 is calculated again according to the Rodrigues rotation formula;

[0035] The rotation matrix m r of the connecting member is calculated as m r2 = m r1 .

[0036] Preferably, the first model data of the connecting member is specifically as follows:

[0037] After two transformations, the arbitrary point A (x1, y1, z1) on the torus is in the final position, and the transformation matrix thereof is the first model data of the connecting member;

[0038] The first transformation is a scaling transformation in the radial direction of the torus, and the pipe diameter radius of the torus before scaling is r o ; the projection distance of point A in the xoz coordinate system from the origin of the xoz coordinate system is d o ;

[0039] The scaling matrix of point A is:

[0040] The second transformation is a rotation transformation around the center of the torus, and the included angle between OA and the z-axis before transformation is: and the included angle between OA and the z-axis after transformation is:

[0041] The angle transformation around the y-axis before and after transformation is θ d = θ o - θ n , and the rotation matrix thereof is:

[0042]

[0043] Preferably, the first model matrix and the first model data of the transition member are specifically as follows:

[0044] Let the coordinate of the end point of the connecting member axis be (x e , y e , z e ), and the pipe diameter specification be 2r w and 2r h, the direction of the other end pipe point of the secondary pipeline from the current pipe point is vector a, the direction of the transition component axis is b (0, 1, 0), the length of the transition component is l, the length of the selected three-dimensional model of the transition component is l1, and the pipe diameter specification of the connection end of the three-dimensional model of the transition component connected with the connection component is 2r w1 and 2r h1 , the pipe diameter specification of the connection end of the three-dimensional model of the transition component connected with the connection component is 2r w2 and 2r h2 , the coordinate origin of the transition component is at the center of the pipe diameter of the connection end connected with the connection component;

[0045] The rotation matrix m of vector a turning to vector b is obtained according to the Rodrigues rotation formula r1 , and the rotation matrix m required for aligning the connection end port of the transition component with the connection component after the transformation is obtained according to the Rodrigues rotation formula with vector a as the rotation axis r1 , then the rotation matrix of the transition component is m r2 = m r × m r2 × m r1 ;

[0046] Suppose that the corresponding relationship of the pipe diameter specifications of the connection component and the transition component after the rotation transformation is R w corresponds to R w1 ; R h corresponds to R h1 , then:

[0047] The scaling matrix of the transition component is:

[0048] The offset matrix of the transition component is:

[0049] The first model matrix of the transition component is m t × m r × m s ;

[0050] The first model data of the transition component includes the transformation rule of the vertex connected with the secondary pipeline of the transition component; specifically, the vertex connected with the secondary pipeline of the transition component is transformed through two vertex transformations, the first one is a scaling transformation corresponding to the edge length or a scaling transformation corresponding to the radius, and the second one is a rotation around the axis of the secondary pipeline to realize the alignment of the connection.

[0051] Preferably, the first model matrix and the first model data of the transition component are specifically as follows:

[0052] The length of the pipeline basic three-dimensional model is l, the pipeline length l2, the scaling factor (s x ,s z) and the position coordinate (x s-clip ,y s-clip ,z s-clip ) after the corresponding length of the pipeline starting point is cut; then:

[0053] The offset matrix of the pipeline body member is:

[0054] The scaling matrix of the pipeline body member is

[0055] The rotation matrix of the pipeline body member is the rotation matrix m r of the axial direction of the pipeline basic three-dimensional model to the direction vector of another pipeline point pointing to the current pipeline point.

[0056] The first model matrix of the pipeline body member is: m t ×m r ×m s .

[0057] The first model data of the pipeline body member is empty.

[0058] Preferably, S5 is specifically as follows:

[0059] The first model data is stored into the graphics accelerator cache.

[0060] The first model data of the current instance is obtained in the graphics accelerator rendering stage, and the current instance is subjected to model transformation based on the transformation rule of the first model data.

[0061] The present application proposes a vector pipeline three-dimensional instantiation coherent rendering system in the second aspect, comprising:

[0062] A vector data analysis module: reads vector pipeline data and analyzes to obtain pipeline data;

[0063] A basic three-dimensional model construction module: constructs a basic three-dimensional model set;

[0064] A pipeline processing module: iterates pipeline data to construct the first model matrix and the first model data of each basic three-dimensional model;

[0065] A pipeline rendering module: iterates the basic three-dimensional model set, renders the pipeline according to the basic three-dimensional model and the corresponding first model matrix, and performs model transformation according to the first model data in the graphics accelerator rendering stage.

[0066] Compared with the prior art, the present application has the following beneficial effects:

[0067] (1) The method of the present invention does not require pre-modeling, and directly renders the three-dimensional model in real time from the vector pipeline data, which reduces the modeling and three-dimensional model maintenance costs, and also provides technical guarantees for the real-time and current nature of the three-dimensional rendering of pipeline data. And by dividing the three-dimensional pipeline into: pipeline main components, connecting components and transition components, the pipeline construction process is simplified, and the difficulty of system implementation is significantly reduced. The present invention performs vertex transformation on vertices according to the transformation rules in the shader stage, providing a feasible path for coherent instantiation rendering. The present invention effectively solves the technical difficulties of coherent instantiation of three-dimensional rendering of vector pipelines, and at the same time provides a method and system for the current large-scale underground pipeline network renovation project in my country that is efficient, low-cost, and renders coherently and supports the real-time and current nature of pipeline data rendering.

[0068] (2) The method of the present invention significantly reduces the video memory usage and the number of GPU drawcall calls through instantiation rendering technology, and significantly improves the rendering performance.

[0069] (3) The method of the present invention can realize the three-dimensional rendering of pipeline networks in tree-shaped or even ring-shaped complex scenes. Compared with the prior art that performs vertex transformation through instantiation rendering to perform three-dimensional rendering of simple linear pipeline network connection types, the present invention divides the three-dimensional pipeline into pipeline main components, connection components and transition components, and designs corresponding transformation rules to perform vertex transformation on vertices, which can realize the three-dimensional rendering of pipeline data in complex scenes. Therefore, it can adapt to the three-dimensional rendering of pipeline data in large-scale scenes and achieve coherent instantiation rendering. BRIEF DESCRIPTION OF THE DRAWINGS

[0070] Figure 1 Flowchart of the vector pipeline 3D instantiated coherent rendering method of the present invention;

[0071] Figure 2 Schematic diagram of the pipeline main component, connecting component and transition component in the present invention;

[0072] Figure 3 A schematic diagram of the primary and secondary pipeline connection components of the present invention;

[0073] Figure 4 The transformation rules for each vertex of the connected component in the shader stage of the present invention;

[0074] Figure 5 Schematic diagram of adding additional pipelines in the present invention Figure 1 ;

[0075] Figure 6 Schematic diagram of adding additional pipelines in the present invention Figure 2 ;

[0076] Figure 7A processing effect diagram of the tee connection pipeline in the application. DETAILED DESCRIPTION

[0077] The technical solutions in the embodiments of the application will be apparently and completely described below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only part of the embodiments of the application, rather than all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the application.

[0078] Embodiment 1

[0079] Referring to Figure 1 The vector pipeline three-dimensional instantiation coherent rendering method specifically comprises the following steps:

[0080] S1, reading vector pipeline data, and parsing to obtain pipeline data.

[0081] The vector pipeline data is obtained from an original data source, and the vector data is processed and calculated to finally obtain the pipeline data. These data mainly include the following fields: pipeline number, starting point coordinates, end point coordinates, pipe diameter specification.

[0082] The original data does not directly provide the height of the starting point coordinates and the end point coordinates, and the height is calculated according to the ground elevation and the buried depth of the starting point and the end point, and the calculation formula is as follows: h=dmgc-ms, wherein h represents the elevation, dmgc represents the ground elevation, and ms represents the buried depth.

[0083] S2, constructing a basic three-dimensional model set.

[0084] The application selects one or more from a solid cylinder, a hollow cylinder, a circular pipe, a square pipe, a hemisphere, a sphere, a part of the sphere, a cube, a circular cone, a part of the circular cone, a square cone, a part of the square cone, a square body to a circular body, a square pipe to a circular pipe, a square body to a circular pipe, a circular body to a square pipe, a circular ring and a part of the circular ring to construct the basic three-dimensional model set.

[0085] The basic three-dimensional model can also be an equivalent model of these models, such as a basic three-dimensional model with a flange ring. These equivalent models change the shape on the basis of the basic three-dimensional model, but the essential functions are consistent.

[0086] According to the use, the basic three-dimensional models can be divided into three categories: pipeline body components, connecting components and transition components, such as Figure 2The connection member is used to connect two pipeline corners, and the transition member is used to connect the connection member and the pipeline. The three types of components are not required to exist simultaneously in the same basic three-dimensional model set, and the equivalent functions of the components can be realized through subsequent model transformation stages. For example, the functions of the pipeline body member, the transition member, and the transition member are realized simultaneously by performing vertex transformation on a certain range of vertices at both ends of the pipeline body member. For another example, the functions of the connection member and the transition member are realized simultaneously by performing vertex transformation on a certain range of vertices at the port of the connection member.

[0087] The present application realizes the coherent rendering of the final pipeline by constructing the basic three-dimensional model set and simultaneously obtaining the equivalent functions of the pipeline body member, the connection member, and the transition member.

[0088] For example, a solid cylinder with a length of 1 m and a radius of 10 cm is selected as the basic three-dimensional model set, and subsequent vertex transformation is performed to realize the coherent rendering of the pipeline connection.

[0089] For another example, a solid cylinder with a length of 1 m and a radius of 10 cm and a square tube with a length of 1 m and a side length of 10 cm*10 cm are selected as the pipeline body member, a part of the circular ring is selected as the connection member, and the square body is converted into a circular body to construct the basic three-dimensional model set. Although there are many combinations, in order to simply and clearly describe the principles and embodiments of the present application, this embodiment will use the combination of the above three basic three-dimensional models to construct the basic three-dimensional model set.

[0090] S3, traverse the pipeline data to construct the first model matrix and the first model data of each basic three-dimensional model. Specifically, the following steps are included:

[0091] S3.1, traverse the pipeline data to obtain the pipeline list associated with each pipeline connection point and the primary and secondary pipelines of the pipe point, and calculate the first model matrix and the first model data of the basic three-dimensional model set of the pipeline associated with the pipe point.

[0092] The present application establishes the entire coherent rendering pipeline system through the pipeline body, the connection member, and the transition member. The components are rendered through the first model matrix of the basic model, and then the vertex transformation is performed on the components through the first model data in the shader stage, so as to finally realize the coherent rendering.

[0093] Let the offset matrix of the basic model instance be m t , the rotation matrix be m r , and the scaling matrix be m s , the first model matrix of the model instance be m t × m r × m sThe first model data of each base model is the dependent parameter of each instance of each base model used in the shader stage to calculate the correct position of each vertex, and the first model data parameter field of different types of base model components is different.

[0094] The pipeline construction process of the pipe point association includes the following two steps:

[0095] 1) Select the primary and secondary pipelines and establish the base three-dimensional model components of the primary and secondary pipelines;

[0096] 2) Traverse the remaining pipe point association pipelines and establish the base three-dimensional model components of each pipeline one by one.

[0097] The first model matrix of the pipeline body component is determined by the two pipe points associated with the pipeline, and the pipeline body component has no first model data.

[0098] Specifically, the primary and secondary pipelines are selected and the base three-dimensional model components of the primary and secondary pipelines are established as follows.

[0099] Traverse the pipe point association pipeline list according to the descending order of the pipe diameter specification. First, determine whether it is a circular pipe or a square pipe according to the pipe diameter specification, if it is a circular pipe, sort it according to the radius, if it is a square pipe, sort it according to the minimum half of the side length. If there are the same values, sort them according to the traversal order.

[0100] Determine the base three-dimensional model component of the pipe point according to the pipe point condition:

[0101] If the pipe point is associated with only one pipeline, the pipe point only has the pipeline body component of the pipeline, and the constructed pipeline body stops at the pipe point;

[0102] If the pipe point is associated with multiple pipelines, first construct the base three-dimensional model components of the primary and secondary pipelines, and then add the three-dimensional model components of the other pipelines associated with the pipe point one by one.

[0103] The construction rules of the primary and secondary pipelines are as follows:

[0104] The primary and secondary pipelines are composed of three parts, namely the pipeline body component, the connection component and the transition component. According to the situation, not all of these components are needed. The connection component is only needed when the primary and secondary pipelines are not on a straight line, and the transition component is only needed when the pipe diameter specifications of the primary and secondary pipelines are inconsistent or the shapes at the connection with the connected component do not match. The connection component is mainly composed of a part of a circular ring or a square ring, which plays a role in rendering the elbow, and the transition component mainly plays a role in the coherent transition of pipes with different diameters and different shapes.

[0105] Please refer to Figure 3 , the construction process of the connection component is as follows:

[0106] The connecting member is consistent with the main pipeline pipe diameter specification, the main and secondary pipeline central axes all point to the pipe point, and the start and end positions of the central axis of the connecting member are calculated according to the system default or user input turning radius. The calculation rules are as follows:

[0107] Suppose that the included angle of the main and secondary pipelines is 2*theta, and the turning radius is r, then the distance of the connecting member from the pipe point in the opposite direction of the main pipeline is According to the coordinates of the pipe point and the direction of the main pipeline, the starting coordinates (x s ,y s ,z s ) of the central axis of the connecting member are easily obtained, which are also the coordinates of the intersection of the central axis of the main pipeline at the pipe point. The terminal coordinates of the connecting member are equal to the distance of the starting coordinates from the pipe point, and the direction is the opposite direction of the secondary pipeline. Similarly, the terminal coordinates (x e ,y e ,z e ) of the central axis of the connecting member are easily obtained, which are also the coordinates of the intersection of the central axis of the secondary pipeline at the pipe point. The central angle of the connecting member between the start and end coordinates and the center of the connecting member is pi-2*theta. The center of the connecting member is the center of the concentric circle of the connecting member, and the coordinates (x o ,y o ,z o ) of the center of the connecting member are easily obtained according to the geometric relationship that the connecting line between the start and end coordinates of the connecting member and the center of the connecting member is perpendicular to the direction of the main pipeline and the turning radius.

[0108] (1) According to the pipe diameter specification of the main pipeline, the first model matrix and the first model data of the connecting member are solved:

[0109] 1) For a circular pipe, the coordinate origin of the connecting member basic three-dimensional model is at the center of the connecting member, the start and end points of the circular ring pipe diameter axis are on the z-axis and the x-axis respectively, the central angle is 90°, the inner ring radius is r inner cm, the outer ring radius is r outter cm, and the circular ring pipe diameter radius is r connect cm. The pipe diameter radius of the main pipeline is r main cm, the whole is in the first quadrant of the zox coordinate system, and the coordinate unit of the rendering engine is cm.

[0110] The offset matrix of the connecting member is:

[0111] The scaling matrix of the connecting member is:

[0112] The rotation matrix of the connecting member is calculated in the following steps:

[0113] 1) Based on the vector from the starting point of the connecting component to the center of the connecting component and the vector from another pipe point of the main line to the current pipe point, calculate the normal vector direction r of the plane formed by these two vectors f1 ;

[0114] 2) Based on the vector (0,0,-1) and the vector (1,0,0), find the direction r of the normal vector of the plane formed by these two vectors f2 ;

[0115] 3) Solve for r f2 Go to r f1 The rotation angle and rotation axis;

[0116] 4) Based on the rotation angle and rotation axis obtained in 3), use the Rodrigues rotation formula to solve the rotation matrix m r1 ;

[0117] 5) With r f1 The rotation axis is calculated again according to the Rodriguez rotation formula, which is the rotation matrix m of the tangent direction of the axis starting point of the connecting component after the transformation in 4) to the tangent direction of the main line pointing to the connecting component. r2 ;

[0118] 6) Calculate the rotation matrix m of the connection component r =m r2 ×m r1 .

[0119] After the above calculation, the first model matrix of the connecting component is m t ×m r ×m s .

[0120] See also Figure 4 , any point A(x1,y1,z1) on the ring passes through Figure 4 The final position after two transformations is the transformation matrix, which is the first model data of the connecting component.

[0121] The first transformation is a radial scaling transformation of the ring. The radius of the ring before scaling is:

[0122] r o =r outter -r inner

[0123] The distance from the projection of point A in the xoz coordinate system to the origin of xoz is:

[0124]

[0125] The scaling matrix of point A is:

[0126] The second transformation is a rotation transformation of the center of the circular ring. The angle between OA and the z-axis before transformation is: The angle between OA and the z-axis after transformation is:

[0127] The angle transformation of the front and rear y-axes is θ d = θ o - θ n The rotation matrix is:

[0128]

[0129] According to the above calculation, the transformation formula of the connecting member in the shader stage is m s × m r The first model data of the connecting member is a parameter set composed of common parameters in the formula m s × m r

[0130] 2) For a square tube, the coordinate origin of the connecting member basic three-dimensional model is at the center of the connecting member, the square ring tube diameter axis start and end points are on the z-axis and the x-axis respectively, the central angle is 90°, the inner ring radius is r inner cm, the outer ring radius is r outter cm, the edge length of the square ring tube diameter perpendicular to the xoz coordinate plane is 2*r y cm, and the other edge length is 2*r xoz cm. The pipe diameter radius of the main pipe line is r main-y cm and 2*r main-xoz cm respectively, the whole is in the first quadrant of the zox coordinate system, and the coordinate unit of the rendering engine is cm.

[0131] The offset matrix of the connecting member is:

[0132] The scaling matrix of the connecting member is:

[0133] The rotation matrix of the connecting member is calculated in the following steps:

[0134] 1) According to the vector from the connecting member start point to the center of the connecting member and the vector from the other pipe point of the main pipe line to the pipe point, the normal vector direction r f1 of the plane formed by the two vectors is solved;

[0135] 2) According to the vector (0, 0, -1) and the vector (1, 0, 0), the normal vector direction r f2 of the plane formed by the two vectors is solved;

[0136] 3) r f2 is turned to r f1 ​The rotation angle and rotation axis;

[0137] 4) Based on the rotation angle and rotation axis obtained in 3), use the Rodrigues rotation formula to solve the rotation matrix m r1 ;

[0138] 5) With r f1 The rotation axis is calculated again according to the Rodriguez rotation formula, which is the rotation matrix m of the tangent direction of the axis starting point of the connecting component after the transformation in 4) to the tangent direction of the main line pointing to the connecting component. r2 ;

[0139] 6) Calculate the rotation matrix m of the connection component r =m r2 ×m r1 .

[0140] After the above calculations, the first model matrix of the connecting component is m t ×m r ×m s .

[0141] See also Figure 4 , any point A(x1,y1,z1) on the ring passes through Figure 4 The final position after two transformations is the transformation matrix, which is the first model data of the connecting component.

[0142] The first transformation is a radial scaling transformation of the ring. The radius of the ring before scaling is:

[0143] r o =r outter -r inner

[0144] The distance from the projection of point A in the xoz coordinate system to the origin of xoz is:

[0145]

[0146] The scaling matrix of point A is:

[0147] The second transformation is a rotation transformation around the center of the circle. The angle between OA and the z-axis before the transformation is: After transformation, the angle with the z-axis is:

[0148] The angle transformation around the y axis is: θ d =θ o -θ n , its rotation matrix is:

[0149]

[0150] According to the above calculation, the transformation formula of the connecting member in the shader stage is m s ×m r , and the first model data of the connecting member is a parameter set composed of common parameters in the formula m s ×m r .

[0151] (2) Solve the first model matrix and the first model data of the transition member:

[0152] Referring to Figure 2 , the transition member includes three types of square-to-square, circle-to-square, and circle-to-circle, and is connected to the connecting member and the secondary pipeline at two ends, respectively. The length of the transition member is determined by the system default or user-set length. The offset matrix, the rotation matrix, and the start and end point coordinates of the transition member axis can be determined according to the connecting member axis end coordinates, the secondary pipeline direction, and the selected transition member basic three-dimensional model. The scaling matrix of the transition member can be determined according to the shape of the main pipeline, the length of the transition member, and the selected transition member basic three-dimensional model. The pipe diameter specifications of the start and end points of the transition member are unified with the pipe diameter specifications of the main and secondary pipelines, so that the start and end pipe diameter specifications of the transition member can be obtained.

[0153] The first model matrix of the transition member can be constructed according to the offset matrix, the rotation matrix, and the scaling matrix of the transition member. The first model data of the transition member can be constructed according to the start and end point coordinates of the transition member axis and the start and end pipe diameter specifications.

[0154] Let the end coordinates of the connecting member axis be (x e ,y e ,z e ), the pipe diameter specifications be 2r w cm and 2r h cm (wherein if r w =r h , it can represent a square cross-section or a circle), the direction of the secondary pipeline point to the other end point be vector a, the selected transition member axis direction be b (0, 1, 0) (the connecting end to the connecting member points to the other end), the length of the transition member be lcm, the length of the selected transition member three-dimensional model be l1cm, the pipe diameter specifications of the connecting end of the selected transition member three-dimensional model to the connecting member be 2r w1 cm and 2r h1 cm, the pipe diameter specifications of the connecting end of the selected transition member three-dimensional model to the secondary pipeline be 2r w2 cm and 2r h2 cm, and the coordinate origin of the transition member is at the center of the pipe diameter of the connecting end to the connecting member.

[0155] According to the Rodrigues rotation formula, the rotation matrix m r1According to the Rodrigues rotation formula, the rotation matrix m of the transition component can be obtained with the vector a as the rotation axis r1 The rotation matrix m required for the alignment of the port of the transition component with the connecting component after transformation r2 The rotation matrix m of the transition component is: r = m r2 × m r1 .

[0156] Suppose the corresponding relationship between the pipe diameter specifications of the connecting component and the transition component after rotation transformation is: r w corresponds to r w1 ; r h corresponds to r h1 The scaling matrix of the transition component is:

[0157] The offset matrix of the transition component is

[0158] According to the above calculation, the first model matrix of the transition component is: m t × m r × m s .

[0159] The transition component is divided into n layers along the pipe diameter axis, with m vertices in each layer, and each vertex has corresponding vertices in the other n-1 layers, and the n corresponding vertices are collinear. Therefore, after the first model matrix transformation of the transition component, only the positions of the m vertices connected to the connecting component need to be corrected.

[0160] The most critical is the transformation rule of the vertices connected to the secondary pipeline, and the interpolation method can be used for other intermediate vertices.

[0161] The vertex transformation of the pipeline connected needs to go through two vertex transformations, the first is the scaling transformation of the corresponding edge length or the scaling transformation of the radius, and the second is the rotation around the secondary pipeline axis to realize the alignment transformation at the connection. The first model data of the transition component is a parameter set consisting of the scaling factor of the pipe diameter and the rotation angle of the secondary pipeline axis. In the shader rendering stage, the vertex transformation is realized according to the parameter set, thereby realizing the continuous transition at the connection.

[0162] (3) Solve the first model matrix and the first model data of the pipeline main component:

[0163] The coordinate origin of the basic three-dimensional model of the pipeline main component is at the interface center of one end of the pipeline, and the pipeline direction is parallel to the y-axis. If it is a square tube, the pipeline side is parallel to the x and z axes, and the length of the pipeline basic three-dimensional model is: lcm.

[0164] The first model matrix of the pipeline body component is also a transformation matrix composed of the offset matrix, the rotation matrix and the scaling matrix, and the first model data is empty.

[0165] If the pipeline has been added in other pipe points, the pipeline body of the pipeline is not added any more.

[0166] If the pipeline has not been processed, the rotation matrix of the pipeline body component is easily obtained as the rotation matrix m of the axial direction of the selected pipeline base three-dimensional model to the direction vector of the other pipe point pointing to the current pipe point. r .

[0167] According to the situation of the two ends of the pipeline, the cutting length (the length occupied by the connecting component and the transition component is removed) of the pipeline at the two ends, the cutting length l2cm of the pipeline after cutting, the scaling factor (s x ,s z ) of the pipeline diameter and the position coordinates (x s-clip ,y s-clip ,z s-clip ) of the starting point of the pipeline after cutting the corresponding length are easily calculated.

[0168] The offset matrix of the pipeline body component is:

[0169] The scaling matrix of the pipeline body component is

[0170] According to the above calculation, the first model matrix of the pipeline body component is: m t ×m r ×m s .

[0171] All the first model matrices and the first model data of the pipeline body are calculated according to the above calculation method.

[0172] For square pipes, since the pipeline may have been processed before, the rotation matrix of the pipeline has been determined, and when it is used as the main pipeline at the current pipe point, there may be a situation that the connection with the connecting component cannot be closed, and at this time, a transition component needs to be added between the main pipeline and the connecting component to achieve the goal of continuous connection. The construction method of the transition component is similar to the previous transition component construction method, which will not be repeated here.

[0173] When the main pipeline and the secondary pipeline are parallel, no connecting component needs to be constructed, and a transition component is constructed according to the situation. During the construction of the transition component, the main pipeline can be regarded as a connecting component to construct the transition component, and the construction process is consistent with the foregoing.

[0174] The following traverses the remaining pipe points associated with the pipeline, and establishes the first model matrix and the first model data of the base three-dimensional model component of each remaining pipeline one by one.

[0175] The pipeline component of the remaining pipeline comprises two parts: a pipeline body component and a connecting component. The pipeline body component is described above with reference to the construction method. Only the construction method of the connecting component of the remaining pipeline is described below.

[0176] Referring to Figure 5 and Figure 6 , there are four cases for other pipelines associated with the pipeline point outside the primary and secondary pipelines: the first case is that the newly added pipeline is parallel to one of the primary and secondary pipelines, and the pipeline can be directly rendered; the second case is that Figure 5 the newly added pipeline is on the side with a larger included angle with the primary and secondary pipelines; the third case is that Figure 6 the newly added pipeline is on the side with a smaller included angle with the primary and secondary pipelines; and the fourth case is that the primary and secondary pipelines are parallel, and the construction method is referred to the second case.

[0177] The calculation method of the second and third cases is described below.

[0178] Referring to Figure 5 , the second case is described. The pipeline comprises a pipeline body and a connecting component. The connecting component is a sector area of a circular tube or a square tube with the diameter of the newly added pipeline as the radius, the starting side is connected to the pipeline body component of the newly added pipeline, and the ending side is perpendicular to the angle bisector of the included angle of the primary and secondary pipelines. The center of the sector is the endpoint of the pipeline close to the side with a smaller included angle of the primary and secondary pipelines.

[0179] Let the included angle of angle AoB be θ, and the central angle of the connecting component be π-θ, where oA is the line segment on the angle bisector of the primary and secondary pipelines. The inner ring radius is considered to be 0. According to the above calculation, the connecting component can be constructed according to the aforementioned calculation method of the connecting component.

[0180] Referring to Figure 6 , the third case is described. Only the pipeline body component needs to be constructed in this case. The pipeline at the pipeline point can be cut to a distance of the radius of the newly added pipeline or half the length of the shorter side of the cross section of the newly added pipeline. The specific calculation is referred to the aforementioned construction method of the pipeline body component.

[0181] According to the above construction method and process, the first model matrix and the first model data of the basic three-dimensional model set associated with the pipeline point are calculated.

[0182] S3.2, the first model matrix and the first model data of the basic three-dimensional model set associated with each pipeline point are integrated to construct the first model matrix and the first model data of the basic three-dimensional model of the entire system.

[0183] The pipeline connection point information is integrated, the first model matrix and the first model data of the basic three-dimensional model associated with each pipeline point are constructed, and then the first model matrix and the first model data of the entire basic three-dimensional model in the basic three-dimensional model set constructed in step S2 are constructed.

[0184] S4, traversing the basic three-dimensional model set according to the basic three-dimensional model and the corresponding first model matrix rendering pipeline.

[0185] The present application renders the basic three-dimensional model according to the first model matrix of each constructed basic three-dimensional model, thereby rendering the complete pipeline model.

[0186] S5, the model transformation of the graphics accelerator rendering stage is performed according to the first model data.

[0187] The present application performs vertex transformation on the vertices of the model instance by the offset of each vertex in the basic three-dimensional model and the vertex transformation rule contained in the first model data in the graphics accelerator stage (for example: vertex shader, geometry shader, mesh shader, material, etc.), thereby realizing the coherent rendering of the pipeline and the pipeline connection. As shown in the following figure, it is the processing effect diagram of the pipeline. Figure 7

[0188] The above is only used to help understand the method of the present application and its core essence, but the protection scope of the present application is not limited thereto. For the general technical personnel in the technical field, according to the technical solution and the inventive concept of the present application, equivalent replacement or change within the technical range disclosed by the present application should be covered in the protection scope of the present application. In summary, the content of the present specification should not be understood as the limitation of the present application.​

Claims

1. A vector pipeline 3D instanced coherent rendering method, characterized in that: The steps include: S1. Obtain vector pipeline data and parse it to obtain pipeline data; S2, building a basic three-dimensional model set; S3. Traverse the pipeline data to obtain pipeline connection point information; construct the first model matrix and first model data of each basic 3D model, and establish a coherent rendering pipeline system; S4, traversing the basic 3D model set, instantiating and rendering a complete pipeline system according to the basic 3D model and the corresponding first model matrix; S5, in the graphics accelerator rendering stage, the model is transformed according to the transformation rule of the first model data, and the pipeline and the pipeline connection are rendered coherently.

2. The vector pipeline 3D instanced coherent rendering method according to claim 1, characterized in that: The S3 is as follows: S3.

1. Traverse the pipeline data, obtain a list of pipelines associated with each pipeline connection point and the primary and secondary pipelines of the pipeline connection point, and calculate the first model matrix and first model data of the basic three-dimensional model set of the pipelines associated with the pipeline connection point; The basic 3D model set of pipelines associated with pipeline connection points is as follows: select the primary and secondary pipelines and establish the basic 3D model components of the primary and secondary pipelines, traverse the pipelines associated with the remaining pipeline connection points, and establish the basic 3D model components of each pipeline one by one; S3.

2. Traverse the pipeline connection point information, integrate the first model matrix and first model data of all associated basic three-dimensional model sets of the pipeline connection points, and construct the first model matrix and first model data of the basic three-dimensional model of the pipeline system.

3. The vector pipeline 3D instanced coherent rendering method according to claim 2, characterized in that: The selection of primary and secondary pipelines and the establishment of basic 3D model components of the primary and secondary pipelines are as follows: Select primary and secondary pipelines: Traverse the pipeline list associated with the pipeline connection point and sort it in descending order according to the pipe diameter specification. Determine whether it is a round pipe or a square pipe based on the pipe diameter specification. If it is a round pipe, sort it by radius; if it is a square pipe, sort it by the smallest half of the side length. If there are identical values, sort them in the traversal order. Construction rules for primary and secondary pipelines: Primary and secondary pipelines include pipeline body components, and if the primary and secondary pipelines are not in a straight line, they also include connecting components. If the shapes of the connected components are not consistent, they also include transition components. A first model matrix and first model data of a basic three-dimensional model component are solved, where the first model matrix is ​​a space transformation matrix composed of an offset matrix, a rotation matrix, and a scaling matrix.

4. The vector pipeline 3D instanced coherent rendering method according to claim 3, characterized in that: The first model matrix of the connection component is as follows: Assume that the angle between the main and secondary pipelines is 2*θ, the turning radius is r, and the distance between the connecting component and the pipe point in the opposite direction of the main pipeline is The central angle between the starting and ending coordinates of the connecting component and the center of the connecting component is π-2*θ; the coordinates of the center of the connecting component (x o ,y o ,z o ); Therefore: The offset matrix of the connected components is: The scaling matrix of the connected component is m s , the rotation matrix of the connecting component is m r ; The first model matrix of the connecting component is m t ×m r ×m s .

5. The vector pipeline 3D instanced coherent rendering method according to claim 4, characterized in that: The scaling matrix of the connection component is as follows: If the connecting member is a circular tube, let its inner ring radius be r inner , the outer ring radius is r outter , the radius of the circular tube is r connect , the radius of the main line is r main ; The scaling matrix of the connected component is: If the connecting member is a square tube, let its inner ring radius be r inner , the outer ring radius is r outter , the side length of the square tube diameter is 2*r y , the other side is 2*r xoz The radius of the main line is 2*r. main-y and 2*r main-xox ; The scaling matrix of the connected component is:

6. The vector pipeline 3D instanced coherent rendering method according to claim 4, characterized in that: The rotation matrix of the connecting component is as follows: According to the vector from the starting point of the connecting component to the center of the connecting component and the vector from another pipe point of the main line to the current pipe point, calculate the normal vector direction r of the plane formed by the two vectors f1 ; According to the vector (0,0,-1) and the vector (1,0,0), calculate the normal vector direction r of the plane formed by the two vectors f2 ; Solve for r f2 Go to r f1 The rotation angle and rotation axis; Based on the rotation angle and rotation axis, the Rodrigues rotation formula is used to solve the rotation matrix m. r1 ; With r f1 The rotation axis is calculated again according to the Rodriguez rotation formula to calculate the rotation matrix m of the tangent direction of the axis starting point of the transformed connecting component to the tangent direction of the main line pointing to the connecting component. r2 ; Calculate the rotation matrix m of the connected component r =m r2 ×m r1 .

7. The vector pipeline 3D instanced coherent rendering method according to claim 4, characterized in that: The first model data of the connecting component is as follows: Any point A(x1, y1, z1) on the ring is at its final position after two transformations, and its transformation matrix is ​​the first model data of the connection component; The first transformation is the radial scaling transformation of the ring. The radius of the ring before scaling is r o ; The distance between the projection of point A in the xoz coordinate system and the origin of xoz is d o ; The scaling matrix of point A is: The second transformation is a rotation transformation around the center of the circle. The angle between OA and the z-axis before the transformation is: After transformation, the angle with the z-axis is: The angle transformation around the y axis is: θ d =θ o -θ n , its rotation matrix is:

8. The vector pipeline 3D instanced coherent rendering method according to claim 3, characterized in that: The first model matrix and first model data of the transition component are as follows: Assume that the coordinates of the end point of the connecting component axis are (x e ,y e ,z e ), pipe diameter specification is 2r w and 2r h The direction from the secondary pipeline point to the other end point is vector a, the axis direction of the transition component is b(0,1,0), the length of the transition component is l, the length of the selected 3D model of the transition component is l1, and the diameter specification of the connection end of the transition component 3D model and the connection component is 2r w1 and 2r h1 The diameter specification of the transition component 3D model and the secondary pipeline connection end is 2r w2 and 2r h2 , the coordinate origin of the transition member is at the center of the pipe diameter at the end connected to the connecting member; According to the Rodriguez rotation formula, the rotation matrix m from vector a to vector b is obtained r1 Then, according to the Rodriguez rotation formula, with vector a as the rotation axis, we can get the rotation matrix m r1 The rotation matrix m required to align the transformed transition component with the connecting component's connecting port r2 , then the rotation matrix of the transition component is: m r =m r2 ×m r1 ; Assuming that after the rotation transformation, the corresponding relationship between the pipe diameter specifications of the connecting component and the transition component is: w Corresponding r w1 ; r h Corresponding r h1 ,but: The scaling matrix of the transition component is: The offset matrix of the transition component is: The first model matrix of the transition component is: m t ×m r ×m s ; First model data of the transition component, including transformation rules for vertices connecting the transition component and the secondary pipeline; specifically, the vertices connecting the transition component and the secondary pipeline undergo two vertex transformations, the first being a scaling transformation corresponding to the side length or radius, and the second being a rotation about the secondary pipeline axis to achieve alignment of the connection; Other intermediate vertices are interpolated.

9. The vector pipeline 3D instanced coherent rendering method according to claim 3, characterized in that: The first model matrix and first model data of the transition component are as follows: The length of the pipeline foundation 3D model is l, the pipeline length l2, the scaling factor of the pipeline diameter (s x ,s z ) and the position coordinates of the starting and ending points of the pipeline after clipping the corresponding length (x s-clip ,y s-clip ,z s-clip );but: The offset matrix of the pipeline main component is: The scaling matrix of the pipeline main component is The rotation matrix of the pipeline main component is the rotation matrix m of the direction vector from the axial direction of the pipeline foundation three-dimensional model to the direction vector of another pipe point pointing to the current pipe point. r ; The first model matrix of the pipeline main component is: m t ×m r ×m s ; The first model data of the pipeline main component is empty.

10. A vector pipeline 3D instanced coherent rendering system applied to the method according to any one of claims 1 to 9, characterized in that: include: Vector data parsing module: reads vector pipeline data and parses it to obtain pipeline data; Basic 3D model building module: build a basic 3D model collection; Pipeline processing module: traverses pipeline data to construct the first model matrix and first model data of each basic three-dimensional model; Pipeline rendering module: traverses the basic three-dimensional model set, renders the pipeline according to the basic three-dimensional model and the corresponding first model matrix, and performs model transformation according to the first model data in the graphics accelerator rendering stage.

Citation Information

Patent Citations

  • 3D automatic modeling and scheduling rendering method for integrated pipe network

    CN106683198A

  • Pipeline model rendering method and device, electronic equipment and storage medium

    CN117635797A

  • Three-dimensional underground pipe network real-time rendering method and system based on two-dimensional vector pipeline

    CN118941684A