A three-dimensional modeling method, system and device based on GIM data
By analyzing GIM files and applying octree and kd tree algorithms, the problem of insufficient coordinate accuracy in GIM data is solved, and the topology problem of model topology caused by insufficient coordinate accuracy in GIM data is improved, and the accuracy and efficiency of three-dimensional modeling are improved.
Patent Information
- Application Number
- CN202410914351.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2044-07-09
AI Technical Summary
There is a problem of insufficient coordinate accuracy in GIM data, which leads to serious errors in the model topology, affecting the aesthetics of the model and parsing speed.
By analyzing GIM files, filtering MOD files and pose matrix information, performing coordinate conversion, and using octree and kd tree algorithms to merge point information and precisely connect line information to establish a three-dimensional grid model of the entity.
It effectively eliminates the impact of insufficient coordinate accuracy on three-dimensional modeling, improves data processing efficiency and parsing speed, and enhances the accuracy and stability of the model.
Smart Images

Figure CN118887333B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of GIM data processing, and in particular to a three-dimensional modeling method, system and equipment based on GIM data. Background Art
[0002] The Grid Information Model (GIM) is widely used in the power industry. It is a data model used to describe and manage power system information. It can represent information such as various equipment, lines, topologies and operating status in the power grid to support the planning, design, operation and management of the power system.
[0003] However, it is inevitable that the files provided by GIM are affected by the accuracy of acquisition and the loss of accuracy during projection transformation, and there are problems with the accuracy of point coordinates, resulting in a large number of coordinate points that should have coincided being offset. This offset causes serious errors in the model topology, which not only affects the aesthetics of the model, but also reduces the parsing speed of the GIM model and the accuracy of 3D modeling due to the redundant node information. Summary of the invention
[0004] The present invention provides a 3D modeling method, system and device based on GIM data, which can transform the complex data relationship in GIM into a clear and orderly data structure, and effectively eliminate the influence of insufficient coordinate precision on the accuracy of entity 3D modeling through data lightweighting. By streamlining redundant data node information, data processing efficiency and parsing speed are improved, and the accuracy and stability of 3D modeling are further improved, ensuring the reliability of the model in various engineering applications.
[0005] In order to solve the above technical problems, an embodiment of the present invention provides a three-dimensional modeling method based on GIM data, comprising:
[0006] Parse the GIM file to obtain the reference relationship between files at different levels of the GIM file as the level information;
[0007] Filtering the MOD file and the pose matrix information from the hierarchical information, and performing coordinate transformation on the MOD file according to the pose matrix information;
[0008] Read the MOD file after coordinate conversion to obtain first point information and first line information;
[0009] The octree and kd tree algorithms are used to combine the first point information to obtain the second point information;
[0010] Combining the second point information with the first line information, accurately connecting the line segments, and obtaining the second line information;
[0011] A three-dimensional mesh model of the entity is established according to the second line information.
[0012] As an improvement of the above solution, the GIM file is parsed to obtain the reference relationship between files at various levels of the GIM file as the level information, including:
[0013] Parse the GIM file, and obtain reference relationships among files at the CBM level, the DEV level, the PHM level, and the MOD level from the GIM file; the reference relationships include same-level reference relationships and nested reference relationships;
[0014] A B-tree data structure is constructed according to the reference relationship as hierarchical information.
[0015] As an improvement of the above solution, the step of filtering the MOD file and the pose matrix information from the hierarchical information and performing coordinate transformation on the MOD file according to the pose matrix information includes:
[0016] Filtering the files at the MOD level from the level information as the MOD files;
[0017] Extracting homogeneous transformation matrices in files of each level from the level information as pose matrix information;
[0018] For each node in the MOD hierarchy, according to the hierarchy information, query the file of the previous level of the current level file through the index until the file of the highest level is queried;
[0019] After the query at any level is completed, the MOD file is converted into coordinates according to the pose matrix information.
[0020] As an improvement of the above solution, the step of reading the MOD file after coordinate conversion to obtain the first point information and the first line information includes:
[0021] Read the MOD file after coordinate conversion line by line;
[0022] The identified row beginning with "P" is used as the first point information, and the point coordinates in the first point information are converted into a vector form;
[0023] The identified line beginning with "R" is used as the first line of information.
[0024] As an improvement of the above solution, the octree and kd tree algorithms are comprehensively used to merge the first point information to obtain the second point information, including:
[0025] According to the first point information, obtain the three-dimensional space range corresponding to all the first point information, and construct an octree, where the three-dimensional space range is the root node of the octree;
[0026] Starting from the root node, determine the current node, and recursively split the current node into eight leaf nodes according to the average value of the first point information in the current node, until the number of first point information in the current node is less than a preset number threshold or reaches a preset first segmentation depth threshold, to obtain a depth leaf set;
[0027] Constructing a kd tree according to the depth leaf set, and recursively performing binary segmentation on the depth leaf set in the multi-dimensional space until a preset second segmentation depth threshold is reached;
[0028] Perform a nearest neighbor search on each node of the segmented kd tree, merge the nodes whose nearest neighbor search distance is less than a preset distance threshold, and obtain the second point information.
[0029] As an improvement of the above solution, the combining the second point information and the first line information, accurately connecting the line segments, and obtaining the second line information includes:
[0030] Read the starting point ID and the ending point ID of the line from the first line information;
[0031] Retrieving the coordinates and line width information of the target point corresponding to the starting point ID and the end point ID in the second point information;
[0032] The first line information is updated according to the point coordinates and the line width information as second line information.
[0033] As an improvement of the above solution, the step of retrieving the coordinates and line width information of the target point corresponding to the starting point ID and the end point ID in the second point information includes:
[0034] Determine the coordinate information of the corresponding candidate point according to the starting point ID and the end point ID;
[0035] Matching the coordinate information of the candidate point with the coordinate information of each point in the merged point set of the second point information, and when the match is successful, taking the point in the second point information corresponding to the coordinate information of the candidate point as the target point corresponding to the starting point ID and the end point ID;
[0036] The coordinates and line width information of the target point are obtained by filtering from the second point information.
[0037] As an improvement of the above solution, establishing a three-dimensional mesh model of the entity according to the second line information includes:
[0038] Creating a continuous surface object according to the second line information;
[0039] A three-dimensional mesh model of a solid is established according to the surface object.
[0040] The embodiment of the present invention further provides a three-dimensional modeling system based on GIM data, comprising:
[0041] A hierarchical information acquisition module, used to parse the GIM file and obtain the reference relationship between files at each level of the GIM file as hierarchical information;
[0042] A file screening module, used for screening the MOD file and the pose matrix information from the hierarchical information, and performing coordinate transformation on the MOD file according to the pose matrix information;
[0043] An information acquisition module, used for reading the MOD file after coordinate conversion, and obtaining first point information and first line information;
[0044] A point merging module, used to combine the first point information by using an octree and a kd tree algorithm to obtain second point information;
[0045] A line information updating module, used for combining the second point information and the first line information, accurately connecting line segments, and obtaining second line information;
[0046] A modeling module is used to establish a three-dimensional mesh model of the entity according to the second line information.
[0047] As an improvement of the above solution, the hierarchical information acquisition module is specifically used for:
[0048] Parse the GIM file, and obtain reference relationships among files at the CBM level, the DEV level, the PHM level, and the MOD level from the GIM file; the reference relationships include same-level reference relationships and nested reference relationships;
[0049] A B-tree data structure is constructed according to the reference relationship as hierarchical information.
[0050] As an improvement of the above solution, the file screening module is specifically used for:
[0051] Filtering the files at the MOD level from the level information as the MOD files;
[0052] Extracting homogeneous transformation matrices in files of each level from the level information as pose matrix information;
[0053] For each node in the MOD hierarchy, according to the hierarchy information, query the file of the previous level of the current level file through the index until the file of the highest level is queried;
[0054] After the query at any level is completed, the MOD file is converted into coordinates according to the pose matrix information.
[0055] As an improvement of the above solution, the information acquisition module is specifically used for:
[0056] Read the MOD file after coordinate conversion line by line;
[0057] The identified row beginning with "P" is used as the first point information, and the point coordinates in the first point information are converted into a vector form;
[0058] The identified line beginning with "R" is used as the first line of information.
[0059] As an improvement of the above solution, the point merging module is specifically used for:
[0060] According to the first point information, obtain the three-dimensional space range corresponding to all the first point information, and construct an octree, where the three-dimensional space range is the root node of the octree;
[0061] Starting from the root node, determine the current node, and recursively split the current node into eight leaf nodes according to the average value of the first point information in the current node, until the number of first point information in the current node is less than a preset number threshold or reaches a preset first segmentation depth threshold, to obtain a depth leaf set;
[0062] Constructing a kd tree according to the depth leaf set, and recursively performing binary segmentation on the depth leaf set in the multi-dimensional space until a preset second segmentation depth threshold is reached;
[0063] Perform a nearest neighbor search on each node of the segmented kd tree, merge the nodes whose nearest neighbor search distance is less than a preset distance threshold, and obtain the second point information.
[0064] As an improvement of the above solution, the line information updating module is specifically used for:
[0065] Read the starting point ID and the ending point ID of the line from the first line information;
[0066] Retrieving the coordinates and line width information of the target point corresponding to the starting point ID and the end point ID in the second point information;
[0067] The first line information is updated according to the point coordinates and the line width information as second line information.
[0068] As an improvement of the above solution, the step of retrieving the coordinates and line width information of the target point corresponding to the starting point ID and the end point ID in the second point information includes:
[0069] Determine the coordinate information of the corresponding candidate point according to the starting point ID and the end point ID;
[0070] Matching the coordinate information of the candidate point with the coordinate information of each point in the merged point set of the second point information, and when the match is successful, taking the point in the second point information corresponding to the coordinate information of the candidate point as the target point corresponding to the starting point ID and the end point ID;
[0071] The coordinates and line width information of the target point are obtained by filtering from the second point information.
[0072] As an improvement of the above solution, the modeling module is specifically used for:
[0073] Creating a continuous surface object according to the second line information;
[0074] A three-dimensional mesh model of a solid is established according to the surface object.
[0075] An embodiment of the present invention also provides a three-dimensional modeling device based on GIM data, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, it implements a three-dimensional modeling method based on GIM data as described in any one of the above.
[0076] Compared with the prior art, the present invention discloses a three-dimensional modeling method, system and device based on GIM data, which parses the GIM file to obtain the reference relationship between the files at each level of the GIM file as the level information; selects the MOD file and the pose matrix information from the level information, and performs coordinate transformation on the MOD file according to the pose matrix information; reads the MOD file after the coordinate transformation to obtain the first point information and the first line information; adopts the octree and kd tree algorithms to merge the first point information to obtain the second point information; combines the second point information and the first line information, accurately connects the line segments to obtain the second line information; and establishes the three-dimensional mesh model of the entity according to the second line information. By adopting the embodiments of the present invention, the complex data relationship in the GIM can be converted into a clear and orderly data structure, and the influence of insufficient coordinate precision on the accuracy of three-dimensional modeling of the substation can be effectively eliminated. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 It is a schematic diagram of the steps of a three-dimensional modeling method based on GIM data provided by an embodiment of the present invention;
[0078] Figure 2 is a schematic diagram of a hierarchical structure of a GIM file provided by an embodiment of the present invention;
[0079] Figure 3 It is a structural schematic diagram of a three-dimensional modeling system based on GIM data provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0080] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0081] In the description of the specification and claims, it is to be understood that the terms first, second, etc. in the specification and claims are only used for the purpose of describing the same technical features, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated, nor necessarily describing the order or time sequence. The terms are interchangeable where appropriate. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features.
[0082] GIM provides a data model with rich hierarchical information, which makes it easier for relevant personnel in the power system to share and understand the information of the power system, and helps to realize the intelligent, automated and efficient operation of the power system. When processing GIM data, it is necessary to ensure the integrity of the data and the accuracy of the model. Traditional analysis methods are difficult to handle large-scale and highly complex data, resulting in data loss or low analysis efficiency.
[0083] In addition, since GIM data comes from many sources, different accuracies and different projection transformation methods may be used during data collection, which will cause the coordinate points that should overlap to be offset, and further cause serious errors in the model topology, especially at the intersection of multiple lines of the tower group. Almost all the connections fail to accurately intersect at one point, which not only affects the aesthetics of the model, but also reduces the parsing speed of the model due to redundant node information.
[0084] Based on the above considerations, an embodiment of the present invention provides a schematic flow chart of the steps of a 3D modeling method based on GIM data. Figure 1 In this embodiment, the three-dimensional modeling method based on GIM data is specifically performed through steps S1 to S6:
[0085] S1. Parse the GIM file to obtain the reference relationship between files at different levels of the GIM file as level information.
[0086] Exemplarily, the classification of substations is subdivided into five levels according to their functions, partitions, and sizes. These levels are, from high to low, the F1-level system (top-level system) at the whole station level, the F2-level system (secondary subsystem) at the system / regional level, the F3-level system (third-level subsystem) at the subsystem / subregional level, the F4-level system at the equipment level, and the DEV system at the component level. In the storage process of GIM, starting from the starting file project.cbm, the first five levels of the CBM file are nested and called in sequence, from high to low. The F1-level system is not only associated with multiple IFC models, but also calls the DEV files under the F4-level system. DEV files can call DEV files of the same level or PHM files. Similarly, PHM files can call PHM files of the same level or MOD / STL files of the next level.
[0087] It should be noted that in the GIM file, the CBM file provides the model's building height, roof type, number of floors, house area, ownership and other information, which is mainly used for building and ownership management; the DEV attribute file provides the electrical properties of the equipment of the transmission line and defines the electrical characteristics of the equipment in the power system, such as voltage level, conductor model and number of conductor splits, etc., mechanical properties and descriptions of the physical characteristics and mechanical properties of the equipment, including equipment model, total length, winding type, etc., installation attributes and detailed information related to equipment installation and configuration, such as the model and material of the insulator, windage area, number of hanging points and wiring point information, etc.
[0088] S2. Filtering the MOD file and the pose matrix information from the hierarchical information, and performing coordinate transformation on the MOD file according to the pose matrix information.
[0089] It should be noted that the PHM file, CBM file and DEV file all provide pose matrix information, which is used to describe the position and posture of the object in three-dimensional space and can be used to determine the absolute spatial position of the reconstructed model in the MOD level. The hierarchical information obtained in the above steps can improve the efficiency and accuracy of the modeling work at the MOD level.
[0090] S3. Read the MOD file after coordinate conversion to obtain first point information and first line information.
[0091] It is understandable that in order to convert text-based primitives into 3D models, it is necessary to deeply understand the unique geometric properties of each primitive. In the embodiment of the present invention, by extracting point information and line information of the model, the geometric properties of the primitives are depicted, and an accurate 3D model is further established.
[0092] S4. Combining the first point information by using the octree and kd tree algorithms to obtain the second point information.
[0093] It is understandable that there may be many reasons for the problem of coordinate accuracy in the GIM model file, such as the use of different coordinate systems, and the loss of coordinate accuracy when performing projection transformation in the same coordinate system; and the difference in the accuracy of the measurement equipment or technology used in the process of multiple data collection. Therefore, the problem of coordinate accuracy is almost an inevitable problem in GIM data, and further causes a large number of coordinate points that should have overlapped to be offset. The embodiment of the present invention combines the first point information by comprehensively adopting the octree and kd tree algorithms, which can avoid the problem of the inability of the wiring to intersect due to the offset of the coordinate points in the subsequent process of establishing a three-dimensional model.
[0094] S5. Combine the second point information and the first line information, accurately connect the line segments, and obtain second line information.
[0095] Line information plays an important role in the modeling process. If the line segment connection of the line information is not accurate enough, it will have a negative impact on the accuracy and aesthetics of the model, which is not conducive to the analysis of the planning, design, operation and management of the power system. In the embodiment of the present invention, the second point information is the merged point information, which eliminates the offset problem of the coordinate point. After further combining the second point information with the first line information, the line information can be updated.
[0096] S6. Establishing a three-dimensional mesh model of the entity according to the second line information.
[0097] In the above scheme, by parsing the GIM file and obtaining the hierarchical information, the complex data relationship in the GIM can be converted into a clear and orderly data structure; by identifying the geometric characteristics of the primitives in the MOD file and performing spatial segmentation and preliminary merging through the octree algorithm, the amount of point cloud data can be significantly reduced, and then the kd tree algorithm is used for refined merging to further improve the accuracy and density of the point cloud data; a three-dimensional grid model is established based on the second point information and second line information obtained, which can achieve accurate connection of the line segments involved in point correction in parametric modeling, effectively correct the topological errors in the graphics, and improve the accuracy of the merging results.
[0098] As a preferred implementation, step S1, parsing the GIM file, obtaining the reference relationship between files at each level of the GIM file as the level information, specifically:
[0099] Parse the GIM file, and obtain reference relationships among files at the CBM level, the DEV level, the PHM level, and the MOD level from the GIM file; the reference relationships include same-level reference relationships and nested reference relationships;
[0100] A B-tree data structure is constructed according to the reference relationship as hierarchical information.
[0101] See also Figure 2 In some embodiments, the GIM file has four levels, namely, CBM level, DEV level, PHM level and MOD level, and each level has its corresponding files. For the CBM level, DEV level and PHM level, it can not only call files of the next level, but also call files of the same level. In the process of parsing the GIM file, a depth-first traversal algorithm is adopted to comprehensively and systematically traverse each data node in the GIM file, and in the traversal process, determine the level to which the data node belongs and the reference relationship with other files. In addition, each level of file is equipped with a property file (FAM file) for storing its specific attribute content, so the level of the data node can be further determined and verified according to the property file.
[0102] It should be noted that B-tree is a self-balancing tree, commonly used in the index structure of databases and file systems. It can keep data stable and orderly, and its insertion and modification have a relatively average complexity. In the embodiment of the present invention, the hierarchical information of the GIM model is stored using the B-tree data structure, which can ensure the integrity and orderliness of the data.
[0103] In some embodiments, after step S1, the integrity and accuracy of the parsing is also verified based on the hierarchical information. Since the reference relationship between the various levels of the GIM file is foreseeable, illustratively, a rule-based method is used to determine whether the reference relationship of the constructed B-tree meets the preset reference relationship. If so, the integrity and accuracy verification passes; otherwise, it fails.
[0104] As a preferred implementation, step S2, filtering the MOD file and the pose matrix information from the hierarchical information, and performing coordinate transformation on the MOD file according to the pose matrix information, is specifically as follows:
[0105] Filtering the files at the MOD level from the level information as the MOD files;
[0106] Extracting homogeneous transformation matrices in files of each level from the level information as pose matrix information;
[0107] For each node in the MOD hierarchy, according to the hierarchy information, query the file of the previous level of the current level file through the index until the file of the highest level is queried;
[0108] After the query at any level is completed, the MOD file is converted into coordinates according to the pose matrix information.
[0109] In the above scheme, according to the hierarchical information, it is possible to build a parent-child tree between files of each level from the bottom up starting from the MOD level. The MOD level finds the parent-child tree relationship of the previous level through the index and uses the corresponding matrix for coordinate conversion. The whole process is performed recursively until the coordinate conversion operation with the parent-child tree of the highest level is completed.
[0110] Preferably, step S3, reading the MOD file after coordinate conversion to obtain the first point information and the first line information, is specifically:
[0111] Read the MOD file after coordinate conversion line by line;
[0112] The identified row beginning with "P" is used as the first point information, and the point coordinates in the first point information are converted into a vector form;
[0113] The identified line beginning with "R" is used as the first line of information.
[0114] In some embodiments, the coordinates of the first point information are converted into numpy. By converting the first point information coordinates into numpy, the advantages of converting the information coordinates into numpy arrays in terms of memory are mainly reflected in memory efficiency and computational efficiency. Numpy arrays optimize the use of memory space in a continuous storage manner. Compared with ordinary Python lists, less memory can be used to store the same amount of data, so as to achieve the purpose of simplifying data.
[0115] It should be noted that by converting the point coordinates of the first point information into vector form, a large amount of point coordinate data can be processed quickly and accurately, avoiding the tedious process of processing data elements one by one, thereby greatly improving the calculation speed and providing strong support for subsequent point merging and model optimization.
[0116] In a preferred implementation, step S4, combining the octree and kd tree algorithms to merge the first point information to obtain the second point information, specifically:
[0117] According to the first point information, obtain the three-dimensional space range corresponding to all the first point information, and construct an octree, where the three-dimensional space range is the root node of the octree;
[0118] Starting from the root node, determine the current node, and recursively split the current node into eight leaf nodes according to the average value of the first point information in the current node, until the number of first point information in the current node is less than a preset number threshold or reaches a preset first segmentation depth threshold, to obtain a depth leaf set;
[0119] Constructing a kd tree according to the depth leaf set, and recursively performing binary segmentation on the depth leaf set in the multi-dimensional space until a preset second segmentation depth threshold is reached;
[0120] Perform a nearest neighbor search on each node of the segmented kd tree, merge the nodes whose nearest neighbor search distance is less than a preset distance threshold, and obtain the second point information.
[0121] It should be noted that, in order to facilitate the subsequent update of line information, the second point information includes the information of each point in the merged point set, but it is understandable that it is not necessary to store all the information of each point, and only part of the information that can be used to identify the point can be stored, such as ID and / or point coordinates.
[0122] In the above scheme, the first point information is optimized by using the octree algorithm, and spatial segmentation and preliminary merging are performed, which can significantly reduce the amount of data of the first point; and the kd tree algorithm is then used for refined merging to further improve the accuracy and density of the point cloud data. The embodiment of the present invention can effectively eliminate the influence of insufficient coordinate accuracy on the accuracy of substation three-dimensional modeling, improve the accuracy of the merging result, and the second point information finally obtained further simplifies the data.
[0123] Preferably, step S5, combining the second point information and the first line information, accurately connecting the line segments to obtain the second line information, includes:
[0124] Read the starting point ID and the ending point ID of the line from the first line information;
[0125] Retrieving the coordinates and line width information of the target point corresponding to the starting point ID and the end point ID in the second point information;
[0126] The first line information is updated according to the point coordinates and the line width information as second line information.
[0127] Furthermore, preferably, the retrieving the coordinates and line width information of the target point corresponding to the starting point ID and the end point ID in the second point information includes:
[0128] Determine the coordinate information of the corresponding candidate point according to the starting point ID and the end point ID;
[0129] Matching the coordinate information of the candidate point with the coordinate information of each point in the merged point set of the second point information, and when the match is successful, taking the point in the second point information corresponding to the coordinate information of the candidate point as the target point corresponding to the starting point ID and the end point ID;
[0130] The coordinates and line width information of the target point are obtained by filtering from the second point information.
[0131] In the above scheme, since the starting point and the end point in the first line information correspond to the first point information, but the first point information is not accurate enough and is therefore merged, the coordinate position of the second point information obtained after merging may be different from any point in its merged point set. If the target point corresponding to the starting point ID and the end point ID is directly retrieved in the second point information, a search error may occur. By adopting the embodiment of the present invention, the accurate connection of the line segments involved in the midpoint correction in parameter modeling is achieved, the topological error in the figure is effectively corrected, and the accuracy of the merged result is improved.
[0132] As a preferred implementation, establishing a three-dimensional mesh model of the entity according to the second line information includes:
[0133] Creating a continuous surface object according to the second line information;
[0134] A three-dimensional mesh model of a solid is established according to the surface object.
[0135] In the above solution, by using line segments to create surface objects, the merged points and lines are successfully converted into continuous, visual surfaces, which clearly shows the structure and details of the model and provides higher accuracy and richer expression for the visualization of the model.
[0136] A three-dimensional modeling method based on GIM data provided by an embodiment of the present invention can convert complex data relationships in GIM into clear and orderly data structures by parsing GIM files and obtaining hierarchical information; by identifying the geometric characteristics of primitives in MOD files and merging adjacent points, a three-dimensional grid model is established according to the obtained second point information and second line information, which can achieve accurate connection of line segments involved in point correction in parameter modeling, effectively correct topological errors in graphics, improve the accuracy of merging results, and effectively eliminate the influence of insufficient coordinate accuracy on the accuracy of three-dimensional modeling of substations.
[0137] See also Figure 3 , an embodiment of the present invention provides a schematic diagram of the structure of a three-dimensional modeling system based on GIM data. The three-dimensional modeling system based on GIM data includes a hierarchical information acquisition module 11, a file screening module 12, an information acquisition module 13, a point merging module 14, a line information updating module 15 and a modeling module 16, wherein:
[0138] A hierarchical information acquisition module 11 is used to parse the GIM file and obtain the reference relationship between files at different levels of the GIM file as hierarchical information;
[0139] A file screening module 12, used for screening the MOD file and the pose matrix information from the hierarchical information, and performing coordinate transformation on the MOD file according to the pose matrix information;
[0140] An information acquisition module 13 is used to read the MOD file after coordinate conversion to obtain first point information and first line information;
[0141] A point merging module 14 is used to combine the first point information by using an octree and a kd tree algorithm to obtain second point information;
[0142] A line information updating module 15 is used to combine the second point information and the first line information, accurately connect the line segments, and obtain second line information;
[0143] The modeling module 16 is used to establish a three-dimensional mesh model of the entity according to the second line information.
[0144] As a preferred implementation, the hierarchical information acquisition module 11 is specifically used for:
[0145] Parse the GIM file, and obtain reference relationships among files at the CBM level, the DEV level, the PHM level, and the MOD level from the GIM file; the reference relationships include same-level reference relationships and nested reference relationships;
[0146] A B-tree data structure is constructed according to the reference relationship as hierarchical information.
[0147] As a preferred implementation, the file screening module 12 is specifically used for:
[0148] Filtering the files at the MOD level from the level information as the MOD files;
[0149] Extracting homogeneous transformation matrices in files of each level from the level information as pose matrix information;
[0150] For each node in the MOD hierarchy, according to the hierarchy information, query the file of the previous level of the current level file through the index until the file of the highest level is queried;
[0151] After the query at any level is completed, the MOD file is converted into coordinates according to the pose matrix information.
[0152] As a preferred implementation, the information acquisition module 13 is specifically used for:
[0153] Read the MOD file after coordinate conversion line by line;
[0154] The identified row beginning with "P" is used as the first point information, and the point coordinates in the first point information are converted into a vector form;
[0155] The identified line beginning with "R" is used as the first line of information.
[0156] As a preferred implementation, the point merging module 14 is specifically used for:
[0157] According to the first point information, obtain the three-dimensional space range corresponding to all the first point information, and construct an octree, where the three-dimensional space range is the root node of the octree;
[0158] Starting from the root node, determine the current node, and recursively split the current node into eight leaf nodes according to the average value of the first point information in the current node, until the number of first point information in the current node is less than a preset number threshold or reaches a preset first segmentation depth threshold, to obtain a depth leaf set;
[0159] Constructing a kd tree according to the depth leaf set, and recursively performing binary segmentation on the depth leaf set in the multi-dimensional space until a preset second segmentation depth threshold is reached;
[0160] Perform a nearest neighbor search on each node of the segmented kd tree, merge the nodes whose nearest neighbor search distance is less than a preset distance threshold, and obtain the second point information.
[0161] As a preferred implementation, the line information updating module 15 is specifically used for:
[0162] Read the starting point ID and the ending point ID of the line from the first line information;
[0163] Retrieving the coordinates and line width information of the target point corresponding to the starting point ID and the end point ID in the second point information;
[0164] The first line information is updated according to the point coordinates and the line width information as second line information.
[0165] Further, preferably, the retrieving the coordinates and line width information of the target point corresponding to the starting point ID and the end point ID in the second point information includes:
[0166] Determine the coordinate information of the corresponding candidate point according to the starting point ID and the end point ID;
[0167] Matching the coordinate information of the candidate point with the coordinate information of each point in the merged point set of the second point information, and when the match is successful, taking the point in the second point information corresponding to the coordinate information of the candidate point as the target point corresponding to the starting point ID and the end point ID;
[0168] The coordinates and line width information of the target point are obtained by filtering from the second point information.
[0169] As a preferred implementation, the modeling module 16 is specifically used for:
[0170] Creating a continuous surface object according to the second line information;
[0171] A three-dimensional mesh model of a solid is established according to the surface object.
[0172] A 3D modeling system based on GIM data provided by an embodiment of the present invention can convert complex data relationships in GIM into clear and orderly data structures by parsing GIM files and obtaining hierarchical information; the amount of point cloud data can be significantly reduced by identifying the geometric characteristics of primitives in MOD files and performing spatial segmentation and preliminary merging through an octree algorithm; the kd-tree algorithm is then used for refined merging to further improve the accuracy and density of point cloud data, and a 3D grid model is established based on the obtained second point information and second line information, which can achieve accurate connection of line segments involved in point correction in parameter modeling, effectively correct topological errors in graphics, improve the accuracy of merging results, and effectively eliminate the influence of insufficient coordinate accuracy on the accuracy of 3D modeling of substations.
[0173] An embodiment of the present invention also provides a three-dimensional modeling device based on GIM data, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, a three-dimensional modeling method based on GIM data as described above is implemented. The working principles and beneficial effects of the two correspond one to one, and thus will not be elaborated upon.
[0174] The present invention may take the form of a computer program product implemented on one or more storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing program code. Computer-readable storage media include permanent and non-permanent, removable and non-removable media, and information storage can be achieved by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include but are not limited to: phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, read-only compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device.
[0175] It should be understood that the embodiments of the present application are not limited to the precise structures described above and shown in the drawings, and various modifications and changes can be made without departing from the scope thereof. The scope of the embodiments of the present application is limited only by the appended claims.
[0176] The above-mentioned embodiments only express several implementation methods of the embodiments of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the embodiments of the present application, and these all belong to the protection scope of the embodiments of the present application.
Claims
1. A three-dimensional modeling method based on GIM data, characterized in that: include: Parse the GIM file to obtain the reference relationship between files at different levels of the GIM file as the level information; Filtering the MOD file and the pose matrix information from the hierarchical information, and performing coordinate transformation on the MOD file according to the pose matrix information; Read the MOD file after coordinate conversion to obtain first point information and first line information; The octree and kd tree algorithms are used to combine the first point information to obtain the second point information; Combining the second point information with the first line information, accurately connecting the line segments, and obtaining the second line information; According to the second line information, a three-dimensional mesh model of the entity is established; The comprehensive use of the octree and kd tree algorithms to merge the first point information to obtain the second point information includes: According to the first point information, obtain the three-dimensional space range corresponding to all the first point information, and construct an octree, where the three-dimensional space range is the root node of the octree; Starting from the root node, determine the current node, and recursively split the current node into eight leaf nodes according to the average value of the first point information in the current node, until the number of first point information in the current node is less than a preset number threshold or reaches a preset first segmentation depth threshold, to obtain a depth leaf set; Constructing a kd tree according to the depth leaf set, and recursively performing binary segmentation on the depth leaf set in the multi-dimensional space until a preset second segmentation depth threshold is reached; Perform a nearest neighbor search on each node of the segmented kd tree, merge the nodes whose nearest neighbor search distance is less than a preset distance threshold, and obtain the second point information.
2. A three-dimensional modeling method based on GIM data as claimed in claim 1, characterized in that: The parsing of the GIM file to obtain the reference relationship between files at each level of the GIM file as the level information includes: Parse the GIM file, and obtain reference relationships among files at the CBM level, the DEV level, the PHM level, and the MOD level from the GIM file; the reference relationships include same-level reference relationships and nested reference relationships; A B-tree data structure is constructed according to the reference relationship as hierarchical information.
3. A three-dimensional modeling method based on GIM data as claimed in claim 1, characterized in that: The step of obtaining the MOD file and the pose matrix information by screening the hierarchical information, and performing coordinate transformation on the MOD file according to the pose matrix information includes: Filtering the files at the MOD level from the level information as the MOD files; Extracting homogeneous transformation matrices in files of each level from the level information as pose matrix information; For each node in the MOD hierarchy, according to the hierarchy information, query the file of the previous level of the current level file through the index until the file of the highest level is queried; After the query at any level is completed, the MOD file is converted into coordinates according to the pose matrix information.
4. A three-dimensional modeling method based on GIM data as claimed in claim 1, characterized in that: The step of reading the MOD file after coordinate conversion to obtain first point information and first line information includes: Read the MOD file after coordinate conversion line by line; The identified row beginning with "P" is used as the first point information, and the point coordinates in the first point information are converted into a vector form; The identified line beginning with "R" is used as the first line of information.
5. A three-dimensional modeling method based on GIM data as claimed in claim 1, characterized in that: The combining the second point information and the first line information, accurately connecting the line segments, and obtaining the second line information includes: Read the starting point ID and the ending point ID of the line from the first line information; Retrieving the coordinates and line width information of the target point corresponding to the starting point ID and the end point ID in the second point information; The first line information is updated according to the coordinates of the target point and the line width information as the second line information.
6. A three-dimensional modeling method based on GIM data as claimed in claim 5, characterized in that: The retrieving the coordinates and line width information of the target point corresponding to the starting point ID and the end point ID in the second point information includes: Determine the coordinate information of the corresponding candidate point according to the starting point ID and the end point ID; Matching the coordinate information of the candidate point with the coordinate information of each point in the merged point set of the second point information, and when the match is successful, taking the point in the second point information corresponding to the coordinate information of the candidate point as the target point corresponding to the starting point ID and the end point ID; The coordinates and line width information of the target point are obtained by filtering from the second point information.
7. A three-dimensional modeling method based on GIM data as claimed in claim 1, characterized in that: The step of establishing a three-dimensional mesh model of the entity according to the second line information comprises: Creating a continuous surface object according to the second line information; A three-dimensional mesh model of a solid is established according to the surface object.
8. A three-dimensional modeling system based on GIM data, characterized in that: include: A hierarchical information acquisition module, used to parse the GIM file and obtain the reference relationship between files at each level of the GIM file as hierarchical information; A file screening module, used for screening the MOD file and the pose matrix information from the hierarchical information, and performing coordinate transformation on the MOD file according to the pose matrix information; An information acquisition module, used for reading the MOD file after coordinate conversion, and obtaining first point information and first line information; A point merging module, used to combine the first point information by using an octree and a kd tree algorithm to obtain second point information; A line information updating module, used for combining the second point information and the first line information, accurately connecting line segments, and obtaining second line information; A modeling module, used for establishing a three-dimensional mesh model of the entity according to the second line information; The point merging module is specifically used for: According to the first point information, obtain the three-dimensional space range corresponding to all the first point information, and construct an octree, where the three-dimensional space range is the root node of the octree; Starting from the root node, determine the current node, and recursively split the current node into eight leaf nodes according to the average value of the first point information in the current node, until the number of first point information in the current node is less than a preset number threshold or reaches a preset first segmentation depth threshold, to obtain a depth leaf set; Constructing a kd tree according to the depth leaf set, and recursively performing binary segmentation on the depth leaf set in the multi-dimensional space until a preset second segmentation depth threshold is reached; Perform a nearest neighbor search on each node of the segmented kd tree, merge the nodes whose nearest neighbor search distance is less than a preset distance threshold, and obtain the second point information.
9. A three-dimensional modeling system based on GIM data as claimed in claim 8, characterized in that: The hierarchical information acquisition module is specifically used for: Parse the GIM file, and obtain reference relationships among files at the CBM level, the DEV level, the PHM level, and the MOD level from the GIM file; the reference relationships include same-level reference relationships and nested reference relationships; A B-tree data structure is constructed according to the reference relationship as hierarchical information.
10. A three-dimensional modeling system based on GIM data as claimed in claim 8, characterized in that: The file screening module is specifically used for: Filtering the files at the MOD level from the level information as the MOD files; Extracting homogeneous transformation matrices in files of each level from the level information as pose matrix information; For each node in the MOD hierarchy, according to the hierarchy information, query the file of the previous level of the current level file through the index until the file of the highest level is queried; After the query at any level is completed, the MOD file is converted into coordinates according to the pose matrix information.
11. A three-dimensional modeling system based on GIM data as claimed in claim 8, characterized in that: The information acquisition module is specifically used for: Read the MOD file after coordinate conversion line by line; The identified row beginning with "P" is used as the first point information, and the point coordinates in the first point information are converted into a vector form; The identified line beginning with "R" is used as the first line of information.
12. A three-dimensional modeling system based on GIM data as claimed in claim 8, characterized in that: The line information updating module is specifically used for: Read the starting point ID and the ending point ID of the line from the first line information; Retrieving the coordinates and line width information of the target point corresponding to the starting point ID and the end point ID in the second point information; The first line information is updated according to the coordinates of the target point and the line width information as the second line information.
13. A three-dimensional modeling system based on GIM data as claimed in claim 12, characterized in that: The retrieving the coordinates and line width information of the target point corresponding to the starting point ID and the end point ID in the second point information includes: Determine the coordinate information of the corresponding candidate point according to the starting point ID and the end point ID; Matching the coordinate information of the candidate point with the coordinate information of each point in the merged point set of the second point information, and when the match is successful, taking the point in the second point information corresponding to the coordinate information of the candidate point as the target point corresponding to the starting point ID and the end point ID; The coordinates and line width information of the target point are obtained by filtering from the second point information.
14. A three-dimensional modeling system based on GIM data as claimed in claim 8, characterized in that: The modeling module is specifically used for: Creating a continuous surface object according to the second line information; A three-dimensional mesh model of a solid is established according to the surface object.
15. A three-dimensional modeling device based on GIM data, characterized in that: It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, it implements a three-dimensional modeling method based on GIM data as described in any one of claims 1 to 7.
Citation Information
Patent Citations
A massive point cloud spatial management method based on octree-like encoding
CN109345619A
Method for converting grid information model (GIM) into an FBX three-dimensional model and storing attributes
CN113221297A