A method for making a boundary line of a photovoltaic matrix based on a mesh method
By using a grid-based method, the boundary lines of a photovoltaic matrix are automatically drawn in AutoCAD, solving the problem of low efficiency in manually drawing partitions of the photovoltaic matrix. This achieves fast and accurate boundary line drawing, improving the efficiency of photovoltaic design.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- POWERCHINA HEBEI ELECTRIC POWER SURVEY & DESIGN INST CO LTD
- Filing Date
- 2022-10-10
- Publication Date
- 2026-04-24
AI Technical Summary
In photovoltaic design, there are numerous photovoltaic panels within a photovoltaic matrix with irregular edge contours. Manually drawing boundary lines for partitions is labor-intensive and inefficient. There is a need for a method that can automatically and quickly draw boundary lines for photovoltaic matrices in AutoCAD.
A grid-based approach is adopted. In AutoCAD, non-photovoltaic panel layers are turned off, photovoltaic panels are selected in batches, grids are divided and status information is marked, boundary grids are found to generate boundary coordinate sets, and closed polyline photovoltaic matrix boundary lines are drawn. Considering the shape and distribution characteristics of photovoltaic panels, grid status types and parameters are set, and boundary coordinate sets are generated and boundary lines are drawn by traversing the grid matrix.
It enables the rapid and automatic drawing of boundary lines for a large number of irregularly distributed photovoltaic panels, improving work efficiency and meeting the needs of actual engineering design.
Smart Images

