Method for generating three-dimensional model based on pipeline network vector data
By calculating the ring transformation matrix and updating the vertices at the connection of the pipeline model, the seam problem at the connection of the pipeline is solved, the smooth and seamless connection of the three-dimensional pipeline model is achieved, and the visual realism and topological structure integrity of the model are improved.
Patent Information
- Application Number
- CN202511015096.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-23
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-07-23
AI Technical Summary
The existing generated pipeline model has seam problems at the pipe joints, which causes the model to appear visually broken and topologically discontinuous.
By determining the connection point and extension direction of the pipeline model, calculating the circular vertex transformation matrix perpendicular to the extension direction, updating the outermost vertex of the model, constructing the vertex index and rendering the three-dimensional pipeline model, smooth and seamless connection is achieved.
It eliminates the visual sense of discontinuity, improves the overall visual coherence and topological correctness of the 3D pipeline model, and ensures the geometric accuracy and automation level of the model.
Smart Images

Figure CN120526083B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of underground pipe network three-dimensional modeling, and in particular to a method for generating a three-dimensional model based on pipe network vector data. Background Art
[0002] According to the process of generating a three-dimensional model based on pipeline network vector data, an open source pipeline generation algorithm is used to extract the pipe point data and pipeline data of the two-dimensional vector pipelines, and then establish a three-dimensional underground pipeline network model corresponding to these data.
[0003] However, when current open source pipeline generation algorithms generate pipeline models, they usually only process a single section of pipeline and do not perform additional processing and judgment on the pipeline joints. This results in different vertex arrangements of different pipelines at the intersection of the joints, resulting in seam problems in the model.
[0004] The above content is only used to assist in understanding the technical solution of this application and does not constitute an admission that the above content is prior art. Summary of the Invention
[0005] The main purpose of this application is to provide a method for generating a three-dimensional model based on pipeline network vector data, aiming to solve the technical problem of seams in the existing generated pipeline models.
[0006] To achieve the above objectives, the present application proposes a method for generating a three-dimensional model based on pipeline network vector data. The method for generating a three-dimensional model based on pipeline network vector data includes:
[0007] Determining connection points and pipeline extension directions between three-dimensional pipeline models to be connected, wherein the three-dimensional pipeline models are generated based on pipeline data of pipeline network vector data;
[0008] Calculating a transformation matrix of a circular vertex located at the connection point and perpendicular to the extension direction of the pipeline;
[0009] updating the duplicated vertex of the outermost vertex of the three-dimensional pipeline model to be connected according to the transformation matrix to obtain a newly added vertex;
[0010] Constructing vertex indices of the newly added vertices, and rendering the three-dimensional pipeline model to be connected according to the vertex indices to obtain a target three-dimensional pipeline model.
[0011] In one embodiment, the step of calculating the transformation matrix of the annular vertex located at the connection point and perpendicular to the extension direction of the pipeline includes:
[0012] Based on the pipeline data coordinates of the current 3D pipeline model, determining a first direction vector corresponding to the pipeline extension direction and a second direction vector between the connection point position and the point to be extended, where the point to be extended is a coordinate point of the 3D pipeline model in one direction that indicates the direction of connection with other 3D pipeline models;
[0013] normalizing the first direction vector and the second direction vector;
[0014] Calculate the dot product and cross product results between the first direction vector and the second direction vector to obtain a rotation axis and a rotation angle, where the rotation angle is half of the angle between the first direction vector and the second direction vector;
[0015] The transformation matrix is constructed based on the rotation axis and the rotation angle.
[0016] In one embodiment, the step of determining the connection points and pipeline extension directions between the three-dimensional pipeline models to be connected, wherein the three-dimensional pipeline models are generated based on the pipeline data of the pipeline network vector data, comprises:
[0017] Determine the R-tree spatial index of the current pipeline model to be connected;
[0018] Based on the R-tree spatial index, the coordinates of the points to be extended between the current pipeline model and the next pipeline model are retrieved to obtain the points to be extended, wherein the pipeline models whose front and rear endpoints are within a threshold distance from the endpoint of the current pipeline model are candidate pipeline models, the endpoint of the current pipeline model is the connection point, and the vertices of the candidate pipeline model adjacent to the connection point are the points to be extended;
[0019] The pipeline extension direction is determined according to the guiding direction of the to-be-extended point.
[0020] In one embodiment, after the step of retrieving the coordinates of the to-be-extended point between the current pipeline model and the next pipeline model based on the R-tree spatial index to obtain the to-be-extended point, the method of generating a three-dimensional model based on the pipeline network vector data further includes:
[0021] If there are multiple to-be-extended points to be selected for the next pipeline model, determining the pipeline model with the smallest difference in pipeline end direction from the current pipeline model as the next pipeline model;
[0022] After the next pipeline model is determined, the step of calculating the pipeline extension direction according to the pipeline end direction of the current pipeline model and the pipeline start direction of the next pipeline model is performed.
[0023] In one embodiment, before the step of determining the connection points and pipeline extension directions between the three-dimensional pipeline models to be connected and the step of generating the three-dimensional pipeline model based on the pipeline data of the pipeline network vector data, the method of generating the three-dimensional model based on the pipeline network vector data includes:
[0024] Determine the pipeline coordinates corresponding to the pipeline data, and offset the pipeline coordinates in the plane projection coordinate system to a model coordinate system with the pipeline data center as the origin;
[0025] Converting pipeline coordinates at other longitudes and latitudes into geocentric earth-fixed coordinates, and converting the geocentric earth-fixed coordinates into a model coordinate system with the pipeline data center as the origin;
[0026] Taking each section of the pipeline as a node, establishing the R-tree spatial index;
[0027] The pipeline data is traversed to determine the connection coordinates and the points to be extended corresponding to each section of the pipeline.
[0028] In one embodiment, after the step of traversing the pipeline data and determining the connection coordinates and the points to be extended corresponding to each section of the pipeline, the method of generating a three-dimensional model based on the pipeline network vector data further includes:
[0029] Traversing the pipeline data, constructing a curved local coordinate system for each section of the pipeline, and establishing model coordinate vertices of the curved local coordinate system;
[0030] The vertex index of the triangulated network is established according to the generation order of the model coordinate vertices, and the three-dimensional pipeline model of each section of the pipeline is generated based on the vertex index.
[0031] In one embodiment, after the steps of constructing vertex indices of the newly added vertices and rendering the three-dimensional pipeline model to be connected according to the vertex indices to obtain the target three-dimensional pipeline model, the method of generating a three-dimensional model according to pipeline network vector data further includes:
[0032] performing pre-connection processing on the pipe point data of the pipe network vector data to discard abnormal pipe point data;
[0033] Obtaining the standard model and configuration parameters corresponding to the pipe point data in a standard pipe point model library, and calculating the standard conversion matrix corresponding to the pipe point data and the configuration parameters;
[0034] The standard model is transformed by superposition according to the standard transformation matrix to obtain a pipe point model;
[0035] The target three-dimensional pipeline model and the pipe point model are synthesized to obtain a three-dimensional pipeline model.
[0036] In one embodiment, before the step of performing pre-connection processing on the pipe point data of the pipe network vector data to discard abnormal pipe point data, the method of generating a three-dimensional model based on the pipe network vector data further includes:
[0037] Constructing the standard pipe point model library corresponding to the pipe point data;
[0038] Determine the pipe point coordinates corresponding to the pipe point data, and offset the pipe point coordinates in the plane projection coordinate system to a model coordinate system with the pipeline data center as the origin;
[0039] The coordinates of the pipe points at other longitudes and latitudes are converted into geocentric earth-fixed coordinates, and coordinate transformation is performed to convert the geocentric earth-fixed coordinate system into a model coordinate system with the pipeline data center as the origin;
[0040] Establishing a pipeline R-tree spatial index according to the pipeline data where the pipeline point coordinates are located;
[0041] The pipeline point data after coordinate conversion is traversed, and the pipeline coordinates adjacent to the pipeline point in the connected pipelines are retrieved according to the pipeline R-tree spatial index.
[0042] In addition, to achieve the above-mentioned purpose, the present application also proposes a three-dimensional model generation device, which includes: a memory, a processor, and a computer program stored on the memory and runnable on the processor, and the computer program is configured to implement the steps of the method for generating a three-dimensional model based on pipeline network vector data as described above.
[0043] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the method for generating a three-dimensional model based on the pipeline network vector data as described above are implemented.
[0044] One or more technical solutions proposed in this application have at least the following technical effects:
[0045] By determining the connection point and pipeline extension direction of the 3D pipeline model to be connected, calculating the circular vertex transformation matrix perpendicular to this direction, and updating the copy of the outermost vertex of the model accordingly to obtain the newly added vertex, and finally constructing the vertex index for rendering, the problem of geometric seams or dislocation caused by the mismatch of vertex position or direction at the connection of the 3D pipeline model is effectively solved. Based on this, by dynamically calculating the circular transformation matrix according to the pipeline extension direction at the connection point, the generation position and direction of the newly added vertex are precisely controlled, so that the originally separated pipeline model can achieve a smooth and seamless geometric transition at the joint. This not only eliminates the visual sense of discontinuity and significantly improves the overall visual coherence and realism of the generated 3D pipeline model, but also ensures the correctness of the topological structure of the model in the connection area, providing a structurally complete and geometrically accurate 3D foundation for subsequent pipeline analysis, collision detection or visualization applications. The entire process does not require manual intervention in vertex adjustment, which improves the automation and reliability of model construction. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0047] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0048] Figure 1 This is a comparative diagram of a three-dimensional pipeline model in which the existing technology has a seam problem in the method of generating a three-dimensional model based on pipeline network vector data in this application;
[0049] Figure 2 A flowchart of the first embodiment of the method for generating a three-dimensional model based on pipeline network vector data provided by this application;
[0050] Figure 3 A schematic diagram of establishing a spatial index for the method of generating a three-dimensional model based on pipeline network vector data in this application;
[0051] Figure 4 A schematic diagram of copying external vertices and vertex connection modeling in the method of generating a three-dimensional model based on pipeline network vector data in this application;
[0052] Figure 5 This is a flow chart of processing points to be extended in the method for generating a three-dimensional model based on pipeline network vector data in this application;
[0053] Figure 6This is a schematic diagram of the pipeline data preprocessing process of the method for generating a three-dimensional model based on pipeline network vector data in this application;
[0054] Figure 7 This is a flow chart of generating a pipeline model according to the method of generating a three-dimensional model based on pipeline network vector data in this application;
[0055] Figure 8 A schematic diagram of a process for generating a three-dimensional pipeline model according to a method for generating a three-dimensional model based on pipeline network vector data in this application;
[0056] Figure 9 This is a flow chart of pipe point data screening in the method for generating a three-dimensional model based on pipe network vector data in this application;
[0057] Figure 10 This is a flow chart of generating a pipe point model in the method for generating a three-dimensional model based on pipe network vector data in this application;
[0058] Figure 11 A schematic diagram of generating pipe point coordinates in the method of generating a three-dimensional model based on pipe network vector data in this application;
[0059] Figure 12 This is a schematic diagram of the process of preprocessing pipe point data in the method of generating a three-dimensional model based on pipe network vector data in this application;
[0060] Figure 13 This is a schematic diagram of the equipment structure of the hardware operating environment involved in the method for generating a three-dimensional model based on pipeline network vector data in an embodiment of the present application.
[0061] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0062] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.
[0063] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0064] According to the process of generating a three-dimensional model based on pipeline network vector data, an open source pipeline generation algorithm is used to extract the pipe point data and pipeline data of the two-dimensional vector pipelines, and then establish a three-dimensional underground pipeline network model corresponding to these data.
[0065] However, when current open source pipeline generation algorithms generate pipeline models, they usually only process a single section of pipeline and do not perform additional processing and judgment on the pipeline joints. This results in different vertex arrangements of different pipelines at the intersection of the joints, resulting in seam problems in the model.
[0066] For details, please refer to Figure 1 , Figure 1 The model in Figure (a) is a pipeline model with a seam problem. When connecting the model, the current open source pipeline generation algorithm mainly considers how to handle a single segment of pipeline, and does not perform additional processing and judgment on the pipeline connection. This results in different vertex arrangements of different pipelines at the intersection of the connection, resulting in a seam problem, that is, obvious model alignment errors at the connection. Where W is the plane circle corresponding to the X-axis and Z-axis, K is the plane circle corresponding to the X-axis and Y-axis, and N is the plane corresponding to the Y-axis and Z-axis. Figure 3 、 Figure 4 as well as Figure 11 The W, K, and N that appear in the text have the same meaning and will not be described in detail later.
[0067] Based on this, the main solution of the embodiment of the present application is to: determine the connection points and pipeline extension directions between the three-dimensional pipeline models to be connected, wherein the three-dimensional pipeline models are generated based on the pipeline data of the pipeline network vector data;
[0068] Calculating a transformation matrix of a circular vertex located at the connection point and perpendicular to the extension direction of the pipeline;
[0069] updating the duplicated vertex of the outermost vertex of the three-dimensional pipeline model to be connected according to the transformation matrix to obtain a newly added vertex;
[0070] Constructing vertex indices of the newly added vertices, and rendering the three-dimensional pipeline model to be connected according to the vertex indices to obtain a target three-dimensional pipeline model.
[0071] Specifically, by dynamically calculating the toroidal transformation matrix at the connection point based on the pipeline extension direction, the generated position and direction of the newly added vertices are precisely controlled, achieving a smooth, seamless geometric transition between the previously separated pipeline models. This not only eliminates the visual sense of disconnection, significantly improving the overall visual coherence and realism of the generated 3D pipeline model, but also ensures the correct topological structure of the model in the connection area, providing a structurally complete and geometrically accurate 3D foundation for subsequent pipeline analysis, collision detection, or visualization applications. The entire process requires no manual intervention in vertex adjustment, improving the automation and reliability of model construction.
[0072] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, mobile phone, etc., or an electronic device, 3D model generation device or system capable of implementing the above functions. The following uses a 3D model generation system as an example to illustrate this embodiment and the following embodiments.
[0073] The present invention provides a method for generating a three-dimensional model based on pipeline network vector data. Figure 2 , Figure 2 This is a flow chart of the first embodiment of the method for generating a three-dimensional model based on pipeline network vector data in this application.
[0074] In this embodiment, the method for generating a three-dimensional model based on pipeline network vector data includes steps S10 to S40:
[0075] Step S10: determining the connection points between the three-dimensional pipeline models to be connected and the pipeline extension directions.
[0076] It should be noted that the three-dimensional pipeline model is generated based on the pipeline data of the pipeline network vector data. The specific model generation process will not be described in detail in the current embodiment. The connection point refers to the coordinate point of a three-dimensional pipeline model in one direction that needs to be directly connected with other three-dimensional pipeline models, representing the physical end point of the pipeline model in this direction. The point to be extended refers to the coordinate point of a three-dimensional pipeline model in one direction that guides the connection direction with other three-dimensional pipeline models. It is used to indicate which spatial direction should be looked for the next model to be connected. The number of points to be extended is equal to the number of models that the three-dimensional pipeline model needs to connect in this direction. For example, at the back of the three-dimensional pipeline model, a three-way pipe is connected. At this time, there are two points to be extended at this position. If it is a four-way pipe, there are three points to be extended. If it is a two-way pipe, there is only one point to be extended. If it is the tail of the pipe, there is no point to be extended. It is understandable that in a tee or more channel pipes, that is, when the current pipeline model needs to connect with two other pipeline models, the seam problem usually exists in a continuous pipeline, that is, the seam problem usually occurs with one of the pipeline models, and the other pipeline models will not have a seam problem. Therefore, if there are multiple points to be extended, it is necessary to calculate and determine the best point to be extended, which is usually the point closest in direction.
[0077] The pipeline extension direction refers to the tangent direction vector of the pipeline centerline at the connection point, which represents the direction of the pipeline at the connection point. The point to be extended can indicate the direction in which the current model and the next model should be connected. This direction is the pipeline extension direction.
[0078] In this embodiment, after each section of the pipeline is modeled separately, the system uses spatial indexing to find another pipeline model that needs to be connected before and after the current pipeline model, and based on the number of models that need to be connected, determines the number of points to be extended and the location coordinates that need to be extended.
[0079] Optionally, by identifying the model endpoints, the vertex data of each model can be traversed to locate the closest endpoints of the two models as the endpoints to be connected, and then the two endpoints can be taken as the other party's points to be extended.
[0080] To determine the pipeline extension direction, you can calculate the direction vector from the connection point to the point to be extended as the extension direction. Alternatively, you can first calculate the average direction and the curvature vector, and then calculate the direction perpendicular to the curvature plane to determine the pipeline extension direction.
[0081] By determining the connection point and the point to be extended, this embodiment accurately locates the specific spatial location where the two pipe sections need to be connected, thereby facilitating the acquisition of key geometric and directional information about the connection area, providing accurate input data for all subsequent calculations and operations. By determining the pipeline extension direction, a vector representing the growth direction of the connection area is defined. This provides a directional reference for the next step of generating a new vertex ring and a target direction for subsequent transformation matrix calculations. This ensures a more natural directional change in the connected pipe, avoiding harsh corners and seams.
[0082] Step S20: Calculate the transformation matrix of the annular vertex located at the connection point and perpendicular to the extension direction of the pipeline.
[0083] It should be noted that directly using the vertices at the end point of the previous section or the starting point of the next section for connection cannot perfectly adapt to the position and direction of the connection point in terms of model details, making it difficult to distinguish the two pipes, resulting in gaps or distortions and seam problems. Therefore, it is necessary to create a new set of vertices specifically for the connection area. These vertices are precisely located on the plane defined by the optimal connection point and are arranged according to the actual extension direction of the pipe to form a vertex ring that matches the cross-sectional shape of the pipe (usually a circle). The transformation matrix is used to transform vertices from one coordinate system or state to a target coordinate system or target state. It is the core basis for the geometric transformation of subsequent copied vertices and determines the final position and orientation of the newly added vertices in space.
[0084] Therefore, in this embodiment, the position of the connection point can be directly used as a reference to draw annular vertices perpendicular to the extension direction of the pipeline, so as to calculate the transformation matrix of the current position based on the annular vertices. That is, the rotation matrix can transform a reference annular vertex to align with the extension direction of another pipeline model at the connection point. The new vertex ring composed of these new vertices is used as an intermediate layer to provide a geometric basis for smooth transition. It provides a reference for subsequent operations such as vertex transformation, triangle patch generation, normal calculation, etc., ensuring the consistency and accuracy of the geometric definition of the connection area. Among them, the ring composed of annular vertices will not be perpendicular to the cross section of the pipeline model.
[0085] Specifically, during the transformation matrix calculation, the first direction vector corresponding to the pipeline extension direction and the second direction vector between the position of the point to be extended and the connection point can be determined based on the pipeline data coordinates of the current 3D pipeline model. Assuming that the pipeline data coordinate array is P1, P2, P3, .....PN, for the pipe head (point P1, the coordinate corresponding to the connection position), the point to be extended is Q, and each coordinate has three coordinate values of x, y, and z. At this time, the first direction vector d1 is calculated first:
[0086] ,
[0087] Then normalize the first direction vector:
[0088] ,
[0089] Then calculate the second direction vector d2:
[0090] ,
[0091] The second direction vector is then normalized:
[0092] .
[0093] Then calculate the rotation axis vec and rotation angle θ by dot product and cross product:
[0094] ,
[0095] Finally, a transformation matrix is constructed based on the rotation axis and rotation angle. With p1 as the rotation center, the rotation matrix is constructed using the rotation axis and rotation angle θ, and then integrated into a complete rigid body transformation matrix:
[0096] The rotation angle is half of the angle between the first direction vector and the second direction vector.
[0097] Define the parameters: .
[0098] Then calculate the rotation matrix M2:
[0099] ,
[0100] Then calculate the translation matrix M1:
[0101] ,
[0102] And calculate the translation matrix M3:
[0103] ,
[0104] The final complete transformation matrix M=M1×M2×M3:
[0105] .
[0106] Based on this, by transforming the coordinates, the spatial transformation of the pipeline geometry with P1 as the fulcrum towards the pipe head connection point Q can be achieved.
[0107] Step S30 , updating the duplicated vertices of the outermost vertices of the three-dimensional pipeline model to be connected according to the transformation matrix to obtain newly added vertices.
[0108] In this embodiment, the outermost vertex refers to the vertex in the three-dimensional pipeline model that needs to be connected, and its copied vertex is a copy of the annular vertex of the end face of the three-dimensional pipeline model to be connected. Among them, the copied vertex retains the properties of the original vertex, while allowing the position and normal to be independently modified, keeping the original pipeline geometry unchanged. If the original vertex is used directly, the original vertex will be directly moved, the original pipeline shape will be changed, and the original connection relationship will be destroyed. Therefore, the coordinates corresponding to the copied vertex are usually superimposed on the transformation matrix. The newly added vertex is the new vertex coordinate data obtained by applying the transformation matrix to the copied vertex.
[0109] During implementation, when copying the outermost vertices, usually the outermost vertices of the two pipeline models to be connected need to be copied and converted. In other optional implementations, only the outer vertices of one of the pipeline models can be copied.
[0110] This embodiment updates the outermost copy vertex of the transformation matrix, moves and rotates the original starting vertex of the rear pipeline and the original ending vertex of the front pipeline to the correct position and direction, so that the changed rear starting vertex and front ending vertex are accurately aligned, thereby forming a smooth transition surface.
[0111] Step S40 : constructing vertex indices of the newly added vertices, and rendering the 3D pipeline model to be connected according to the vertex indices to obtain a target 3D pipeline model.
[0112] In this embodiment, after obtaining the current model, vertices are connected to form primitives by constructing vertex indices, so that the system renders a surface composed of vertices.
[0113] For details, please refer to Figure 3, it is possible to organize the vertex generation in the form of a triangulated network and establish a vertex index, so as to render the model at that position and form a smooth transition surface to fill the gaps when the models are connected, thus achieving seamless connection of the three-dimensional pipeline model. It is understandable that in the connection process, the model connection is usually carried out by traversal, that is, traversing each section of the pipeline in turn and establishing a model of the pipeline, and then performing seam processing on the established model, so that each three-dimensional pipeline model to be connected completes the model connection processing in sequence based on the above steps, thereby obtaining the final connected target three-dimensional pipeline model.
[0114] Furthermore, after the model rendering is completed, the connection between the two pipeline models to be connected is as follows Figure 4 As shown in area A, the new vertices generated by copying and performing matrix transformation form each triangular facet. The content of the triangular facet is completed during rendering, so that the pipeline model after connection processing has smooth and seamless connections.
[0115] For example, in order to help understand the implementation process of the method for generating a three-dimensional model based on the pipe network vector data obtained by combining this embodiment with the first embodiment, please refer to Figure 5 , Figure 5 A schematic flow chart of processing points to be extended in a method for generating a three-dimensional model from pipeline network vector data is provided. Specifically, after determining the three-dimensional pipeline model to be connected, the number of points to be extended in the three-dimensional pipeline model is determined. If there are multiple points to be extended, an optimal point is calculated, and the point to be extended closest to the original pipeline direction is determined to be the optimal point to be extended. If only one point exists, this point is the optimal point to be extended. If no points to be extended exist, the seam processing is skipped. Subsequently, the transformation matrix of the ring vertex is calculated based on the position of the optimal point to be extended and the current pipeline extension direction. The vertex data of the corresponding edge is then copied and the coordinates of the copied data are superimposed on the transformation matrix to add new vertices. Finally, the modeling of the outermost part is supplemented by adding indices to complete the connection between the models.
[0116] This embodiment provides a method for generating a three-dimensional model based on pipeline network vector data. By accurately calculating the spatial transformation matrix at the connection point and generating geometrically matched new vertices based on this, the correct topological index of the connection patch is constructed, and finally a seamless target three-dimensional pipeline model is rendered. The problem of geometric seams at the connection of the three-dimensional pipeline model due to differences in direction, position or pipe diameter is eliminated, and the overall visual realism, geometric accuracy and topological continuity of the pipeline network three-dimensional model are significantly improved. The entire process does not require manual intervention in model repair, which greatly improves the efficiency and reliability of the pipeline network three-dimensional model construction and provides a high-quality model foundation for subsequent pipeline analysis, simulation and visualization.
[0117] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above introduction and will not be repeated hereafter. On this basis, step S10 further includes steps S11 to S12:
[0118] Step S11: Determine the R-tree spatial index of the current pipeline model to be connected.
[0119] The R-tree spatial index is a multidimensional data structure used for efficient spatial queries. It organizes the bounding boxes of pipeline models in three-dimensional space into a tree hierarchy to accelerate the retrieval of neighboring models.
[0120] In this embodiment, before generating a three-dimensional pipeline model based on pipeline data, it is necessary to construct an R-tree spatial index data structure for each node. Among them, the data structure of each node includes pipe diameter, id, coordinates, front point group to be extended, and back point group to be extended. The id is the id set when the attributes are separated, and the coordinates are the pipeline coordinate array after multiple processing. The head and tail of the pipeline are defined by the front and back relationship of the coordinate array. The front and back point groups to be extended respectively include the coordinates of the points to be extended at the head or tail of the pipeline. There may be multiple coordinates of the points to be extended, indicating that the head or tail of the pipeline is connected to multiple pipelines at the same time through the pipe points. Therefore, the R-tree spatial index can effectively determine the pipeline model of the next node that the current model to be connected needs to connect, or the pipeline model of the previous node. Therefore, the R-tree spatial index is a data structure established when the pipeline node model is constructed, and the system can directly determine the R-tree spatial index based on the id information of the model.
[0121] The constructed R-tree index avoids global traversal of all model vertices, significantly improving the calculation efficiency of the points to be extended.
[0122] Step S12: based on the R-tree spatial index, retrieve the coordinates of the point to be extended between the current pipeline model and the next pipeline model, where the coordinates of the point to be extended are the point to be extended.
[0123] In this embodiment, the spatial locations of the geometric centers of the end faces of two pipeline models are referred to as the connection coordinates. During this process, the system expands a cubic query region, centered on the endpoint coordinates of the current model, to a preset threshold distance. The system then uses an R-tree index to quickly retrieve bounding boxes of other pipeline models that intersect the query region, screening out spatially adjacent candidate models. Pipelines whose front and rear endpoints are within the threshold distance from the current model endpoint are then considered candidate pipelines. The corresponding endpoints are designated as connection points, and the vertices adjacent to the connection points of the candidate pipelines are designated as points to be extended.
[0124] Alternatively, if the calculated number of points to be extended is multiple, the coordinates of the point to be extended closest to the extension direction of the current pipeline model are determined as the point to be extended. That is, the model closest to the direction of the current pipeline model is considered to be the next pipeline model to be connected. If the number of connection points is one, step S13 is executed.
[0125] For example, when there are multiple points to be extended, the process of calculating the best point to be extended is as follows:
[0126] Assume that the pipeline coordinate array is P1, P2, P3...PN. For the pipe head (point P1), the group of points to be extended obtained through preprocessing is Q1, Q2, Q3...QN. Each coordinate has three coordinate values: x, y, and z. The process of calculating the optimal point to be extended for the pipe head is as follows:
[0127] , then traverse Q1, Q2, Q3...QN to obtain the direction between each connection point group and the pipe head:
[0128] ,
[0129] After obtaining the direction vectors of each point to be extended and the connection point in this way, calculate the maximum value of the cosine value of the direction angle:
[0130]
[0131] Take the largest C value: Cm, and the corresponding Qm is the best connection point.
[0132] In this way, the point to be extended with the closest direction is obtained through the cosine value as the optimal point to be extended.
[0133] Step S13: determining the pipeline extension direction according to the guidance direction of the point to be extended.
[0134] It can be understood that the point to be extended can indicate the direction in which the current model and the next model should be connected, and this direction is the pipeline extension direction.
[0135] This embodiment provides a method for generating a 3D model from pipeline network vector data. Using an R-tree spatial index, it efficiently locates adjacent pipeline models and accurately calculates connection points and points to be extended, providing a geometric basis for subsequent transformation matrix calculations. Combining ring vertex transformation with indexed rendering significantly improves computational efficiency while ensuring connection accuracy.
[0136] Based on the second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the second embodiment can be referred to the above introduction and will not be repeated hereafter. On this basis, before step S10, the method for generating a three-dimensional model based on the pipeline network vector data further includes steps S01 to S04:
[0137] Step S01: Determine the pipeline coordinates corresponding to the pipeline data, and offset the pipeline coordinates in the plane projection coordinate system to a model coordinate system with the pipeline data center as the origin.
[0138] Step S02: converting the pipeline coordinates of other longitudes and latitudes into geocentric earth-fixed coordinates, and converting the geocentric earth-fixed coordinates into a model coordinate system with the pipeline data center as the origin.
[0139] Step S03: Taking each section of the pipeline as a node, establish the R-tree spatial index.
[0140] Step S04: traverse the pipeline data to determine the connection coordinates and the points to be extended corresponding to each section of the pipeline.
[0141] In this embodiment, before the pipeline model is generated, the pipeline data needs to be preprocessed to obtain the pipeline data structure required for building the pipeline model. Figure 6 In this process, coordinate preprocessing is performed first. For data in a planar projection coordinate system, the overall coordinate center is directly calculated. A transformation matrix is then constructed to transform all coordinate data, offsetting the center of the data to the origin, i.e., the model coordinate system where the pipeline center is the origin. For general longitude and latitude data, the coordinate data is converted to ECEF (Earth-Centered Earth-Fixed) coordinates, and then to a model coordinate system with the model center as the origin, the Z axis pointing upward, the X axis pointing eastward, and the Y axis pointing northward. The coordinate conversion method is conventional and will not be elaborated on here.
[0142] After completing the coordinate transformation, a spatial index is created using the RTree structure, with each pipeline segment as a node. This results in an R-tree spatial index. Finally, the nodes are traversed, and the spatial index is used to retrieve the preceding and following coordinates of each node. This complements the preceding and following coordinates and the coordinates to be extended for each node, i.e., each pipeline segment. This allows the pipeline model corresponding to the current model to be determined based on the preceding and following coordinates, thereby constructing the pipeline data structure required for pipeline modeling.
[0143] Furthermore, after obtaining the pipeline data required for modeling, it is necessary to perform modeling processing on the pipeline data. Therefore, after step S04, steps S05 to S06 are also included:
[0144] Step S05 , traversing the pipeline data, constructing a curved local coordinate system for each section of the pipeline, and establishing model coordinate vertices of the curved local coordinate system.
[0145] In this embodiment, a 3D model is generated based on the data structure generated above. During this process, all pipelines must be traversed and local coordinate systems for the curves of all pipelines established. Local coordinate systems are established at regular intervals along the pipeline curve. The first coordinate system is constructed using the principal normal, secondary normal, and tangent line. Subsequent coordinate systems are rotated based on the tangent changes and the previous coordinate system to ensure that the coordinates of subsequent vertices are controllable on the curve.
[0146] After the coordinate system is constructed, the local coordinate system is used as the reference, and the model coordinate vertices are established with radius data and a certain angle interval, so that vertex indexes can be constructed based on the model coordinate vertices, and then modeling is performed through the indexes. The calculation formula for the model coordinate vertex P is as follows:
[0147] ,
[0148] in, is the angle between the coordinate vertex direction and the x-axis direction.
[0149] Step S06: establishing vertex indexes of a triangulated network according to the generation order of the model coordinate vertices, and generating the three-dimensional pipeline model of each section of the pipeline based on the vertex indexes.
[0150] In this embodiment, the vertex generation order is organized in the form of a triangulated network, and a vertex index is established, so that the system performs modeling in the composed triangulated network area through the vertex index to complete the modeling process of the pipeline coordinates.
[0151] For example, to help understand the pipeline modeling and model fusion output implementation process obtained by combining the first and second embodiments, please refer to Figure 6 and Figure 7 ,based on Figure 6 The pipeline data preprocessing process shown in the figure obtains the pipeline data structure required for modeling, and then traverses the pipeline data. First, the first or next section of the pipeline is taken, and then the local coordinate system of the curve of the pipeline is established and the coordinate vertices are established based on the coordinate system. Then, the vertex index of the triangulated network is generated based on the coordinate vertices to complete the modeling of the pipeline section and obtain the pipeline model. Then, the seam processing is performed based on the pipeline model. The process of seam processing is as follows Figure 5 Therefore, the data stream after the seam is output and it is confirmed whether the traversal is completed. If so, the target three-dimensional pipeline model is obtained. If not, the pipeline traversal and model seam processing are continued.
[0152] This embodiment provides a method for generating a 3D model from pipeline network vector data. Before model merging, pipeline data is preprocessed to generate the R-tree spatial index data structure required for modeling. This data structure is then used to match data when merging the model. Furthermore, a local coordinate system is constructed, and vertex indexing is performed based on the generated coordinate vertices to generate the pipeline model, providing a data foundation for subsequent model merging.
[0153] Based on the first embodiment of the present application, in the fourth embodiment of the present application, the same or similar contents as those in the first embodiment can be referred to the above introduction and will not be described in detail later. Figure 8 In the process of processing pipeline network vector data and generating a three-dimensional pipeline network model, in addition to pipeline modeling, pipe point modeling is also required to combine the two modeling to obtain the final three-dimensional pipeline network model. Among them, in the attribute separation process, ids are assigned to pipeline and pipe point data, and the attribute data and ids are exported and stored in the database. The attribute data in the vector data is deleted, and only the id and modeling-related information are retained. After processing, the pipeline data contains id, pipeline coordinates and pipe diameter, and the pipe point data contains id and coordinates, completing the attribute extraction. In the coordinate conversion process, the original data coordinate information is converted into coordinate information that conforms to the rendering platform coordinate system. Simple coordinate conversion can be completed directly through the proj library or GIS software.
[0154] Therefore, after step S40, the method for generating a three-dimensional model based on the pipe network vector data further includes steps S50 to S80:
[0155] Step S50 , performing pre-connection processing on the pipe point data of the pipe network vector data to discard abnormal pipe point data.
[0156] Abnormal pipeline points typically include data points whose coordinates are outside the geographic range, missing key attributes, do not match the actual pipeline situation, or are located beyond a threshold distance from adjacent pipelines.
[0157] In this embodiment, the pipe point data that undergoes pre-connection processing is the pipe point data in the model coordinate system, that is, the pipe point data has been subjected to coordinate pre-processing before the pre-connection and subsequent modeling processing.
[0158] Therefore, by traversing the converted pipe point data and using spatial indexing to find the coordinates of the pipelines connected to the pipe point, we can determine whether the number of pipelines connected to the pipe point is consistent with the actual number. If not, it indicates a data problem and the pipe point needs to be discarded. In addition, the coordinate distance between the pipe point and the pipeline it connects to can be calculated. If it exceeds the tolerance, the point is marked as an isolated point and discarded.
[0159] For details, please refer to Figure 9Based on the pipe point data in the model coordinate system (the pipe point data after coordinate conversion), the pipe point data and all pipeline data are traversed in turn. The pipeline data connected to the pipe point is found through the pipeline space index structure in the model coordinate system, and the coordinates adjacent to the pipe point in the connected pipeline are recorded. Then, it is judged whether the pipe point data is compliant. For example, a three-way pipe point should only connect three sections of pipelines, but the number of recorded coordinates is five, indicating that the pipe point data is abnormal. At this time, the pipe point is discarded. If it complies with the rules, the traversal is carried out until the traversal is completed. Finally, in the process of pipe point pre-connection processing, the abnormal pipe points are removed to avoid subsequent modeling errors.
[0160] Step S60, obtaining the standard model and configuration parameters corresponding to the pipe point data in the standard pipe point model library, and calculating the standard conversion matrix corresponding to the pipe point data and the configuration parameters;
[0161] Step S70: The standard model is transformed by superposition according to the standard transformation matrix to obtain a pipe point model.
[0162] In this embodiment, the standard pipe point model library is a predefined parameterized 3D model library, or it can be derived from preprocessing pipe point data. Configuration parameters include pipe diameter, major axis direction, minor axis direction, and other parameters, while the standard transformation model transforms the standard model from the local coordinate system to the actual pipe point location.
[0163] In this process, after completing the preprocessing of the pipe point data, the standard model and configuration parameters of the corresponding pipe point are obtained from the standard library based on the retrieval method by traversing the pipe point data. Then, the transformation matrix is calculated by combining the obtained configuration parameters and pipe point data, and the standard model is superimposed and transformed to meet the data requirements. Finally, the processed standard model is placed in the output stream to output in conjunction with the pipeline data.
[0164] For details, please refer to Figure 10 Based on the required pipe point data structure, the first or next pipe point is traversed in sequence. Then, the standard pipe point model and configuration parameters are read from the standard pipe point model library. The transformation matrix is then calculated based on the pipe point data. The standard model is then transformed using the transformation matrix to obtain a pipe point model that meets the requirements. Finally, the model is placed into the output stream, and after the traversal is complete, the 3D model is output.
[0165] Specifically, during the calculation of the standard transformation matrix of a pipe point, the configuration parameters of the standard model of the pipe point used for the calculation include the center position of the standard pipe point (P), the main axis direction of the standard pipe point (V1), the secondary axis direction of the standard pipe point (V2), and the diameter of the standard pipe point (d). The actual data of the pipe point used for the calculation include the actual position (P'), the actual main axis direction (V1'), the actual secondary axis direction (V2'), and the actual diameter of the pipe point (d'). Therefore, the standard transformation matrix is:
[0166] First calculate two translation matrices:
[0167] ,
[0168] Then calculate the principal axis rotation matrix M1:
[0169] ,
[0170] Then calculate the minor axis rotation matrix:
[0171] ,
[0172] Finally, the matrix M2 is calculated based on the two vectors, and the final transformation matrix is:
[0173] .
[0174] Step S80: generating a three-dimensional pipeline model according to the target three-dimensional pipeline model and the pipe point model.
[0175] In this embodiment, it is necessary to merge the spatial data of the pipeline model and the pipeline point model into a single rendering unit and ensure geometric connection.
[0176] As an optional implementation, the system positions the pipe point model at the connection point of the pipeline model based on the pipe point coordinates. It then removes any overlapping vertices between the pipe point model and the pipeline model end faces before merging and rendering them. The vertex coordinates of the pipeline model and the pipe point model are merged into the same vertex buffer. The index data for both models is also merged, and the index value of the pipe point model is re-offset. Finally, a complete 3D pipeline model is generated based on this merged content.
[0177] This embodiment provides a method for generating a three-dimensional model based on pipeline network vector data. By automatically filtering abnormal pipe points, parameterizing and matching standard models, and accurately calculating spatial transformations, a pipe point model that seamlessly matches the pipeline geometry is generated, ultimately synthesizing a structurally complete three-dimensional pipeline model.
[0178] Based on the fourth embodiment of the present application, in the fifth embodiment of the present application, the same or similar contents as those in the fourth embodiment can be referred to the above description and will not be described in detail. On this basis, before step S50, it is necessary to build a standard pipe point model library and convert the pipe point coordinates. Specifically, in this process, it is necessary to first build a standard pipe point model library corresponding to the pipe point data. In this process, the required pipe point type is first determined. Taking the three-way pipe point as an example, please refer to Figure 11First, create a standard pipe point model with the center of the pipe connection as the origin. The origin is located at the intersection of the pipe centerlines, which serves as the origin of the xyz axes. Then, add the pipe point configuration parameters, including the pipe diameter, primary axis direction, and secondary axis direction of the standard model. In the established coordinate system, the primary axis direction of the tee standard model is (1, 0, 0) and the secondary axis direction is (0, 1, 0). Other configuration parameters are based on the corresponding model. By building a standard model coordinate library, the parameters of the pipe point model processing are standardized, improving the effectiveness of the model transformation processing.
[0179] After building the standard pipe point model library, it is also necessary to generate the pipe point data structure required for modeling from the pipe point data. This process is similar to the coordinate preprocessing in pipeline data. Please refer to Figure 12 During the coordinate preprocessing process, the pipe point coordinates corresponding to the pipe point data are determined, and the pipe point coordinates in the plane projection coordinate system are offset to the model coordinate system with the pipeline data center as the origin, and the pipe point coordinates of other longitudes and latitudes are converted into geocentric earth-fixed coordinates, and coordinate transformation is performed from the geocentric earth-fixed coordinate system to the model coordinate system with the pipeline data center as the origin. Subsequently, the same operations of coordinate preprocessing and spatial index establishment in pipeline modeling are performed on the pipeline data where the pipe point is located to obtain the corresponding spatial index structure, including establishing a pipeline R-tree spatial index based on the pipeline data where the pipe point coordinates are located, and then traversing the pipe point data after coordinate conversion, and according to the pipeline R-tree spatial index, retrieving the connection coordinates adjacent to the pipe point in the relevant pipeline for subsequent pipe point pre-connection processing. Finally, the pipe point data structure required for modeling is obtained. Based on this, the efficiency of subsequent modeling is improved.
[0180] The present application provides a three-dimensional model generation device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method of generating a three-dimensional model based on pipeline network vector data in the above-mentioned first embodiment.
[0181] Reference below Figure 13 , which shows a schematic diagram of the structure of a 3D model generation device suitable for implementing embodiments of the present application. The 3D model generation device in the embodiments of the present application may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (PADs), portable multimedia players (PMPs), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 13The three-dimensional model generation device shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0182] like Figure 13 As shown, the 3D model generation device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1003 into a random access memory (RAM) 1004. The RAM 1004 also stores various programs and data required for the operation of the 3D model generation device. The processing device 1001, the ROM 1002, and the RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to the input / output interface 1006: input devices 1007 including, for example, a touch screen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1003 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication devices 1009 can allow the 3D model generation device to communicate with other devices wirelessly or wired to exchange data. Although the figure shows a 3D model generation device with various systems, it should be understood that implementation or presence of all the illustrated systems is not required. More or fewer systems may alternatively be implemented or present.
[0183] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a read-only memory 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are performed.
[0184] The 3D model generation device provided in this application utilizes the method for generating a 3D model from pipeline network vector data in the aforementioned embodiment, resolving the technical issue of seams in existing pipeline models. Compared to the prior art, the 3D model generation device provided in this application offers the same beneficial effects as the method for generating a 3D model from pipeline network vector data in the aforementioned embodiment. Other technical features of this 3D model generation device are the same as those disclosed in the aforementioned embodiment and are not further elaborated here.
[0185] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0186] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0187] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, and the computer-readable program instructions are used to execute the method of generating a three-dimensional model based on pipeline network vector data in the above embodiment.
[0188] The computer-readable storage medium provided herein may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory, read-only memory, erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including, but not limited to, wires, optical cables, radio frequency (RF), etc., or any suitable combination thereof.
[0189] The computer-readable storage medium may be included in the three-dimensional model generation device; or it may exist independently without being assembled into the three-dimensional model generation device.
[0190] The computer-readable storage medium carries one or more programs, which, when executed by a three-dimensional model generation device, cause the three-dimensional model generation device to: determine connection points and pipeline extension directions between three-dimensional pipeline models to be connected, wherein the three-dimensional pipeline models are generated based on pipeline data of pipeline network vector data;
[0191] Calculating a transformation matrix of a circular vertex located at the connection point and perpendicular to the extension direction of the pipeline;
[0192] updating the duplicated vertex of the outermost vertex of the three-dimensional pipeline model to be connected according to the transformation matrix to obtain a newly added vertex;
[0193] Constructing vertex indices of the newly added vertices, and rendering the three-dimensional pipeline model to be connected according to the vertex indices to obtain a target three-dimensional pipeline model.
[0194] Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0195] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, program segment or part of code, and the module, program segment or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, as well as the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or can be implemented using a combination of dedicated hardware and computer instructions.
[0196] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.
[0197] The computer-readable storage medium provided in this application stores computer-readable program instructions (i.e., a computer program) for executing the aforementioned method for generating a 3D model from pipeline network vector data. This computer-readable storage medium can address the technical issue of seams in existing pipeline models. Compared to the prior art, the computer-readable storage medium provided in this application offers the same beneficial effects as the method for generating a 3D model from pipeline network vector data provided in the aforementioned embodiment, and will not be further elaborated here.
[0198] The above description is only part of the embodiments of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for generating a three-dimensional model based on pipeline network vector data, characterized in that: The method for generating a three-dimensional model based on pipeline network vector data includes: Determining connection points and pipeline extension directions between three-dimensional pipeline models to be connected, wherein the three-dimensional pipeline models are generated based on pipeline data of pipeline network vector data; Based on the pipeline data coordinates of the current 3D pipeline model, determining a first direction vector corresponding to the pipeline extension direction and a second direction vector between the connection point position and the point to be extended, where the point to be extended is a coordinate point of the 3D pipeline model in one direction that indicates the direction of connection with other 3D pipeline models; normalizing the first direction vector and the second direction vector; Calculate the dot product and cross product results between the first direction vector and the second direction vector to obtain a rotation axis and a rotation angle, where the rotation angle is half of the angle between the first direction vector and the second direction vector; Constructing a transformation matrix of annular vertices perpendicular to the extension direction of the pipeline based on the rotation axis and the rotation angle; updating the duplicated vertex of the outermost vertex of the three-dimensional pipeline model to be connected according to the transformation matrix to obtain a newly added vertex; Constructing a vertex index of the newly added vertex, and rendering the three-dimensional pipeline model to be connected according to the vertex index to obtain a target three-dimensional pipeline model; performing pre-connection processing on the pipe point data of the pipe network vector data to discard abnormal pipe point data; Obtaining the standard model and configuration parameters corresponding to the pipe point data in a standard pipe point model library, and calculating the standard conversion matrix corresponding to the pipe point data and the configuration parameters; The standard model is transformed by superposition according to the standard transformation matrix to obtain a pipe point model; The target three-dimensional pipeline model and the pipe point model are synthesized to obtain a three-dimensional pipeline model.
2. The method for generating a three-dimensional model based on pipeline network vector data according to claim 1, wherein: The step of determining the connection points and pipeline extension directions between the three-dimensional pipeline models to be connected, wherein the three-dimensional pipeline models are generated based on the pipeline data of the pipeline network vector data, comprises: Determine the R-tree spatial index of the current pipeline model to be connected; Based on the R-tree spatial index, the coordinates of the points to be extended between the current pipeline model and the next pipeline model are retrieved to obtain the points to be extended, wherein the pipeline models whose front and rear endpoints are within a threshold distance from the endpoint of the current pipeline model are candidate pipeline models, the endpoint of the current pipeline model is the connection point, and the vertices of the candidate pipeline model adjacent to the connection point are the points to be extended; The pipeline extension direction is determined according to the guiding direction of the to-be-extended point.
3. The method for generating a three-dimensional model based on pipeline network vector data according to claim 2, wherein: After the step of retrieving the coordinates of the to-be-extended point between the current pipeline model and the next pipeline model based on the R-tree spatial index to obtain the to-be-extended point, the method of generating a three-dimensional model based on the pipeline network vector data further includes: If there are multiple to-be-extended points to be selected for the next pipeline model, determining the pipeline model with the smallest difference in pipeline end direction from the current pipeline model as the next pipeline model; After the next pipeline model is determined, the pipeline extension direction is calculated according to the pipeline end direction of the current pipeline model and the pipeline start direction of the next pipeline model.
4. The method for generating a three-dimensional model based on pipeline network vector data according to claim 2, wherein: Before the step of determining the connection points and pipeline extension directions between the three-dimensional pipeline models to be connected, and generating the three-dimensional pipeline model based on the pipeline data of the pipeline network vector data, the method of generating the three-dimensional model based on the pipeline network vector data includes: Determine the pipeline coordinates corresponding to the pipeline data, and offset the pipeline coordinates in the plane projection coordinate system to a model coordinate system with the pipeline data center as the origin; Converting pipeline coordinates at other longitudes and latitudes into geocentric earth-fixed coordinates, and converting the geocentric earth-fixed coordinates into a model coordinate system with the pipeline data center as the origin; Taking each section of the pipeline as a node, establishing the R-tree spatial index; The pipeline data is traversed to determine the connection coordinates and the points to be extended corresponding to each section of the pipeline.
5. The method for generating a three-dimensional model based on pipeline network vector data according to claim 4, characterized in that: After the step of traversing the pipeline data and determining the connection coordinates and the points to be extended corresponding to each section of the pipeline, the method of generating a three-dimensional model based on the pipeline network vector data further includes: Traversing the pipeline data, constructing a curved local coordinate system for each section of the pipeline, and establishing model coordinate vertices of the curved local coordinate system; The vertex index of the triangulated network is established according to the generation order of the model coordinate vertices, and the three-dimensional pipeline model of each section of the pipeline is generated based on the vertex index.
6. The method for generating a three-dimensional model based on pipeline network vector data according to claim 1, wherein: Before the step of pre-connecting the pipe point data of the pipe network vector data to discard abnormal pipe point data, the method of generating a three-dimensional model based on the pipe network vector data further includes: Constructing the standard pipe point model library corresponding to the pipe point data; Determine the pipe point coordinates corresponding to the pipe point data, and offset the pipe point coordinates in the plane projection coordinate system to the model coordinate system with the pipeline data center as the origin; The coordinates of the pipe points at other longitudes and latitudes are converted into geocentric earth-fixed coordinates, and coordinate transformation is performed to convert the geocentric earth-fixed coordinate system into a model coordinate system with the pipeline data center as the origin; Establishing a pipeline R-tree spatial index according to the pipeline data where the pipeline point coordinates are located; The pipeline point data after coordinate conversion is traversed, and the pipeline coordinates adjacent to the pipeline point in the connected pipelines are retrieved according to the pipeline R-tree spatial index.
Citation Information
Patent Citations
Constructing method for three-dimensional pipeline model connecting piece model
CN106469466A
A three-dimensional model automatic construction method of a drainage pipe network
CN113190937A