Wiring point-based QEM improved power three-dimensional model simplification method
By using the QEM improvement method based on the wiring point in the simplification process of power three-dimensional model, the problem of structural features is solved, achieving higher accuracy and authenticity, ensuring that key wiring points are not lost.
Patent Information
- Application Number
- CN202411651093.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-18
- Publication Date
- 2025-04-01
AI Technical Summary
The existing three-dimensional power model simplification method can easily lead to loss of structural features during the simplification process, affecting the accuracy and authenticity of the model.
The QEM improvement method based on the connection point is adopted. By determining the three-dimensional coordinates of the connection points from the two-dimensional CAD drawings, marking them in the three-dimensional model, and calculating parameters such as the vertex error matrix and edge curvature, the optimal simplified path selection and optimization are carried out to ensure that the key connection points are not lost.
It effectively retains important structures such as wiring points, significantly improving the accuracy and authenticity of simplified results, and also meeting simplified goals and error standards.
Smart Images

Figure CN119741420A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of electric power technology, and more specifically, relates to a method for simplifying an electric power three-dimensional model based on a QEM improvement of a wiring point. Background Art
[0002] In the description and simulation of power 3D models, highly complex models usually contain a large number of vertices, edges and faces. Although these models provide detailed geometric information, they also increase the burden of calculation and storage, especially when performing real-time simulation, analysis and visualization. Therefore, how to effectively simplify the 3D model while maintaining the overall geometric characteristics of the model becomes an important technical issue.
[0003] Many traditional model simplification algorithms, such as vertex aggregation, edge collapse and face collapse methods, can simplify the model to a certain extent, but often lead to the loss of important structural features, thus affecting the accuracy and authenticity of the model. Summary of the invention
[0004] The present invention provides a method for simplifying a three-dimensional electric power model based on a QEM improved by connection points, which is intended to solve the technical problem that the current simplification method will lead to the loss of structural features, thereby affecting the accuracy and authenticity of the model.
[0005] A method for simplifying a three-dimensional electric power model based on QEM improvement of a connection point, characterized by comprising the following steps:
[0006] Step 1: Based on the 2D CAD drawing, determine the 3D coordinates of the connection points and save them as an XML file;
[0007] Step 2: Read the saved XML file, extract the coordinates of the connection points, and obtain a list containing the three-dimensional coordinates of the connection points; traverse the model vertices based on the three-dimensional coordinate list of the connection points and the three-dimensional model data, add a tag tag=1 to the connection points, and obtain the three-dimensional model data marked with the connection points;
[0008] Step 3: Calculate the vertex error matrix based on the three-dimensional model data with the connection points marked; obtain the error matrix of each vertex; and calculate the sum of the areas, the normal vector and the shape coefficient based on the vertex coordinates of each triangle face of the three-dimensional model data; calculate the approximate curvature of each edge based on the vertex of the three-dimensional model data and its adjacent cotton piece data;
[0009] Step 4: Interpolate the new vertex position based on the error matrix, calculate the simplification cost of each edge, sort and select the edge with the minimum simplification cost to simplify and obtain the optimal simplified path;
[0010] Step 5: Based on the optimal simplified path, check whether there is a point with tag = 1 between the two endpoints of the edge. If so, execute step 4; if not, execute step 6;
[0011] Step 6: Check whether the simplification degree and target accuracy of the current model meet the simplification target and error standard. If so, create a simplified 3D model. If not, select other edges for the next simplification and return to step 4.
[0012] The present invention provides a QEM-based improved power three-dimensional model simplification method based on wiring points, aiming to solve the problem of structural feature loss and model accuracy and authenticity damage caused by existing simplification methods. It is achieved by the following steps: first, the three-dimensional coordinates of the wiring points are determined and saved using a two-dimensional CAD drawing, and then the wiring points are marked in the three-dimensional model by reading and extracting the coordinates. Next, the error matrix of each vertex, the area, normal vector and shape coefficient of each triangular face are calculated, and the approximate curvature of each edge is determined. Subsequently, the new vertex position is interpolated based on the error matrix, and the simplification cost of each edge is calculated, and the edge with the minimum simplification cost is sorted and selected for simplification to form the optimal simplified path. During the simplification process, it is checked whether the key wiring points are retained, and the optimization is cyclically optimized until the simplification target and error standard are met. Through the above improvements, it is ensured that important structures such as wiring points are not lost during the simplification process, and at the same time, the accuracy and authenticity of the simplified results are significantly improved by combining multi-dimensional error control and curvature weight factors.
[0013] Preferably, step 3 comprises the following steps:
[0014] Calculate the plane equation of the patch: For each triangle patch, use the coordinates of the three vertices (v1, v2, v3) to calculate the plane equation of the patch:
[0015] Ax+By+Cz+D=0;
[0016] Calculate the normal vector N:
[0017] N = (v2-v1) × (v3-v1);
[0018] Where: N = (A, B, C): the normal vector of the patch, obtained by the cross product of the vectors (v2-v1) and (v3-v1); v1 = (x1, y1, z1): the coordinates of the first vertex of the triangle patch; v2 = (x2, y2, z2): the coordinates of the second vertex of the triangle patch; v3 = (x3, y3, z3): the coordinates of the third vertex of the triangle patch;
[0019] Calculate the plane equation constant D:
[0020] D = -(Ax1 + By1 + Cz1);
[0021] Where: D represents the constant in the patch plane equation; A, B, C represent the components of the direction quantity N;
[0022] First, the normal vector is calculated, and then the plane equation constant is calculated using the coordinates of a vertex to finally determine the plane equation;
[0023] Construct the error matrix:
[0024]
[0025] Where: K represents the eigenvector matrix of the patch;
[0026] Accumulate the error matrix Q of adjacent patches:
[0027]
[0028] Where: Q represents the error matrix of the vertex; K i The eigenvector matrix representing adjacent patches; Denotes the matrix K i The transpose of
[0029] Compute the area of each triangle patch:
[0030]
[0031] Where: A represents the area of the triangle;
[0032] Calculate shape coefficient: define shape coefficient according to the geometric characteristics of the patch;
[0033] Calculate the approximate curvature of each edge: To calculate the approximate curvature of each edge, you first need to calculate the angle between adjacent patch vectors and define it as the cosine value of the angle. Finally, the ratio of the angle to the edge length is used as the approximate curvature:
[0034]
[0035] Where: cos(θ ij ) represents the cosine of the angle between the normal vectors N1 and N2; N1 and N2 represent the side (v i ,v j ) represents the normal vectors of the adjacent patches on both sides; ||N1||,||N2|| represents the modulus lengths of the normal vectors N1 and N2.
[0036] Preferably, step 4 comprises the following steps:
[0037] Merge error matrix: merge vertex v i and v j The error matrix of is merged to obtain the new error matrix Q′:
[0038] Q′=Q i +Q j ;
[0039] Where: Q i and Q j Represents the vertex v i and v j The error matrix of
[0040] Interpolate the new vertex position: For each edge (v i ,v j ) Select the following candidate points: v i The position of the point, v j Point location, edge midpoint
[0041] Calculate the merge error: For each candidate point, calculate the error estimate corresponding to the error matrix Q′:
[0042] error=v T Q′v;
[0043] Where: v represents the position vector of the candidate vertex, including (x, y, z, 1);
[0044] Select the candidate point that minimizes the error estimate as the new vertex position v opt ;
[0045] Compute the simplified cost of an edge:
[0046]
[0047] Where: A ij Represents edge e ij The sum of the areas of adjacent triangle faces; A ij Represents edge e ij The normal vector norm of adjacent triangle faces; k ij Represents edge e ij The shape coefficient of the adjacent triangle patch; k ij Represents edge e ij The shape coefficients of adjacent triangle patches; Represents edge e ij The approximate curvature of; w1, w2, w3, w4 represent weight factors;
[0048] Calculate the simplification cost for each edge in the model, and save the simplification cost of each edge and its corresponding error value.
[0049] The beneficial effects of the present invention include:
[0050] The present invention provides a QEM-based improved power three-dimensional model simplification method based on wiring points, aiming to solve the problem of structural feature loss and model accuracy and authenticity damage caused by existing simplification methods. It is achieved by the following steps: first, the three-dimensional coordinates of the wiring points are determined and saved using a two-dimensional CAD drawing, and then the wiring points are marked in the three-dimensional model by reading and extracting the coordinates. Next, the error matrix of each vertex, the area, normal vector and shape coefficient of each triangular face are calculated, and the approximate curvature of each edge is determined. Subsequently, the new vertex position is interpolated based on the error matrix, and the simplification cost of each edge is calculated, and the edge with the minimum simplification cost is sorted and selected for simplification to form the optimal simplified path. During the simplification process, it is checked whether the key wiring points are retained, and the optimization is cyclically optimized until the simplification target and error standard are met. Through the above improvements, it is ensured that important structures such as wiring points are not lost during the simplification process, and at the same time, the accuracy and authenticity of the simplified results are significantly improved by combining multi-dimensional error control and curvature weight factors. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0052] Figure 1 An overall step block diagram provided for an embodiment of the present invention. DETAILED DESCRIPTION
[0053] In order to make the technical problems, technical solutions and beneficial effects to be solved by the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0054] See also Figure 1 As shown, the best embodiment of the present invention is further described;
[0055] A method for simplifying a three-dimensional electric power model based on QEM improvement of a connection point, characterized by comprising the following steps:
[0056] Step 1: Based on the 2D CAD drawing, determine the 3D coordinates of the connection points and save them as an XML file;
[0057] Use CAD software or programming interface tools (such as AutoCAD API) to read CAD drawing files;
[0058] Identify the location of the wiring point on the drawing. Use layers or colors or blocks or annotations to identify the wiring point;
[0059] Extract the coordinates (x, y) of the connection points on the two-dimensional plane and generate a coordinate list of the two-dimensional connection points;
[0060] According to the three-dimensional layout requirements of the power system, the z-axis height is specified for each connection point; the height information is obtained through the following methods:
[0061] Directly enter a fixed height;
[0062] Get altitude from an external data source or sensor;
[0063] Combine the 2D coordinates and height information to generate 3D coordinates:
[0064] (X3D,Y3D,Z3D)=(X2D,Y2D,Z);
[0065] Where: (X3D, Y3D, Z3D) represents the merged three-dimensional coordinates; X2D, Y2D represent the two-dimensional plane coordinates; Z represents the acquired height;
[0066] Generate a three-dimensional coordinate list of all wiring points based on the generated three-dimensional coordinates;
[0067] The XML file structure is created using the xml.etree.ElementTree library in Python; the three-dimensional coordinates of the wiring points are written into the XML file; and an XML file is generated to save the three-dimensional coordinates of the wiring points.
[0068] Step 2: Read the saved XML file, extract the coordinates of the connection points, and obtain a list containing the three-dimensional coordinates of the connection points; traverse the model vertices based on the three-dimensional coordinate list of the connection points and the three-dimensional model data, add a tag tag=1 to the connection points, and obtain the three-dimensional model data marked with the connection points;
[0069] Traverse each vertex in the three-dimensional model and compare the proximity of the three-dimensional coordinates of the model vertex and the connection point;
[0070] Add tag tag=1:
[0071] If the model vertex matches or is close to the connection point coordinates, the vertex is marked as tag = 1;
[0072] A certain tolerance value needs to be set to match the approximate coordinates, such as ∈;
[0073] |X model -X conection |<∈∧|Y model -Y conection |<∈∧|Zmodel -Z conection |<∈;
[0074] Where: X model ,Y model ,Z model Indicates the three-dimensional coordinates of a vertex in the model; X conection ,Y conection ,Z conection Indicates the three-dimensional coordinates of the wiring point; ∈ indicates the allowed tolerance value;
[0075] Generate new 3D model data, in which the connection points are labeled with tag=1;
[0076] Specific:
[0077] Parsing XML file:
[0078] Use an XML parsing tool to read the file content and find all the wiring points <point>Node. The extracted wiring point data needs to be converted into a list structure for subsequent processing.
[0079] Extract the 3D coordinates of the wiring points:
[0080] Iterate through the wiring points in the XML file <point>Tags, read the <x> , <y> , <z>Coordinate values, forming a three-dimensional coordinate list.
[0081] Coordinate vertices in the model for each wire connection point:
[0082] Traverse each vertex of the model and compare it with the 3D coordinates of the known wiring points.
[0083] Determine the Euclidean distance between two points. If it is less than a certain threshold, the two points are considered to be the same.
[0084] Add tag tag=1:
[0085] Label the vertices that meet the conditions.
[0086] The vertex carries the tag=1 in the data structure required for the next operation.
[0087] Step 3: Calculate the vertex error matrix based on the three-dimensional model data with the connection points marked; obtain the error matrix of each vertex; and calculate the sum of the areas, the normal vector and the shape coefficient based on the vertex coordinates of each triangle face of the three-dimensional model data; calculate the approximate curvature of each edge based on the vertex of the three-dimensional model data and its adjacent cotton piece data;
[0088] The step 3 comprises the following steps:
[0089] Calculate the plane equation of the patch: For each triangle patch, use the coordinates of the three vertices (v1, v2, v3) to calculate the plane equation of the patch:
[0090] Ax+By+Cz+D=0;
[0091] Calculate the normal vector N:
[0092] N = (v2-v1) × (v3-v1);
[0093] Where: N = (A, B, C): the normal vector of the patch, obtained by the cross product of the vectors (v2-v1) and (v3-v1); v1 = (x1, y1, z1): the coordinates of the first vertex of the triangle patch; v2 = (x2, y2, z2): the coordinates of the second vertex of the triangle patch; v3 = (x3, y3, z3): the coordinates of the third vertex of the triangle patch;
[0094] Calculate the plane equation constant D:
[0095] D = -(Ax1 + By1 + Cz1);
[0096] Where: D represents the constant in the patch plane equation; A, B, C represent the components of the direction quantity N;
[0097] First, the normal vector is calculated, and then the plane equation constant is calculated using the coordinates of a vertex to finally determine the plane equation;
[0098] Construct the error matrix:
[0099]
[0100] Where: K represents the eigenvector matrix of the patch;
[0101] Accumulate the error matrix Q of adjacent patches:
[0102]
[0103] Where: Q represents the error matrix of the vertex; K i The eigenvector matrix representing adjacent patches; Denotes the matrix K i The transpose of
[0104] Compute the area of each triangle patch:
[0105]
[0106] Where: A represents the area of the triangle;
[0107] Calculate shape coefficient: define shape coefficient according to the geometric characteristics of the patch;
[0108] Calculate the approximate curvature of each edge: To calculate the approximate curvature of each edge, you first need to calculate the angle between adjacent patch vectors and define it as the cosine value of the angle. Finally, the ratio of the angle to the edge length is used as the approximate curvature:
[0109]
[0110] Where: cos(θ ij ) represents the cosine of the angle between the normal vectors N1 and N2; N1 and N2 represent the side (v i ,v j ) represents the normal vectors of the adjacent patches on both sides; ||N1||,||N2|| represents the modulus lengths of the normal vectors N1 and N2.
[0111] Step 4: Interpolate the new vertex position based on the error matrix, calculate the simplification cost of each edge, sort and select the edge with the minimum simplification cost to simplify and obtain the optimal simplified path;
[0112] The step 4 comprises the following steps:
[0113] Merge error matrix: merge vertex v i and v j The error matrix of is merged to obtain the new error matrix Q′:
[0114] Q′=Q i +Q j ;
[0115] Where: Q i and Q j Represents the vertex v i and v j The error matrix of
[0116] Interpolate the new vertex position: For each edge (v i ,v j ) Select the following candidate points: v i The position of the point, v j Point location, edge midpoint
[0117] Calculate the merge error: For each candidate point, calculate the error estimate corresponding to the error matrix Q′:
[0118] error=v T Q′v;
[0119] Where: v represents the position vector of the candidate vertex, including (x, y, z, 1);
[0120] Select the candidate point that minimizes the error estimate as the new vertex position v opt ;
[0121] Compute the simplified cost of an edge:
[0122]
[0123] Where: A ij Represents edge e ij The sum of the areas of adjacent triangle faces; N ij Represents edge e ij The normal vector norm of adjacent triangle faces; k ij Represents edge e ij The shape coefficient of the adjacent triangle patch; k ij Represents edge e ij The shape coefficients of adjacent triangle patches; Represents edge e ij The approximate curvature of; w1, w2, w3, w4 represent weight factors;
[0124] Calculate the simplification cost for each edge in the model, save the simplification cost of each edge and its corresponding error value; sort and select the edge with the smallest simplification cost to simplify and obtain the optimal simplified path;.
[0125] Step 5: Based on the optimal simplified path, check whether there is a point with tag = 1 between the two endpoints of the edge. If so, execute step 4; if not, execute step 6;
[0126] Check edge ij The two endpoints v i and v j Whether there is a tag tag = 1;
[0127] Determine the vertex v i and v j Whether the connection point is marked with tag = 1;
[0128] If there is a point with tag=1:
[0129] Calling step 4:
[0130] If v i or v j If any vertex in has a label tag = 1, it means that the edge involves a key connection point and should not be simplified directly.
[0131] Therefore, skip this edge and return to step 4 to reselect and calculate the next edge with the minimum simplification cost, perform simplification cost calculation and interpolate the new vertex position.
[0132] Step 6: Check whether the simplification degree and target accuracy of the current model meet the simplification target and error standard. If so, create a simplified 3D model. If not, select other edges for the next simplification and return to step 4.
[0133] Simplification:
[0134] The ratio of the number of vertices or edges in the simplified model to the number of initial vertices or edges. Defined as:
[0135]
[0136] Where: N initial Indicates the number of initial nodes or edges; N initial represents the number of simplified nodes or edges; J represents the degree of simplification;
[0137] Error standard:
[0138] W=∑ i ||v initial,i -v current,i || 2 ;
[0139] Where: v initial,i Indicates the position of the i-th vertex of the initial model; v current,i Indicates the position of the i-th vertex after simplifying the model;
[0140] Check the simplicity:
[0141] Calculate the number of simplified vertices or edges, compare with the preset simplification target, and determine whether the simplification process has achieved the target.
[0142] Check error standards:
[0143] The error calculation formula is used to evaluate whether the simplified model meets the preset error accuracy.
[0144] Decision-making process:
[0145] Efficiently evaluate whether the current simplification meets the target requirements. If it does, the process ends; if it does not, select other edges for further simplification and return to step 4 to continue.
[0146] The present invention provides a QEM-based improved power three-dimensional model simplification method based on wiring points, aiming to solve the problem of structural feature loss and model accuracy and authenticity damage caused by existing simplification methods. It is achieved by the following steps: first, the three-dimensional coordinates of the wiring points are determined and saved using a two-dimensional CAD drawing, and then the wiring points are marked in the three-dimensional model by reading and extracting the coordinates. Next, the error matrix of each vertex, the area, normal vector and shape coefficient of each triangular face are calculated, and the approximate curvature of each edge is determined. Subsequently, the new vertex position is interpolated based on the error matrix, and the simplification cost of each edge is calculated, and the edge with the minimum simplification cost is sorted and selected for simplification to form the optimal simplified path. During the simplification process, it is checked whether the key wiring points are retained, and the optimization is cyclically optimized until the simplification target and error standard are met. Through the above improvements, it is ensured that important structures such as wiring points are not lost during the simplification process, and at the same time, the accuracy and authenticity of the simplified results are significantly improved by combining multi-dimensional error control and curvature weight factors.
[0147] The above are only preferred embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present application should be included in the protection scope of the present application.< / z> < / y> < / x> < / point> < / point>
Claims
1. A method for simplifying a three-dimensional power model based on QEM improvement of connection points, characterized in that: The following steps are involved: Step 1: Based on the 2D CAD drawing, determine the 3D coordinates of the connection points and save them as an XML file; Step 2: Read the saved XML file, extract the coordinates of the connection points, and obtain a list containing the three-dimensional coordinates of the connection points; traverse the model vertices based on the three-dimensional coordinate list of the connection points and the three-dimensional model data, add a tag tag=1 to the connection points, and obtain the three-dimensional model data marked with the connection points; Step 3: Calculate the vertex error matrix based on the three-dimensional model data with the wiring points marked; Get the error matrix of each vertex; and calculating the sum of the areas, the normal vectors and the shape coefficients based on the vertex coordinates of each triangular face of the three-dimensional model data; Calculate the approximate curvature of each edge based on the vertices of the three-dimensional model data and the adjacent cotton piece data; Step 4: Interpolate the new vertex position based on the error matrix, calculate the simplification cost of each edge, sort and select the edge with the minimum simplification cost to simplify and obtain the optimal simplified path; Step 5: Based on the optimal simplified path, check whether there is a point with tag = 1 between the two endpoints of the edge. If so, execute step 4; if not, execute step 6; Step 6: Check whether the simplification degree and target accuracy of the current model meet the simplification target and error standard. If so, create a simplified 3D model. If not, select other edges for the next simplification and return to step 4.
2. The method for simplifying the three-dimensional power model based on QEM improvement of connection points according to claim 1 is characterized in that: The step 3 comprises the following steps: Calculate the plane equation of the patch: For each triangle patch, use the coordinates of the three vertices (v1, v2, v3) to calculate the plane equation of the patch: Ax+By+Cz+D=0; Calculate the normal vector N: N = (v2-v1) × (v3-v1); Where: N = (A, B, C): the normal vector of the patch, obtained by the cross product of the vectors (v2-v1) and (v3-v1); v1 = (x1, y1, z1): the coordinates of the first vertex of the triangle patch; v2 = (x2, y2, z2): the coordinates of the second vertex of the triangle patch; v3 = (x3, y3, z3): the coordinates of the third vertex of the triangle patch; Calculate the plane equation constant D: D = -(Ax1 + By1 + Cz1); Where: D represents the constant in the patch plane equation; A, B, C represent the components of the direction quantity N; First, the normal vector is calculated, and then the plane equation constant is calculated using the coordinates of a vertex to finally determine the plane equation; Construct the error matrix: Where: K represents the eigenvector matrix of the patch; Accumulate the error matrix Q of adjacent patches: Where: Q represents the error matrix of the vertex; K i The eigenvector matrix representing adjacent patches; Denotes the matrix K i The transpose of Compute the area of each triangle patch: Where: A represents the area of the triangle; Calculate shape coefficient: define shape coefficient according to the geometric characteristics of the patch; Calculate the approximate curvature of each edge: To calculate the approximate curvature of each edge, you first need to calculate the angle between adjacent patch vectors and define it as the cosine value of the angle. Finally, the ratio of the angle to the edge length is used as the approximate curvature: Where: cos(θ ij ) represents the cosine of the angle between the normal vectors N1 and N2; N1 and N2 represent the side (v i ,v j ) represents the normal vectors of the adjacent patches on both sides; ||N1||,||N2|| represents the modulus lengths of the normal vectors N1 and N2.
3. The method for simplifying the three-dimensional power model based on QEM improvement of connection points according to claim 1 is characterized in that: The step 4 comprises the following steps: Merge error matrix: merge vertex v i and v j The error matrix of is merged to obtain the new error matrix Q′: Q ′ =Q i +Q j ; Where: Q i and Q j Represents the vertex v i and v j The error matrix of Interpolate the new vertex position: For each edge (v i ,v j ) Select the following candidate points: v i The position of the point, v j Point location, edge midpoint Calculate the merge error: For each candidate point, calculate the error matrix Q ′ The corresponding error estimate is: error=v T Q′v; Where: v represents the position vector of the candidate vertex, including (x, y, z, 1); Select the candidate point that minimizes the error estimate as the new vertex position v opt ; Compute the simplified cost of an edge: Where: A ij Represents edge e ij The sum of the areas of adjacent triangle faces; n ij Represents edge e ij The normal vector norm of adjacent triangle faces; k ij Represents edge e ij The shape coefficient of the adjacent triangle patch; k ij Represents edge e ij The shape coefficients of adjacent triangle patches; Represents edge e ij The approximate curvature of; w1, w2, w3, w4 represent weight factors; Calculate the simplification cost for each edge in the model, and save the simplification cost of each edge and its corresponding error value.