Figure CN115688335B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of photovoltaic power plant management technology, and in particular to a method for creating photovoltaic matrix boundary lines based on a grid method. Background Technology
[0002] Because photovoltaic (PV) matrix designs involve numerous PV panels and irregular edge contours, manually drawing boundary lines is labor-intensive and inefficient. Therefore, there is an urgent need for a method that can automatically and quickly draw boundary lines for PV matrices in AutoCAD. Summary of the Invention
[0003] The technical problem to be solved by the present invention is to provide a method for creating the boundary lines of a photovoltaic matrix based on the mesh method, which can automatically and quickly draw the boundary lines of the photovoltaic matrix in AutoCAD.
[0004] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is as follows:
[0005] A method for fabricating photovoltaic matrix boundary lines based on a grid method includes the following steps:
[0006] S1. Turn off non-photovoltaic panel layers in AutoCAD drawings;
[0007] S2. Select the photovoltaic panels of the photovoltaic matrix W in batches from the drawing and put them into the set L;
[0008] S3, the outer rectangle W of the photovoltaic matrix W v The interior is divided into grids, with a grid matrix of V, and the state information of each grid is identified;
[0009] S4. Locate the boundary grids in the grid matrix V and generate the boundary coordinate set P. s The boundary line C of the photovoltaic matrix is drawn as a closed polyline.
[0010] A further improvement of the technical solution of the present invention is that: in S2, the photovoltaic panel is rectangular in shape and is in the form of a polyline.
[0011] A further improvement to the technical solution of this invention lies in: in S3, dividing the grid within the outer rectangle of W specifically includes the following steps:
[0012] S3.1 Set the photovoltaic panel parameters, including: photovoltaic panel width is W p The height of the photovoltaic panel is H p The lateral distance between adjacent photovoltaic panels is H. w The vertical distance is H h The number of grids between photovoltaic panels, S c =1.5, the number of grid cells between photovoltaic panels is rounded up to L. c=2, grid width X s =H w ÷ S c Grid height Y s =H h ÷ S c Grid half-width S x =X s ÷ 2, grid half height S y =Y s ÷ 2, the edge coefficient of the partition line distance matrix is S=6.0÷7;
[0013] S3.2 Set the grid state type and parameters, including: None = -2000, Between plates = -3000, Within plates = -1000, Intersect = 1, Top = 2, Bottom = 4, Left = 8, Right = 16, Top left = Top | Left, Bottom left = Bottom | Left, Top right = Top | Right, Bottom right = Bottom | Right; where grid states can be superimposed, | represents state superposition;
[0014] S3.3, Let set P L B L Centered on the four corners of each photovoltaic panel, with X... s For length, Y s Construct a rectangle R for the width c , will R c The lower left and upper right corner coordinates are placed in pairs into the outer boundary set P of the grid intersecting with the photovoltaic panel. L With the center of the photovoltaic panel as the center, and with (W) p - X s ) is long, (H) p - Y s Construct a rectangle R with width R. n , will R n The lower left and upper right corner coordinates are placed in pairs into the inner boundary set B of the grid intersecting with the photovoltaic panel. L ;
[0015] S3.4, Take W v The leftmost X coordinate is X min The rightmost X coordinate is X max The bottom Y coordinate is Y min The topmost Y-coordinate is Y max ;
[0016] S3.5 Construct rectangle R, with the coordinates of its lower left corner being (X... min - S × S x Y min - S × S yDivide the grid within R into C horizontal grids. x =(round up)((X) max - X min ) ÷ X s ) + 1, the number of vertical grids is C y =(round up)((Y) max - Y min ) ÷ Y s If ) + 1, then the total number of grid cells is C = C x × C y Let C be a two-dimensional matrix. s [C x C y The state value of each element in the matrix is "none", where S is the boundary coefficient of the photovoltaic region.
[0017] A further improvement of the technical solution of the present invention is that the value of S ranges from 0.5 to 1.
[0018] A further improvement to the technical solution of this invention lies in: generating the boundary coordinate set P in S4. s Specifically, it includes the following steps:
[0019] S4.1, Traverse the grid matrix V, current grid C e Let C be the center point, and let C lie within the inner boundary set B of the grid intersecting the photovoltaic panel. L The inner grid state is "inside the panel", and C is located at the outer boundary set P of the grid intersecting with the photovoltaic panel. L The internal state is "intersecting";
[0020] S4.2, Traverse the grid matrix V, if C e When the state is "none", determine C. e Check if the grids on the left and right sides or the top and bottom sides intersect. If they intersect, set C. e The status is set to "between boards";
[0021] S4.3, Traverse the grid matrix V and determine C e lower L c If the state of each inner grid is less than or equal to "none", then add "below" to C. e The state; L on the upper side of the grid c If the state of each inner grid is less than or equal to "none", then add "top" to C. e The state; L on the left side of the grid c If the state of each inner grid is less than or equal to "none", then add "left" to C. e The state; L on the right side of the grid c If the state of each inner grid is less than or equal to "none", then add "right" to C. eThe state; during the traversal, record the index (S) of the first grid marked as one of the above four states. x S y );
[0022] S4.4, Traverse the grid matrix V, if C e If the state is "none", "between boards", or "intersecting", then determine C. e To determine if a grid is an inner corner grid and mark its state, the following rules apply: If the right side of the current grid is not a blank area, then B. r =(C e L on the right c If the state of any grid within a given grid is greater than "intersecting"; and the left side of the current grid is not a blank area, then B... l =(C e Left L c If any grid within a given grid has a state greater than "intersecting" (meaning the area below the current grid is not empty), then B... b =(C e lower L c If any grid within a given grid has a state greater than "intersecting" (meaning the area above the current grid is not empty), then B... t =(C e upper L c If any grid within a given grid has a state greater than "intersecting" (and the upper right corner of the current grid is a blank area), then R... t =(C e If the top right corner grid status is "None" and the top left corner of the current grid has one blank grid, then L t =(C e If the top-left grid is "None" and the bottom-right grid is blank, then R b =(C e If the bottom right corner grid status is "None" and the bottom left corner of the current grid has one blank grid, then L b =(C e The bottom left grid state is "none"); satisfying B. l And B t And L t Then C e The state is marked as top left, satisfying B. l And B b And L b Then C e The state is marked as bottom left, satisfying B. r And B t And R t Then C e The state is marked as top right, satisfying B. r And B b And R b Then C eThe status is marked as bottom right;
[0023] S4.5, Set the counter variable K=0, set C e Index (N) x =S x N y =S y M is C e The state, the previous grid state M p = "Left", D is the direction for finding the next point;
[0024] S4.6. If M = "bottom right", when M p = "below", then D = "up", when M p ≠ "bottom", D = "right"; if M = "top right", when M p = "Right side", then D = "Left side", when M = "Right side"; p If M = "right", then D = "up"; if M = "down left", then when M p = "Left", then D = "Right", when M p If M = "left", then D = "down"; if M = "upper left", then when M p = "above", then D = "down", when M p ≠ "above", D = "to the left";
[0025] S4.7, Let C e The coordinates of the bottom left corner are (X, Y), X = X min + N x × X s Y = Y min + Y x × Y s When M contains the state "above", then Y = Y + Y s When M contains the state "right", then X = X + X s ;
[0026] S4.8, C e The state is a corner; add (X, Y) to P. s ;
[0027] S4.9, Search for C e The first state in direction D is the corner grid C. n If C e The state is either "top" or "bottom", N y =C n Vertical index, otherwise N x =C n Horizontal index;
[0028] S4.10, Mp =M, K=K+1, if K>C, jump to S4.13;
[0029] S4.11, N x =S x And N y =S y Jump to S4.13;
[0030] S4.12, skip to S4.6;
[0031] S4.13, Connect P one by one s Draw a closed polyline C from the points inside the polyline.
[0032] The technological advancements achieved by this invention due to the adoption of the above technical solutions are as follows:
[0033] 1. This invention takes into account the sawtooth distribution of photovoltaic panels and the concave and convex conditions of the photovoltaic matrix boundary, which conforms to actual engineering design.
[0034] 2. The method of this invention enables the rapid drawing of boundary lines for a large number of irregularly distributed photovoltaic panels, greatly improving work efficiency and providing strong support for the design of practical engineering projects. Attached Figure Description
[0035] Figure 1 This is a schematic diagram of the grid state in this invention. Detailed Implementation
[0036] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments:
[0037] like Figure 1 As shown, a method for creating the boundary lines of a photovoltaic matrix based on a mesh method includes the following steps:
[0038] S1. Turn off non-photovoltaic panel layers in AutoCAD drawings;
[0039] S2. Select photovoltaic panels of photovoltaic matrix W in batches from the drawing and put them into set L. The photovoltaic panels are rectangular in shape and polyline in form.
[0040] S3, the outer rectangle W of the photovoltaic matrix W v The interior is divided into grids, with a grid matrix of V, and the state information of each grid is identified;
[0041] In S3, the mesh is created within the bounding rectangle of W, specifically including the following steps:
[0042] S3.1 Set the photovoltaic panel parameters, including: photovoltaic panel width is W p The height of the photovoltaic panel is H pThe lateral distance between adjacent photovoltaic panels is H. w The vertical distance is H h The number of grids between photovoltaic panels, S c =1.5, the number of grid cells between photovoltaic panels is rounded up to L. c =2, grid width X s =H w ÷ S c Grid height Y s =H h ÷ S c Grid half-width S x =X s ÷ 2, grid half height S y =Y s ÷ 2, the edge coefficient of the partition line distance matrix is S=6.0÷7;
[0043] S3.2 Set the grid state type and parameters, including: None = -2000, Between plates = -3000, Within plates = -1000, Intersect = 1, Top = 2, Bottom = 4, Left = 8, Right = 16, Top left = Top | Left, Bottom left = Bottom | Left, Top right = Top | Right, Bottom right = Bottom | Right; where grid states can be superimposed, | represents state superposition;
[0044] S3.3, Let set P L B L Centered on the four corners of each photovoltaic panel, with X... s For length, Y s Construct a rectangle R for the width c , will R c The lower left and upper right corner coordinates are placed in pairs into the outer boundary set P of the grid intersecting with the photovoltaic panel. L With the center of the photovoltaic panel as the center, and with (W) p - X s ) is long, (H) p - Y s Construct a rectangle R with width R. n , will R n The lower left and upper right corner coordinates are placed in pairs into the inner boundary set B of the grid intersecting with the photovoltaic panel. L ;
[0045] S3.4, Take W v The leftmost X coordinate is X min The rightmost X coordinate is X max The bottom Y coordinate is Y min The topmost Y-coordinate is Y max ;
[0046] S3.5 Construct rectangle R, with the coordinates of its lower left corner being (X... min - S × S x Y min - S × S y Divide the grid within R into C horizontal grids. x =(round up)((X) max - X min ) ÷ X s ) + 1, the number of vertical grids is C y =(round up)((Y) max - Y min ) ÷ Y s If ) + 1, then the total number of grid cells is C = C x × C y Let C be a two-dimensional matrix. s [C x C y The state value of each element in the matrix is "none". S is the boundary coefficient of the photovoltaic area to ensure that there is a gap between the rectangle R and the outer rectangle of the photovoltaic area, so that the final drawn boundary line does not coincide with the boundary of the photovoltaic panel; the value of S ranges from 0.5 to 1.
[0047] S4. Locate the boundary grids in the grid matrix V and generate the boundary coordinate set P. s Draw a closed polyline C, where C is the boundary line of the photovoltaic matrix;
[0048] Generate the boundary coordinate set P in S4. s Specifically, it includes the following steps:
[0049] S4.1, Traverse the grid matrix V, current grid C e Let C be the center point, and let C lie within the inner boundary set B of the grid intersecting the photovoltaic panel. L The inner grid state is "inside the panel", and C is located at the outer boundary set P of the grid intersecting with the photovoltaic panel. L The internal state is "intersecting";
[0050] S4.2, Traverse the grid matrix V, if C e When the state is "none", determine C. e Check if the grids on the left and right sides or the top and bottom sides intersect. If they intersect, set C. e The status is set to "between boards";
[0051] S4.3, Traverse the grid matrix V and determine C e lower L c If the state of each inner grid is less than or equal to "none", then add "below" to C. e The state; L on the upper side of the grid cIf the state of each inner grid is less than or equal to "none", then add "top" to C. e The state; L on the left side of the grid c If the state of each inner grid is less than or equal to "none", then add "left" to C. e The state; L on the right side of the grid c If the state of each inner grid is less than or equal to "none", then add "right" to C. e The state; during the traversal, record the index (S) of the first grid marked as one of the above four states. x S y );
[0052] S4.4, Traverse the grid matrix V, if C e If the state is "none", "between boards", or "intersecting", then determine C. e Whether it is an inner corner grid and mark the grid status are determined by the following rules: If the right side of the current grid is not a blank area (a large area without photovoltaic panels), then B. r =(C e L on the right c If the state of any grid within a given grid is greater than "intersecting"; and the left side of the current grid is not a blank area, then B... l =(C e Left L c If any grid within a given grid has a state greater than "intersecting" (meaning the area below the current grid is not empty), then B... b =(C e lower L c If any grid within a given grid has a state greater than "intersecting" (meaning the area above the current grid is not empty), then B... t =(C e upper L c If any grid within a given grid has a state greater than "intersecting" (and the upper right corner of the current grid is a blank area), then R... t =(C e If the top right corner grid status is "None" and the top left corner of the current grid has one blank grid, then L t =(C e If the top-left grid is "None" and the bottom-right grid is blank, then R b =(C e If the bottom right corner grid status is "None" and the bottom left corner of the current grid has one blank grid, then L b =(C e The bottom left grid state is "none"); satisfying B. l And B t And L t Then C e The state is marked as top left, satisfying B. l And B bAnd L b Then C e The state is marked as bottom left, satisfying B. r And B t And R t Then C e The state is marked as top right, satisfying B. r And B b And R b Then C e The status is marked as bottom right;
[0053] S4.5, Set the counter variable K=0, set C e Index (N) x =S x N y =S y M is C e The state, the previous grid state M p = "Left", D is the direction for finding the next point;
[0054] S4.6. If M = "bottom right", when M p = "below", then D = "up", when M p ≠ "bottom", D = "right"; if M = "top right", when M p = "Right side", then D = "Left side", when M = "Right side"; p If M = "right", then D = "up"; if M = "down left", then when M p = "Left", then D = "Right", when M p If M = "left", then D = "down"; if M = "upper left", then when M p = "above", then D = "down", when M p ≠ "above", D = "to the left";
[0055] S4.7, Let C e The coordinates of the bottom left corner are (X, Y), X = X min + N x × X s Y = Y min + Y x × Y s When M contains the state "above", then Y = Y + Y s When M contains the state "right", then X = X + X s ;
[0056] S4.8, C e The state is a corner; add (X, Y) to P. s ;
[0057] S4.9, Search for C eThe first state in direction D is the corner grid C. n If C e The state is either "top" or "bottom", N y =C n Vertical index, otherwise N x =C n Horizontal index;
[0058] S4.10, M p =M, K=K+1, if K>C, jump to S4.13;
[0059] S4.11, N x =S x And N y =S y Jump to S4.13;
[0060] S4.12, skip to S4.6;
[0061] S4.13, Connect P one by one s Draw a closed polyline C from the points inside the polyline.
[0062] In summary, this invention takes into account both the concave and convex aspects of the photovoltaic matrix boundary, which aligns with practical engineering design. The method of this invention enables the rapid drawing of boundary lines for a large number of irregularly distributed photovoltaic panels, greatly improving work efficiency and providing strong support for the design of practical engineering projects.
Claims
1. A method for fabricating the boundary lines of a photovoltaic matrix based on a mesh method, characterized in that: Includes the following steps: S1. Turn off non-photovoltaic panel layers in AutoCAD drawings; S2. Select the photovoltaic panels of the photovoltaic matrix W in batches from the drawing and put them into the set L; S3, the outer rectangle W of the photovoltaic matrix W v The interior is divided into grids, with a grid matrix of V, and the state information of each grid is identified; In S3, the mesh is created within the bounding rectangle of W, specifically including the following steps: S3.1 Set the photovoltaic panel parameters, including: photovoltaic panel width is W p The height of the photovoltaic panel is H p The lateral distance between adjacent photovoltaic panels is H. w The vertical distance is H h The number of grids between photovoltaic panels, S c =1.5, the number of grid cells between photovoltaic panels is rounded up to L. c =2, grid width X s =H w ÷ S c Grid height Y s =H h ÷ S c Grid half-width S x =X s ÷ 2, grid half height S y =Y s ÷ 2, the edge coefficient of the partition line distance matrix is S=6.0÷7; S3.2 Set the grid state type and parameters, including: None = -2000, Between plates = -3000, Within plates = -1000, Intersect = 1, Top = 2, Bottom = 4, Left = 8, Right = 16, Top left = Top | Left, Bottom left = Bottom | Left, Top right = Top | Right, Bottom right = Bottom | Right; where grid states can be superimposed, | represents state superposition; S3.3, Let set P L B L Centered on the four corners of each photovoltaic panel, with X... s For length, Y s Construct a rectangle R for the width c , will R c The lower left and upper right corner coordinates are placed in pairs into the outer boundary set P of the grid intersecting with the photovoltaic panel. L With the center of the photovoltaic panel as the center, and with (W) p - X s ) is long, (H) p - Y s Construct a rectangle R with width R. n , will R n The lower left and upper right corner coordinates are placed in pairs into the inner boundary set B of the grid intersecting with the photovoltaic panel. L ; S3.4, Take W v The leftmost X coordinate is X min The rightmost X coordinate is X max The bottom Y coordinate is Y min The topmost Y-coordinate is Y max ; S3.5 Construct rectangle R, with the coordinates of its lower left corner being (X... min - S × S x Y min - S × S y Divide the grid within R into C horizontal grids. x =(round up)((X) max - X min ) ÷ X s ) + 1, the number of vertical grids is C y =(round up)((Y) max - Y min ) ÷ Y s If ) + 1, then the total number of grid cells is C = C x × C y Let C be a two-dimensional matrix. s [C x C y The state value of each element in the matrix is "none", where S is the boundary coefficient of the photovoltaic region; S4. Locate the boundary grids in the grid matrix V and generate the boundary coordinate set P. s The boundary line C of the photovoltaic matrix is drawn as a closed polyline. Generate the boundary coordinate set P in S4. s Specifically, it includes the following steps: S4.1, Traverse the grid matrix V, current grid C e Let C be the center point, and let C lie within the inner boundary set B of the grid intersecting the photovoltaic panel. L The inner grid state is "inside the panel", and C is located at the outer boundary set P of the grid intersecting with the photovoltaic panel. L The internal state is "intersecting"; S4.2, Traverse the grid matrix V, if C e When the state is "none", determine C. e Check if the grids on the left and right sides or the top and bottom sides intersect. If they intersect, set C. e The status is set to "between boards"; S4.3, Traverse the grid matrix V and determine C e lower L c If the state of each inner grid is less than or equal to "none", then add "below" to C. e The state; L on the upper side of the grid c If the state of each inner grid is less than or equal to "none", then add "top" to C. e The state; L on the left side of the grid c If the state of each inner grid is less than or equal to "none", then add "left" to C. e The state; L on the right side of the grid c If the state of each inner grid is less than or equal to "none", then add "right" to C. e The state; during the traversal, record the index (S) of the first grid marked as one of the above four states. x S y ); S4.4, Traverse the grid matrix V, if C e If the state is "none", "between boards", or "intersecting", then determine C. e To determine if a grid is an inner corner grid and mark its state, the following rules apply: If the right side of the current grid is not a blank area, then B. r =(C e L on the right c If the state of any grid within a given grid is greater than "intersecting"; and the left side of the current grid is not a blank area, then B... l =(C e Left L c If any grid within a given grid has a state greater than "intersecting" (meaning the area below the current grid is not empty), then B... b =(C e lower L c If any grid within a given grid has a state greater than "intersecting" (the area above the current grid is not a blank region), then B... t =(C e upper L c If any grid within a given grid has a state greater than "intersecting" (and the upper right corner of the current grid is a blank area), then R... t =(C e If the top right corner grid status is "None" and the top left corner of the current grid has one blank grid, then L t =(C e If the top-left grid is "None" and the bottom-right grid is blank, then R b =(C e If the bottom right corner grid status is "None" and the bottom left corner of the current grid has one blank grid, then L b =(C e (The bottom left grid state is "none"); satisfying B. l And B t And L t Then C e The state is marked as top left, satisfying B. l And B b And L b Then C e The state is marked as bottom left, satisfying B. r And B t And R t Then C e The state is marked as top right, satisfying B. r And B b And R b Then C e The status is marked as bottom right; S4.5, Set the counter variable K=0, set C e Index (N) x =S x N y =S y M is C e The state, the previous grid state M p = "left", D is the direction for finding the next point; S4.
6. If M = "bottom right", when M p If M = "below", then D = "upward". p ≠ "bottom", D="right"; if M="top right", when M p If M = "right", then D = "left", and M = "right". p If M = "right", then D = "up"; if M = "down left", then M = "down". p If M = "left", then D = "right"; p If M is not "left", then D = "down"; if M is "upper left", then M = "upper left". p If M = "above", then D = "downward". p ≠ "top", D="left"; S4.7, Let C e The coordinates of the bottom left corner are (X, Y), X = X min + N x × X s Y = Y min + Y x × Y s When M contains the state "above", then Y = Y + Y s When M contains the state "right", then X = X + X s ; S4.8, C e The state is a corner; add (X, Y) to P. s ; S4.9, Search for C e The first state in direction D is the corner grid C. n If C e The state is either "top" or "bottom", N y =C n Vertical index, otherwise N x =C n Horizontal index; S4.10, M p =M, K=K+1, if K>C, jump to S4.13; S4.11, N x =S x And N y =S y Jump to S4.13; S4.12, skip to S4.6; S4.13, Connect P one by one s Draw a closed polyline C from the points inside the polyline.
2. The method for fabricating photovoltaic matrix boundary lines based on the mesh method according to claim 1, characterized in that: In S2, the photovoltaic panel is rectangular in shape and is in the form of a polyline.
3. The method for fabricating photovoltaic matrix boundary lines based on the grid method according to claim 1, characterized in that: The value of S ranges from 0.5 to 1.
Citation Information
Patent Citations
Automatic photovoltaic panel arrangement method in irregular site based on AutoCAD
CN112214858A
Complex building irregular roof photovoltaic panel arrangement system and optimization method
CN113221356A