Method and system for drawing mountain shadow passing through certain point of contour map based on CAD

Drawing the shading lines on the contour map by CAD solves the waste of photovoltaic and agricultural resources caused by mountain shading, improves power generation and agricultural output, and is suitable for photovoltaic and agricultural projects under complex terrain.

CN119169214APending Publication Date: 2024-12-20SHANDONG HUANNENG DESIGN INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411233974.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

In mountain photovoltaic and agricultural projects, mountain shading phenomenon causes photovoltaic modules or crops to not accept sunlight during good sunlight, resulting in a decrease in power generation and agricultural output, resulting in waste of resources.

Method used

Using the method of drawing contour maps based on CAD, the three-dimensional intersection points of the elevation to be measured and all contour lines are obtained, and the local and global occlusion points are filtered out, and the occlusion lines are drawn from these points as the starting point, which intuitively represents the shadow of the mountain. Helps plan for avoiding shaded areas.

Benefits of technology

It effectively improves photovoltaic power generation and agricultural output, simplifies land planning, is suitable for photovoltaic and agricultural projects under complex terrain, and has both convenient operation and auxiliary inspection functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119169214A_ABST
    Figure CN119169214A_ABST
Patent Text Reader

Abstract

The invention discloses a CAD-based method and system for drawing a mountain shadow passing through a certain point of a contour map, and mainly relates to the technical field of mountain photovoltaics and mountain agriculture. Comprising the steps of collecting a standardized contour drawing; defining input parameters for the collected contour line drawing; acquiring all contour lines in contact with the to-be-measured vertical face; obtaining three-dimensional intersection points of the to-be-measured vertical face and all the contour lines; screening out all local shielding points from the three-dimensional intersection points; screening out all global shielding points from all the local shielding points; and drawing a shielding line by taking all the global shielding points as starting points. The method has the beneficial effects that the shielding effect of all mountains on the vertical face, which passes through a certain point and is parallel to sunlight in a certain state, on the contour map can be quickly drawn in the CAD.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical fields of mountain photovoltaic and mountain agriculture, and in particular to a method and system for drawing a mountain shadow passing through a certain point on a contour map based on CAD. Background Art

[0002] Mountainous terrain is complex and steep. During certain periods of time during the day, large areas may be blocked by high ground and cannot be directly exposed to the sun. When selecting sites for photovoltaic or agricultural projects in mountainous areas, the phenomenon of mountain blocking must be considered. Otherwise, photovoltaic modules or crops may not be able to receive sunlight during periods of good sunlight, resulting in a reduction in power generation and agricultural output, and a waste of resources.

[0003] Taking mountain photovoltaic as an example, the photovoltaic layout location must generally follow the principle that "the photovoltaic modules should not be blocked from 9:00 to 15:00 local time every day in a year". Sometimes the above time interval can be fine-tuned according to the site conditions, and its essence remains unchanged. It has been found through actual operation that the mountain shielding on the winter solstice is the most serious in a year, and the shielding area on the winter solstice almost completely covers any shielding area on non-winter solstice days. Therefore, the mountain shielding on the winter solstice should be considered when deciding the photovoltaic layout area. It has also been found through actual operation that on the winter solstice, under the premise of following the principle that "the photovoltaic modules should not be blocked from 9:00 to 15:00 local time every day in a year", the mountain shielding at 9:00 and 15:00 local time is the most serious, and the shielding area at 9:00 and 15:00 local time almost completely covers any shielding area between 9:00 and 15:00 local time. Therefore, the mountain shielding at 9:00 and 15:00 local time on the winter solstice should be considered when deciding the photovoltaic layout area.

[0004] The light emitted by the sun at a certain place and time can be regarded as a three-dimensional vector. If the latitude of a certain place has been determined, the three-dimensional solar vector of that place at every time and every day of the year can be solved. The solution process is complicated and will not be elaborated here. Flexible use of mainstream sunshine analysis software on the market can directly obtain the three-dimensional value of the solar vector.

[0005] Mountainous terrain is complex and steep. During certain periods of time during the day, large areas may be blocked by high ground and cannot be directly exposed to the sun. When selecting sites for photovoltaic or agricultural projects in mountainous areas, the phenomenon of mountain blocking must be considered. Otherwise, photovoltaic modules or crops may not be able to receive sunlight during periods of good sunlight, resulting in a reduction in power generation and agricultural output, and a waste of resources.

[0006] Therefore, there is an urgent need for a method and system for drawing a mountain shadow passing through a certain point on a contour map based on CAD to solve the above problem. Summary of the invention

[0007] The purpose of the present invention is to provide a method and system for drawing mountain shadows passing through a certain point on a contour map based on CAD, which realizes the effect of quickly drawing all mountain shading effects on the facades passing through a certain point on the contour map and parallel to the sunlight in a certain state when the measured point, the contour layer, the maximum frame selection length, the east-west component of the sunlight vector at a height of 1m, the north-south component of the sunlight vector at a height of 1m, and the lowest height of the site are known.

[0008] In order to achieve the above object, the present invention is implemented through the following technical solutions:

[0009] On the one hand, a method for drawing a mountain shadow passing through a certain point on a contour map based on CAD is provided, comprising the following steps:

[0010] S1: Collect standardized contour drawings;

[0011] S2: Define the input parameters of the test point, contour layer, maximum box selection length, east-west component of the sun ray vector at 1m height, north-south component of the sun ray vector at 1m height, and the lowest height of the field; define the concept of the test line, the test elevation, the three-dimensional intersection, the profile of the mountain to be tested, the perihelion, the aphelion, the ability to block, the local block, the global block, the blocking line, and the principle of finding the intersection point using the slope-intercept equation;

[0012] S3: Obtain all contour lines that touch the facade to be measured;

[0013] S4: Obtain the three-dimensional intersection points of the facade to be measured and all contour lines;

[0014] S5: Filter out all local occlusion points from the three-dimensional intersection points in step S4;

[0015] S6: Filter out all global occlusion points from all local occlusion points in step S5;

[0016] S7: Draw occlusion lines with all the global occlusion points in step S6 as starting points.

[0017] Preferably, the collection of standardized contour drawings follows the following principles:

[0018] All contour lines in the drawing must be of polyline type;

[0019] The height of the contour lines in the drawing should be reflected in the elevation parameters of the polyline;

[0020] Each contour line in the drawing must be composed of straight line segments, and the line segments must not be curved;

[0021] Contour lines in drawings must not cross or overlap;

[0022] All contour lines in a drawing must be on the same layer.

[0023] Preferably, the step S3 comprises:

[0024] S31, determining whether the point to be measured is a three-dimensional point, if it is a three-dimensional point, changing the point to be measured to a two-dimensional point;

[0025] S32, from the top-down perspective, translate the frame line multiple times from the point to be measured to the positive direction of the sun ray vector at a height of 1m, and obtain a two-dimensional point, called "point 1", and translate the frame line multiple times from the point to be measured to the reverse direction of the sun ray vector at a height of 1m, and obtain a two-dimensional point, called "point 2", and obtain a line segment (point 1, point 2) of sufficient length;

[0026] S33, calling the ssget function, adding all the contour lines of the contact line segment (point 1, point 2) into a selection set, called the "contour line selection set to be tested";

[0027] S34. If the contour selection set to be tested does not contain any graphics element, define the "direct end flag" as "yes".

[0028] Preferably, the step S4 comprises:

[0029] S41: If the direct end flag is "yes", the remaining steps of S4 are not executed, otherwise the steps from S44 to S45 are repeatedly executed, and the number of repetitions is the number of contour lines in the contour line selection set to be tested;

[0030] S42: Create a new counter "i", with an initial value of 0;

[0031] S43: Create a new empty table "3D intersection list";

[0032] S44: Obtain the elevation, vertex list, and closure of the i-th contour line in the selected set of contour lines to be measured, obtain all two-dimensional line segments of the contour line through the vertex list and closure, obtain the two-dimensional intersection points of the line segment (point 1, point 2) and all line segments of the contour line, combine the elevation of the contour line with these two-dimensional intersection points to obtain all three-dimensional intersection points of the facade to be measured and the i-th contour line in the selected set, and add these three-dimensional intersection points to the three-dimensional intersection point list;

[0033] S45: increment the counter i by 1;

[0034] S46: At this point, a complete three-dimensional intersection point list has been obtained, and overlapping three-dimensional intersection points in the three-dimensional intersection point list are deleted so that the elements in the list are different;

[0035] S47: Create a new concept "sunlight direction". If the absolute value of the east-west component of the sunlight vector at 1m height is greater than or equal to the absolute value of the north-south component, the sunlight direction is set to 0, otherwise the sunlight direction is set to 1.

[0036] S48: When the following conditions are met: the direction of the sun's rays is 0 and the sun's rays vector is biased to the west, or the direction of the sun's rays is 1 and the sun's rays vector is biased to the south, the CAD extension function vl-sort is called to sort the elements in the three-dimensional intersection list and update the three-dimensional intersection list, and the order is arranged from small to large according to the th parameter value of the direction of the sun's rays of each three-dimensional point in the three-dimensional intersection list; otherwise, the CAD extension function vl-sort is called to sort the elements in the three-dimensional intersection list and update the three-dimensional intersection list, and the order is arranged from large to small according to the th parameter value of the direction of the sun's rays of each three-dimensional point in the three-dimensional intersection list; this step ultimately makes the three-dimensional points in the three-dimensional intersection list arranged in order from the farthest end to the closest end.

[0037] Preferably, the step S5 comprises:

[0038] S51: If the direct end flag is "yes", the remaining steps of S5 are not executed, otherwise the steps from S56 to S511 are repeatedly executed, and the number of repetitions is the number of points in the three-dimensional intersection point list minus 1;

[0039] S52: Find the cosecant value of the angle between the sun ray and the horizontal plane, which is equal to the length of the sun ray vector at a height of 1 m divided by the overhead length of the sun ray vector at a height of 1 m;

[0040] S53: Create a new counter "i", with an initial value of 0;

[0041] S54: Create a new empty table "local occlusion point list";

[0042] S55: Create a new proposition 2, with an initial value of "No", which is used to indicate whether the terrain 2 is greater than the angle between the sun's rays and the horizontal plane;

[0043] S56: obtaining the i-th 3D point in the 3D intersection point list, referred to as “point 1”, obtaining the i-th plus 1 3D point in the 3D intersection point list, referred to as “point 2”, and the 3D line segment formed by point 1 and point 2 is referred to as the “i-th 3D line segment”;

[0044] S57: assign the value of Proposition 2 to Proposition 1 to indicate whether the terrain 1 is greater than the angle between the sun's rays and the horizontal plane. When the terrain 1 does not exist, the corresponding value of Proposition 1 is "No".

[0045] S58: If the heights of point 1 and point 2 are equal, then let the cosecant value of the angle between the i-th three-dimensional line segment and the horizontal plane be equal to 1; if point 2 is higher than point 1, then let the cosecant value of the angle between the i-th three-dimensional line segment and the horizontal plane be equal to the three-dimensional distance between point 1 and point 2 divided by the overhead distance between point 1 and point 2; if point 2 is lower than point 1, then let the cosecant value of the angle between the i-th three-dimensional line segment and the horizontal plane be equal to negative 1 multiplied by the three-dimensional distance between point 1 and point 2 divided by the overhead distance between point 1 and point 2;

[0046] S59: If the cosecant value of the angle between the i-th three-dimensional line segment and the horizontal plane is greater than the cosecant value of the angle between the sun's rays and the horizontal plane, then let Proposition 2 be "yes", otherwise let Proposition 2 be "no";

[0047] S510: If i is equal to the number of points in the three-dimensional intersection point list minus 2, that is, the i-th three-dimensional line segment is the last three-dimensional line segment in the three-dimensional intersection point list in the near-south direction, then if Proposition 2 holds, point 1 is added to the local occlusion point list; if i is not equal to the number of points in the three-dimensional intersection point list minus 2, that is, the i-th three-dimensional line segment is not the last three-dimensional line segment in the three-dimensional intersection point list in the near-south direction, then if Proposition 1 holds and Proposition 2 does not hold, point 1 is added to the local occlusion point list;

[0048] S511: increment the counter i by 1;

[0049] S512: At this time, a complete list of local occlusion points has been obtained. If the local occlusion point list is an empty table, that is, there is no mountain occlusion on the facade to be measured, then define the "direct end flag" as "yes", otherwise delete the overlapping local occlusion points in the local occlusion point list so that the elements in the list are different.

[0050] Preferably, the step S6 comprises:

[0051] S61: If the direct end flag is "yes", the remaining steps of S6 are not executed, otherwise the steps of S65 to S68 are repeated, and the number of repetitions is the number of points in the local occlusion point list minus 1;

[0052] S62: transposing the local occlusion point list, that is, arranging the three-dimensional points in the local occlusion point list in order from the perihelion to the aphelion;

[0053] S63: Create a new counter "i", with an initial value of 1;

[0054] S64: Create a new list “global occlusion point list”. Because any point on the contour line cannot occlude the first local occlusion point of the perihelion, the initial value of the global occlusion point list is set to store the first three-dimensional point of the local occlusion point list.

[0055] S65: Obtain the i-th point in the local occlusion point list, referred to as “point 3”;

[0056] S66: Obtain the last point in the global occlusion point list, referred to as “point 4”;

[0057] S67: If the sunlight starting from point 4 can fall directly below point 3, that is, the local occlusion point 3 (x3, y3, z3) cannot be blocked by the global occlusion point 4 (x4, y4, z4), which is reflected as z3>z4-sqrt(((x4-x3)^2+(y4-y3)^2) / (dx^2+dy^2)), where dx and dy are the east-west component and north-south component of the sunlight vector at a height of 1m, respectively, then point 3 is added to the global occlusion point list;

[0058] S68: increment the counter i by 1;

[0059] S69: At this point, a complete global occlusion point list has been obtained.

[0060] Preferably, the step S7 comprises:

[0061] S71: If the direct end flag is "yes", the remaining steps of S7 are not executed, otherwise the steps from S73 to S722 are repeatedly executed, and the number of repetitions is the number of points in the global occlusion point list;

[0062] S72: Create a new counter "i", with an initial value of 0;

[0063] S73: obtaining the ith three-dimensional point in the global occlusion point list, referred to as the “ith global occlusion point”. For the convenience of observation, a circle is drawn at the ith global occlusion point, with an arbitrary radius.

[0064] S74: Obtain all contour lines that may be blocked by the i-th global blocking point. The contour lines that may be blocked by the i-th global blocking point meet three screening conditions: first, the elevation is less than the elevation of the i-th global blocking point; second, it is in contact with the aphelion end of the line to be measured with the i-th global blocking point as the boundary from a bird's-eye view; third, when the sunlight starting from the i-th global blocking point shines downward to an elevation equal to the lowest height of the field, the sunlight has touched the bottom, and the i-th global blocking point can no longer block any contour lines in the direction of the light's advance; based on the third condition, calculate the direction from the two-dimensional coordinates of the i-th three-dimensional intersection point as the starting point to the aphelion end of the line to be measured when calling the ssget function. The two-dimensional coordinates of the end point of the two-dimensional frame line segment extending from the end to the end are known. The coordinates of the i-th global occlusion point (xi,yi,zi), the 1m height sun ray vector (dx,dy,1), and the lowest height of the field hmin are known. The coordinates of the end point of the frame line segment can be calculated as (xi+(zi-hmin)*dx,yi+(zi-hmin)*dy). Call the ssget function to filter all the contour lines whose elevations of the contact segments ((xi,yi), (xi+(zi-hmin)*dx,yi+(zi-hmin)*dy)) are less than zi and add them to the selection set. This selection set is called the "i-th contour line selection set to be calculated";

[0065] S75: Create a new counter "j", with an initial value of 0;

[0066] S76: Create a new empty table "i-th contour line parameter list to be calculated";

[0067] S77: Repeat the steps from S78 to S714, and the number of repetitions is the number of contour lines in the i-th contour line list to be calculated;

[0068] S78: Obtain the jth contour line in the i-th list of contour lines to be calculated, referred to as the "jth contour line to be calculated", obtain the elevation, vertex list, and closure of the j-th contour line to be calculated, obtain all two-dimensional line segments of the j-th contour line to be calculated through the vertex list and closure, obtain the two-dimensional intersection points of the frame line ((xi,yi), (xi+(zi-hmin)*dx, yi+(zi-hmin))) and all line segments of the j-th contour line to be calculated, remove the two-dimensional intersection points that overlap with the i-th global occlusion point in the top-down perspective, and add the obtained two-dimensional intersection points to the list, referred to as the "j-th two-dimensional intersection point list".

[0069] S79: Create a new counter "k", with an initial value of 0;

[0070] S710: Repeat the steps S711 to S713, and the number of repetitions is the number of two-dimensional points in the j-th two-dimensional intersection point list;

[0071] S711: Obtain the kth two-dimensional point in the jth two-dimensional intersection point list, referred to as the "kth two-dimensional point", with coordinates (xk, yk);

[0072] S712: Calculate the height of the sunlight from the ith global occlusion point to the kth two-dimensional point = sqrt(((xk-xi)^2+(yk-yi)^2) / (dx^2)+dy^2)), the height minus the elevation of the jth contour line to be calculated is the height difference of the sunlight at the kth two-dimensional point to the ground, combine the height difference and the elevation of the jth contour line to be calculated with the kth two-dimensional point and add them to the parameter list of the ith contour line to be calculated;

[0073] S713: increment the counter k by 1;

[0074] S714: increment the counter j by 1;

[0075] S715: At this time, the complete list of parameters of the i-th contour line to be calculated has been obtained, and the CAD extension function vl-sort is called to sort the elements in the list of parameters of the i-th contour line to be calculated and update the list of parameters of the i-th contour line to be calculated, and the order is arranged from small to large according to the two-dimensional coordinates stored in each element in the list and the overhead distance from the i-th global occlusion point;

[0076] S716: Create a new counter "j", with an initial value of 1;

[0077] S717: When j is less than the number of elements in the i-th contour line parameter list to be calculated, the steps S718 to S720 are executed in a loop;

[0078] S718: Get the height difference between the sun's rays and the ground stored in the jth element in the i-th contour line parameter list. If the height difference is less than 0, that is, the i-th global occlusion point cannot block the contour line at the two-dimensional coordinates stored in the j-th element in the i-th contour line parameter list, then the two-dimensional coordinates of the end point of the occlusion line starting from the i-th global occlusion point must be located in the line segment from the two-dimensional coordinates stored in the j-th element in the i-th contour line parameter list to the two-dimensional coordinates stored in the j-th minus 1 element. A3 represents the three-dimensional coordinates of the point on the contour line stored in the j-th element in the i-th contour line parameter list to be calculated, B3 represents the three-dimensional coordinates of the point on the contour line stored in the j-th minus 1 element in the i-th contour line parameter list to be calculated, C3 represents the i-th global occlusion point, all the inputs of the slope-intercept equation principle for finding the intersection point described in S215 are known, the slope-intercept equation principle for finding the intersection point is called to find the three-dimensional coordinates of the end point of the occlusion line starting from the i-th global occlusion point and a straight line is drawn as the occlusion line;

[0079] S719: If the drawing in S718 has been executed, j is adjusted to make its value equal to the number of elements in the i-th contour line parameter list to be calculated, so as to jump out of the loop in S717;

[0080] S720: increment the counter j by 1;

[0081] S721: At this time, the loop described in S717 has been jumped out. If the drawing described in S718 has not been executed, that is, the i-th global occlusion point is capable of blocking the three-dimensional intersection of the last contour line in the far-day direction of the facade to be measured and the facade to be measured, then it is stipulated that the horizontal and vertical coordinates (x, y) of the end point of the occlusion line starting from the i-th global occlusion point should be equal to the horizontal and vertical coordinates of the three-dimensional intersection of the last contour line in the far-day direction of the facade to be measured and the facade to be measured, and the height z of the end point is calculated as sqrt(((xi-x)^2+(yi-y)^2) / (dx^2)+dy^2)), and a straight line is drawn from the i-th global occlusion point as the starting point as the occlusion line;

[0082] S722: increment the counter i by 1;

[0083] S723: At this point, all the occlusion lines starting from the global occlusion point on the facade to be measured have been drawn.

[0084] On the other hand, a CAD-based system for drawing a mountain shadow passing through a point on a contour map is provided, for implementing the method in any one of claims 1 to 7 above.

[0085] Compared with the prior art, the beneficial effects of the present invention are:

[0086] 1. The present invention makes full use of the characteristics of contour maps. When the sun's ray vector is known, a three-dimensional straight line is drawn in the topographic map, which intuitively shows the mountain shadow, facilitates the land planning of the mountain photovoltaic industry and mountain agriculture, avoids the arrangement of photovoltaic modules and crops in areas with severe shadows, and increases power generation and agricultural output.

[0087] 2. The present invention uses straight lines to represent mountain shadows, which facilitates more detailed measurements for operators. Operators can use basic CAD instructions to measure the actual height of sunlight starting from the global shielding point at a certain point on the top view. Combined with the contour map, the height difference of the sunlight at this point relative to the ground can be calculated, which is beneficial to operators when the photovoltaic height above the ground is specified and the height of crop leaves above the ground exists.

[0088] 3. If the provided contour map has multiple overlapping lines, the present invention can draw a circle at the global occlusion point, but cannot draw the occlusion line. The operator can find the overlapping anomaly of the contour map from this phenomenon, so the present invention also has the function of auxiliary inspection.

[0089] 4. The present invention has a wide range of applications and is applicable to any parallel light projected downward other than vertical light. No modification or adjustment is required before applying this method to tropical or southern hemisphere mountains. BRIEF DESCRIPTION OF THE DRAWINGS

[0090] Figure 1 This is a schematic diagram of the sun's ray vector at 9:00 local time;

[0091] Figure 2 It is a schematic diagram of the cross section of the mountain to be measured;

[0092] Figure 3 Schematic diagram of the occlusion point;

[0093] Figure 4 It is a schematic diagram of the obstruction points in the profile of the mountain to be measured;

[0094] Figure 5 It is a schematic diagram of the local obstruction points in the profile of the mountain to be measured;

[0095] Figure 6 It is a schematic diagram of the global occlusion points in the profile of the mountain to be measured;

[0096] Figure 7 It is a schematic diagram of all the blocking lines on a facade to be measured in the contour map;

[0097] Figure 8 A schematic diagram for solving the coordinates of a sun ray falling on the ground on a certain vertical surface to be measured by using the principle of finding the intersection point of the slope-intercept equation;

[0098] Fig. 9 It is a schematic diagram for setting the line segment and frame line of the string of points to be tested.

[0099] Fig.10 A schematic diagram for demonstrating how to set a suitable frame line multiple so that all frames cover the entire contour map when any sun ray vector is selected;

[0100] Fig.11 It is an effect diagram of the present invention applied to the entire contour map at 9:00 and 15:00 local time on the winter solstice in a certain mountain area. DETAILED DESCRIPTION

[0101] The present invention will be further described below in conjunction with specific embodiments. It should be understood that these embodiments are only used to illustrate the present invention and are not intended to limit the scope of the present invention. In addition, it should be understood that after reading the content taught by the present invention, those skilled in the art can make various changes or modifications to the present invention, and these equivalent forms fall within the scope limited by the application equally.

[0102] In the present invention, terms such as "upper", "lower", "left", "right", "front", "back", "vertical", "horizontal", "side", "bottom", etc. indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings. They are relational words determined only for the convenience of describing the structural relationships of the various parts or elements of the present invention, and do not specifically refer to any part or element in the present invention and should not be understood as limitations on the present invention.

[0103] In the present invention, terms such as "fixed connection", "connected", "connection", etc. should be understood in a broad sense, indicating that it can be fixedly connected, integrally connected or detachably connected; it can be directly connected or indirectly connected through an intermediate medium. Relevant scientific research or technical personnel in this field can determine the specific meanings of the above terms in the present invention according to specific circumstances, and they should not be understood as limiting the present invention.

[0104] Example:

[0105] like Figure 1 As shown, the following steps are included:

[0106] S1: Collect standardized contour drawings;

[0107] S2: Define the input parameters of the test point, contour layer, maximum box selection length, east-west component of the sun ray vector at 1m height, north-south component of the sun ray vector at 1m height, and the lowest height of the field; define the concept of the test line, the test elevation, the three-dimensional intersection, the profile of the mountain to be tested, the perihelion, the aphelion, the ability to block, the local block, the global block, the blocking line, and the principle of finding the intersection point using the slope-intercept equation;

[0108] S3: Obtain all contour lines that touch the facade to be measured;

[0109] S4: Obtain the three-dimensional intersection points of the facade to be measured and all contour lines;

[0110] S5: Filter out all local occlusion points from the three-dimensional intersection points in step S4;

[0111] S6: Filter out all global occlusion points from all local occlusion points in step S5;

[0112] S7: Draw occlusion lines with all the global occlusion points in step S6 as starting points.

[0113] The collection of standardized contour drawings follows the following principles:

[0114] All contour lines in the drawing must be of polyline type;

[0115] The height of the contour lines in the drawing should be reflected in the elevation parameters of the polyline;

[0116] Each contour line in the drawing must be composed of straight line segments, and the line segments must not be curved;

[0117] Contour lines in drawings must not cross or overlap;

[0118] All contour lines in a drawing must be on the same layer.

[0119] The parameters and concepts in step S2 include:

[0120] S21, point to be tested: input a 2D point on the ground that needs to be blocked by the shadow of the mountain to be detected. If a 3D point is input, the z coordinate is ignored and it is changed to a 2D point;

[0121] S22, Contour layer: Enter a string to indicate the layer where the contour line is located, which is used to identify the contour line;

[0122] S23, East-West component and North-South component of the sun's ray vector at 1m height: Enter a real number for each, both numbers cannot be 0 at the same time. Figure 1The schematic diagram of the sun ray vector at 9:00 local time shown, A1B1 is the sun ray vector at 1m height, A1C1 is the north-south component of the sun ray vector at 1m height, A1D1 is the east-west component of the sun ray vector at 1m height, and A1E1 is 1m height;

[0123] S24, frame line multiple: Enter a non-zero real number, which represents the ratio of the length of the frame line used when executing step S33 to the overhead length of the sun ray vector at an altitude of 1m. It does not matter whether it is positive or negative. It is used to specify the length of the frame line when calling the ssget function to obtain the selection set so that all contour lines in the drawing can be taken into consideration. The calculation method refers to the extension of S81-8.

[0124] S25, lowest height of the field: input a real number, which represents the elevation of the lowest contour line in the entire contour map, and is used to specify the length of the frame line when the ssget function is called in step S74 to obtain the selection set, so that contour lines with too low heights are not taken into consideration, thereby improving the calculation efficiency;

[0125] S26, line to be measured: a two-dimensional straight line passing through the point to be measured from a bird's-eye view and parallel to the sun's rays from a bird's-eye view is called the line to be measured;

[0126] S27, the facade to be measured: the facade where the line to be measured is located is called the facade to be measured;

[0127] S28, 3D intersection point: The 3D point on the contour line that intersects with the vertical surface to be measured is called the 3D intersection point;

[0128] S29. Profile of the mountain to be measured: The cross-section formed by all three-dimensional intersections on the vertical surface to be measured is called the profile of the mountain to be measured. Figure 2 , the profile of the mountain to be measured is parallel to the sun's rays and perpendicular to the horizontal plane;

[0129] S210, perihelion, aphelion: For any segment of the sun ray, sun ray vector, line to be measured, elevation to be measured, mountain profile to be measured and their top view, the end close to the sun in the top view is called the perihelion, and the end far from the sun is called the aphelion. Figure 1 For example, A1 is the perihelion, B1 is the aphelion, Figure 2 For example, the three-dimensional intersection on the right is at the perihelion, and the three-dimensional intersection on the left is at the aphelion;

[0130] S211. Blocking point: If the sunlight from a certain three-dimensional intersection point can fall directly above the next three-dimensional intersection point on the far side of the point, then the three-dimensional intersection point is said to be able to block the next three-dimensional intersection point on the far side of the point, and the three-dimensional intersection point is called a blocking point. Figure 3, the method for determining whether a three-dimensional intersection is a point that can be blocked is that, under the premise of knowing the sun's ray vector, a three-dimensional line segment is connected between the three-dimensional intersection and the next three-dimensional intersection in the aphotic direction of the point. The three-dimensional line segment is called terrain. Compare (the angle between the terrain and the horizontal plane) and (the angle between the sun's ray vector and the horizontal plane). If (the angle between the terrain and the horizontal plane) is greater than (the angle between the sun's ray vector and the horizontal plane), such as A2B2, then the three-dimensional intersection is determined to be a point that can be blocked. If (the angle between the terrain and the horizontal plane) is less than or equal to (the angle between the sun's ray vector and the horizontal plane), such as A2B2, then the three-dimensional intersection is determined not to be a point that can be blocked. In addition, if a certain three-dimensional intersection does not have the next three-dimensional intersection in the aphotic direction, such as A2, then it is stipulated that the point is not a point that can be blocked. Figure 4 Pointed out the Figure 2 All the occluded points in ;

[0131] S212, local occlusion point: if the next three-dimensional intersection point in the perihelion direction of a certain occlusion point is not an occlusion point or does not exist, then the three-dimensional intersection point is called a local occlusion point; Figure 5 Pointed out the Figure 2 All local occlusion points in the image are special occlusion points. The shadow range generated by the local occlusion point can completely cover the occlusion points that are continuously adjacent to it in the far-day direction.

[0132] S213, global occlusion point: if the sunlight from any local occlusion point in the perihelion direction of a local occlusion point cannot fall directly above the local occlusion point, then the local occlusion point is called a global occlusion point; Figure 6 Pointed out the Figure 2 All global occlusion points in the image. A global occlusion point is a special local occlusion point. The shadow range produced by the global occlusion point cannot be covered by any local occlusion point in the near side direction.

[0133] S214, occlusion line: A three-dimensional straight line displayed on the drawing to facilitate the operator to observe the mountain occlusion. Figure 7 Each global occlusion point on a measured facade corresponds to an occlusion line. The starting point of each occlusion line is the global occlusion point, and the end point is the mountain ground. If the position of the mountain ground cannot be obtained from the contour map, the end point is changed to the intersection of the last contour line in the far-day direction and the measured facade. In order to facilitate observation under certain viewing angles, a circle can be drawn at the starting point of each occlusion line. Each measured facade may generate 0 or more occlusion lines;

[0134] S215. Principle of finding the intersection point using slope-intercept equation: The present invention uses the slope-intercept equation to find the height of the end point of the shielding line on a certain vertical plane. All sunlight will eventually fall to the ground. Under the premise that there are contour lines near the point where the light falls, the intersection points of two adjacent vertical planes to be tested and the contour lines can be found on the vertical plane to be tested, so that the sunlight rays fall at or directly above the intersection point at the near side and at or directly below the intersection point at the far side. At this time, it can be roughly considered that the ground between the two intersection points is flat and the intersection point of the sunlight and the ground can be calculated accordingly. Combined with the attached Figure 8 , A3 (xA3, yA3, zA3), B3 (xB3, yB3, zB3), C3 (xC3, yC3, zC3) are the intersection points of the measured facade and the contour line and the three-dimensional data are known, A3 is a point on the ground in the direction of the aphelion, B3 is a point on the ground in the direction of the perihelion, C3 is the global occlusion point, and a coordinate system is established with the position where the sun's rays reach A3 or directly below A3 as the origin O. The upward direction is the z-axis, the perihelion direction is the r-axis, and the r-axis is the composite axis of the east-west x-axis and the north-south y-axis. At this time, OC3 and A3B3 have an intersection, that is, the end point of the occlusion line, and OC3 and The function curve of A3B3 is written as a slope-intercept equation and the z and r coordinates of the intersection are found. The r coordinate is then decomposed into x and y coordinates as follows: Given the sun ray vector at 1m, (dx, dy, 1), the slope of OC3 is 1 / sqrt(dx^2+dy^2), and the intercept of OC3 is zC3-sqrt((xC3-xA3)^2+(yC3-yA3)^2) / sqrt(dx^+dy^2), so the equation of OC3 is z=1 / sqrt(dx^2+dy^2)*r+zC3-sqrt((xC3 -xA3)^2+(yC3-yA3)^2) / sqrt(dx^+dy^2). Similarly, the slope of A3B3 is (zB3-zA3) / sqrt((xB3-xA3)^2+(yB3-yA3)^2). The intercept of A3B3 is zA3, so the equation of A3B3 is z=(zB3-zA3) / sqrt((xB3-xA3)^2+(yB3-yA3)^2)*r+zA3. Combine the two equations and get the r coordinate of the intersection point D3=zC3-zA3-sqrt((xC3-xA3)^2 +(yC3-yA3)^2) / sqrt(dx^+dy^2), substituting r back into the equation to find the z coordinate of D3, and then decomposing r into the CAD coordinate system to obtain the x coordinate of D3 = xA3-r*dx / sqrt(dx^2+dy^2), the y coordinate = yA3-r*dy / sqrt(dx^2+dy^2), and finally obtaining the three-dimensional coordinates of the end point of the occlusion line; this method is also applicable to the case where the sunlight just falls on the three-dimensional intersection. This method has only one set of basis points for solving the end point of the occlusion line, so the execution speed of this algorithm is fast but the accuracy is not very high.

[0135] The step S3 comprises:

[0136] S31, determining whether the point to be measured is a three-dimensional point, if it is a three-dimensional point, changing the point to be measured to a two-dimensional point;

[0137] S32, from the top-down perspective, translate the frame line multiple times from the point to be measured to the positive direction of the sun ray vector at a height of 1m, and obtain a two-dimensional point, called "point 1", and translate the frame line multiple times from the point to be measured to the reverse direction of the sun ray vector at a height of 1m, and obtain a two-dimensional point, called "point 2", and obtain a line segment (point 1, point 2) of sufficient length;

[0138] S33, calling the ssget function, adding all the contour lines of the contact line segment (point 1, point 2) into a selection set, called the "contour line selection set to be tested";

[0139] S34. If the contour selection set to be tested does not contain any graphics element, define the "direct end flag" as "yes".

[0140] The step S4 comprises:

[0141] S41, if the direct end flag is "yes", do not execute the remaining steps of S4, otherwise repeat the steps from S44 to S45, and the number of repetitions is the number of contour lines in the contour line selection set to be tested;

[0142] S42, create a new counter "i", the initial value is 0;

[0143] S43, create a new empty table "3D intersection list";

[0144] S44, obtaining the elevation, vertex list, and closure of the ith contour line in the selected set of contour lines to be measured, obtaining all two-dimensional line segments of the contour line through the vertex list and closure, obtaining the two-dimensional intersection points of the line segment (point 1, point 2) and all line segments of the contour line, combining the elevation of the contour line with these two-dimensional intersection points to obtain all three-dimensional intersection points of the facade to be measured and the ith contour line in the selected set, and adding these three-dimensional intersection points to the three-dimensional intersection point list;

[0145] S45, increment the counter i by 1;

[0146] S46, at this time, a complete three-dimensional intersection point list has been obtained, and overlapping three-dimensional intersection points in the three-dimensional intersection point list are deleted so that the elements in the list are different;

[0147] S47. Create a new concept “sunlight direction”. If the absolute value of the east-west component of the sunlight vector at 1m height is greater than or equal to the absolute value of the north-south component, then the sunlight direction is set to 0; otherwise, the sunlight direction is set to 1.

[0148] S48. If (the direction of the sun's rays is 0 and the sun's rays vector is biased to the west) or (the direction of the sun's rays is 1 and the sun's rays vector is biased to the south), call the CAD extension function vl-sort to sort the elements in the three-dimensional intersection list and update the three-dimensional intersection list, and arrange them in order from small to large according to the sun's rays direction parameter value of each three-dimensional point in the three-dimensional intersection list (the east-west coordinate is the 0th parameter value, the north-south coordinate is the 1st parameter value, and the vertical coordinate is the 2nd parameter value); otherwise call the CAD extension function vl-sort to sort the elements in the three-dimensional intersection list and update the three-dimensional intersection list, and arrange them in order from large to small according to the sun's rays direction parameter value of each three-dimensional point in the three-dimensional intersection list; this step ultimately makes the three-dimensional points in the three-dimensional intersection list arranged in order from the farthest end to the closest end.

[0149] The step S5 comprises:

[0150] S51, if the direct end flag is "yes", do not execute the remaining steps of S5, otherwise repeat the steps from S56 to S511, and the number of repetitions is the number of points in the three-dimensional intersection point list minus 1;

[0151] S52, finding the cosecant value of the angle between the sun ray and the horizontal plane is equal to the length of the sun ray vector at a height of 1 m divided by the overhead length of the sun ray vector at a height of 1 m;

[0152] S53, create a new counter "i", the initial value is 0;

[0153] S54, create a new empty table "local occlusion point list";

[0154] S55, create a new proposition 2, the initial value is "No", which is used to indicate the attachment Figure 3 Is the terrain 2 in the equation greater than the angle between the sun's rays and the horizontal plane?

[0155] S56, obtaining the ith 3D point in the 3D intersection point list, referred to as “point 1”, obtaining the ith plus 1 th 3D point in the 3D intersection point list, referred to as “point 2”, and the 3D line segment formed by point 1 and point 2 is referred to as the “ith 3D line segment”;

[0156] S57, assign the value of Proposition 2 to Proposition 1 to indicate the value of the additional Figure 3 Whether the terrain 1 in the equation is greater than the angle between the sun's rays and the horizontal plane, when the terrain 1 does not exist, the corresponding value of proposition 1 is "no";

[0157] S58. If the heights of point 1 and point 2 are equal, then let the cosecant value of the angle between the i-th three-dimensional line segment and the horizontal plane be equal to 1; if point 2 is higher than point 1, then let the cosecant value of the angle between the i-th three-dimensional line segment and the horizontal plane be equal to the three-dimensional distance between point 1 and point 2 divided by the overhead distance between point 1 and point 2; if point 2 is lower than point 1, then let the cosecant value of the angle between the i-th three-dimensional line segment and the horizontal plane be equal to negative 1 multiplied by the three-dimensional distance between point 1 and point 2 divided by the overhead distance between point 1 and point 2;

[0158] S59. If the cosecant value of the angle between the i-th three-dimensional line segment and the horizontal plane is greater than the cosecant value of the angle between the sun's rays and the horizontal plane, then let Proposition 2 be "yes", otherwise let Proposition 2 be "no";

[0159] S510, if i is equal to the number of points in the three-dimensional intersection point list minus 2, that is, the i-th three-dimensional line segment is the last three-dimensional line segment in the three-dimensional intersection point list in the near-south direction, then if Proposition 2 holds, point 1 is added to the local occlusion point list; if i is not equal to the number of points in the three-dimensional intersection point list minus 2, that is, the i-th three-dimensional line segment is not the last three-dimensional line segment in the three-dimensional intersection point list in the near-south direction, then if Proposition 1 holds and Proposition 2 does not hold, point 1 is added to the local occlusion point list;

[0160] S511, increment counter i by 1;

[0161] S512. At this time, a complete list of local occlusion points has been obtained. If the local occlusion point list is an empty table, that is, there is no mountain occlusion on the facade to be measured, then define the "direct end flag" as "yes", otherwise delete the overlapping local occlusion points in the local occlusion point list so that the elements in the list are different.

[0162] The step S6 comprises:

[0163] S61, if the direct end flag is "yes", do not execute the remaining steps of S6, otherwise repeat the steps from S65 to S68, and the number of repetitions is the number of points in the local occlusion point list minus 1;

[0164] S62, transposing the local occlusion point list, that is, arranging the three-dimensional points in the local occlusion point list in order from the perihelion to the aphelion;

[0165] S63, create a new counter "i", with an initial value of 1;

[0166] S64, creating a new list "global occlusion point list", because any point on the contour line cannot occlude the first local occlusion point of the perihelion, so the initial value of the global occlusion point list is set to store the first three-dimensional point of the local occlusion point list;

[0167] S65, obtaining the i-th point in the local occlusion point list, referred to as “point 3”;

[0168] S66, obtaining the last point in the global occlusion point list, referred to as "point 4";

[0169] S67. If the sunlight starting from point 4 can fall directly below point 3, that is, the local occlusion point 3 (x3, y3, z3) cannot be blocked by the global occlusion point 4 (x4, y4, z4), which is reflected as z3>z4-sqrt(((x4-x3)^2+(y4-y3)^2) / (dx^2+dy^2)), where dx and dy are the east-west component and north-south component of the sunlight vector at a height of 1m, respectively, then point 3 is added to the global occlusion point list;

[0170] S68, increment the counter i by 1;

[0171] S69. At this point, a complete global occlusion point list has been obtained.

[0172] The step S7 comprises:

[0173] S71, if the direct end flag is "yes", do not execute the remaining steps of S7, otherwise repeat the steps from S73 to S722, and the number of repetitions is the number of points in the global occlusion point list;

[0174] S72, create a new counter "i", with an initial value of 0;

[0175] S73, obtaining the ith three-dimensional point in the global occlusion point list, referred to as the “ith global occlusion point”, and for the convenience of observation, drawing a circle at the ith global occlusion point with an arbitrary radius;

[0176] S74. Obtain all contour lines that may be blocked by the ith global blocking point. The contour lines that may be blocked by the ith global blocking point meet three screening conditions: first, the elevation is less than the elevation of the ith global blocking point; second, it is in contact with the aphelion end of the line to be measured with the ith global blocking point as the boundary when looking down; third, when the sunlight starting from the ith global blocking point shines downward to the elevation equal to the lowest height of the field, the sunlight has touched the bottom, and the ith global blocking point can no longer block any contour lines in the direction of the light's advance; based on the third condition, calculate the direction from the two-dimensional coordinates of the ith three-dimensional intersection point as the starting point to the aphelion end of the line to be measured when calling the ssget function. The two-dimensional coordinates of the end point of the two-dimensional frame line segment extending from the end to the end are known. The coordinates of the i-th global occlusion point (xi,yi,zi), the 1m height sun ray vector (dx,dy,1), and the lowest height of the field hmin are known. The coordinates of the end point of the frame line segment can be calculated as (xi+(zi-hmin)*dx,yi+(zi-hmin)*dy). Call the ssget function to filter all the contour lines whose elevations of the contact segments ((xi,yi), (xi+(zi-hmin)*dx,yi+(zi-hmin)*dy)) are less than zi and add them to the selection set. This selection set is called the "i-th contour line selection set to be calculated";

[0177] S75, create a new counter "j", with an initial value of 0;

[0178] S76, create a new empty table "i-th contour line parameter list to be calculated";

[0179] S77, repeating the steps from S78 to S714, the number of repetitions being the number of contour lines in the i-th contour line list to be calculated;

[0180] S78. Obtain the jth contour line in the i-th list of contour lines to be calculated, referred to as the "jth contour line to be calculated", obtain the elevation, vertex list, and closure of the j-th contour line to be calculated, obtain all two-dimensional line segments of the j-th contour line to be calculated through the vertex list and closure, obtain the two-dimensional intersection points of the frame line ((xi,yi), (xi+(zi-hmin)*dx, yi+(zi-hmin))) and all line segments of the j-th contour line to be calculated, remove the two-dimensional intersection points that overlap with the i-th global occlusion point in the top-down perspective, and add the obtained two-dimensional intersection points to a list, referred to as the "j-th two-dimensional intersection point list".

[0181] S79, create a new counter "k", with an initial value of 0;

[0182] S710, repeatedly executing steps S711 to S713, the number of repetitions being the number of two-dimensional points in the j-th two-dimensional intersection point list;

[0183] S711, obtain the kth two-dimensional point in the jth two-dimensional intersection point list, referred to as the "kth two-dimensional point", with coordinates (xk, yk);

[0184] S712, calculate the height of the sunlight starting from the ith global occlusion point and falling on the kth two-dimensional point = sqrt(((xk-xi)^2+(yk-yi)^2) / (dx^2)+dy^2)), the height minus the elevation of the jth contour line to be calculated is the height difference of the sunlight at the kth two-dimensional point to the ground, combine the height difference and the elevation of the jth contour line to be calculated with the kth two-dimensional point and add them to the parameter list of the ith contour line to be calculated;

[0185] S713, increment the counter k by 1;

[0186] S714, increment the counter j by 1;

[0187] S715. At this time, a complete list of parameters of the i-th contour line to be calculated has been obtained. The CAD extension function vl-sort is called to sort the elements in the list of parameters of the i-th contour line to be calculated and update the list of parameters of the i-th contour line to be calculated. The list is arranged in descending order according to the two-dimensional coordinates stored in each element in the list and the overhead distance from the i-th global occlusion point;

[0188] S716, create a new counter "j", with an initial value of 1;

[0189] S717, when j is less than the number of elements in the i-th contour line parameter list to be calculated, the steps S718 to S720 are executed in a loop;

[0190] S718. Obtain the height difference between the sunlight and the ground stored in the jth element in the i-th contour line parameter list. If the height difference is less than 0, that is, the i-th global occlusion point cannot block the contour line at the two-dimensional coordinates stored in the j-th element in the i-th contour line parameter list, then the two-dimensional coordinates of the end point of the occlusion line starting from the i-th global occlusion point must be located on the line segment from the two-dimensional coordinates stored in the j-th element in the i-th contour line parameter list to the two-dimensional coordinates stored in the j-th minus 1 element; refer to the attached Figure 8 , A3 represents the three-dimensional coordinates of the point on the contour line stored in the j-th element in the i-th contour line parameter list to be calculated, B3 represents the three-dimensional coordinates of the point on the contour line stored in the j-th minus 1 element in the i-th contour line parameter list to be calculated, C3 represents the i-th global occlusion point, all the inputs of the slope-intercept equation principle for finding the intersection point described in S215 are known, the slope-intercept equation principle for finding the intersection point is called to find the three-dimensional coordinates of the end point of the occlusion line starting from the i-th global occlusion point and a straight line is drawn as the occlusion line;

[0191] S719, if the drawing in S718 has been executed, adjust j so that its value is equal to the number of elements in the i-th contour line parameter list to be calculated, so as to jump out of the loop in S717;

[0192] S720, increment the counter j by 1;

[0193] S721. At this time, the loop described in S717 has been jumped out. If the drawing described in S718 has not been executed, that is, the i-th global occlusion point is capable of blocking the three-dimensional intersection of the last contour line in the far-day direction of the facade to be measured and the facade to be measured, then it is stipulated that the horizontal and vertical coordinates (x, y) of the end point of the occlusion line starting from the i-th global occlusion point should be equal to the horizontal and vertical coordinates of the three-dimensional intersection of the last contour line in the far-day direction of the facade to be measured and the facade to be measured, and the height z of the end point is calculated as sqrt(((xi-x)^2+(yi-y)^2) / (dx^2)+dy^2)), and a straight line is drawn from the i-th global occlusion point as the starting point as the occlusion line;

[0194] S722, increment the counter i by 1;

[0195] S723. At this time, all the occlusion lines starting from the global occlusion point on the facade to be measured have been drawn, as shown in the attached figure. Figure 7 .

[0196] The expansion of step S8 includes:

[0197] S81. Obtain the frame line multiple and the lowest height of the field area from the contour map, and draw the shielding line of the entire field area;

[0198] S81-1. Take a series of two-dimensional points on the line segment that runs through the entire field area at equal distances on the entire contour map, and use each of the two-dimensional points as the test points to sequentially execute a method for drawing a mountain shadow passing through a certain point on the contour map based on CAD to obtain the occlusion line on the entire contour map. The specific method is as follows;

[0199] S81-2, the operator inputs the contour layer, the east-west component of the sun ray vector at 1m height, and the north-south component of the sun ray vector at 1m height;

[0200] S81-3, the operator selects all contour lines within the range where the shielding line is desired to be drawn and adds them to a selection set, which is called a "contour line selection set";

[0201] S81-4, traverse all contour lines in the contour line selection set, obtain the minimum value of all contour line elevations, and use it as the lowest height of the site;

[0202] S81-5. Call the CAD extension function "vla-GetBoundingBox" to traverse the lower left corner and upper right corner of the rectangular outer contour of each contour line in the contour selection set, obtain the minimum x-coordinate value xmin and the minimum y-coordinate value ymin from all lower left corners, and obtain the maximum x-coordinate value xmax and the maximum y-coordinate value ymax from all upper right corners, and finally obtain the lower left corner (xmin, ymin), upper right corner (xmax, ymax), upper left corner (xmin, ymax), and lower right corner (xmax, ymin) of the rectangular outer contour of the entire contour map, and obtain the diagonal length L;

[0203] S81-6. According to the positive and negative properties of the east-west component dx of the sun vector, determine from which corner of the rectangular outer contour of the contour map to start taking a series of two-dimensional points as the test points. If dx ≥ 0, start taking points from the lower right corner, otherwise start taking points from the lower left corner;

[0204] S81-7, the operator inputs the step length dl of the test point string, that is, the overlooking distance between the two test points of the vector, that is, the parallel distance between the two adjacent blocking lines to be drawn, and then specifies the east-west component of the step length dLx=dL*|dy| / sqrt(dx^2+dy^2). If the test point string extends from the lower left corner, dLx should be updated to its opposite number, and the north-south component of the step length dLy=dL*|dx| / sqrt(dx^2+dy^2);

[0205] S81-8. The value of the frame line multiple parameter should ensure that when the ssget function is called to obtain the contour line selection set, the frame line segments obtained along the two sides of the test line at each test point are able to touch all the contour lines that intersect the contour line and the test elevation. The frame line multiple corresponding to each test point can be L / sqrt(dx^2+dy^2) or above. This value can ensure that the frame line length meets the requirements under the most unfavorable conditions. It can also calculate the most appropriate frame line length for each test point according to the actual situation of each test point and then obtain the most appropriate frame line multiple. This expansion document does not make mandatory provisions; refer to the attached Fig. 9 , Attachment Fig.10 , no matter from which direction the non-vertical sunlight shines, the frame line with a single side length of L at each point to be measured is sufficient to cover all contour lines intersecting with the facade to be measured;

[0206] S81-9 starts from the lower left corner or the lower right corner as the first point to be tested according to the provisions of S81-6, updates the point to be tested every other step and executes the method of drawing the occlusion line described in the present invention until the sequence number of the point to be tested exceeds the quotient of the diagonal length divided by the step length, that is, until the facade to be tested moves to a position where it is impossible to intersect with any contour line. The resulting effect diagram is as shown in the attached figure. Fig.11 As shown;

[0207] S82. Description of calculating the coordinates of the end point of the occlusion line;

[0208] S82-1. The present invention adopts the principle of finding the intersection point by using the slope-intercept equation when calculating the three-dimensional coordinates of the end point of the occluding line. The advantage of this principle is that it is simple and clear and highly adaptable to the present invention. The disadvantage is that the number of known points referenced during the calculation is small, resulting in a one-sided calculation result. In extreme cases, the calculated value of the three-dimensional coordinates of the end point of the occluding line deviates slightly from the actual value.

[0209] S82-2. Mountain photovoltaic projects usually require that the bottom edge of the photovoltaic array must be at least several meters above the ground. The leaves of mountain crops may also be at a certain height from the ground. In theory, the height requirement of the end point of the shielding line should be considered when drawing the shielding line in the present invention. However, the present invention cannot achieve this at present. The main reason is that the present invention adopts the principle of finding the intersection point by the slope-intercept equation. Figure 8 If one wants to calculate the coordinates of the end point of the occlusion line at a fixed height above the ground, the end point position will inevitably move toward the perihelion compared to the attached figure, which may cause the end point of the occlusion line to fall to the right of B3. At this time, it is necessary to use the terrain from A3 to B3 to linearly deduce the terrain on the right side of B3, which greatly amplifies the one-sidedness of the principle of finding the intersection point by the one-sided slope-intercept equation. In extreme cases, the end point of the occlusion line may be higher than the starting point, and the occlusion line has no reference value. Therefore, the present invention temporarily only considers drawing the occlusion line at 0m from the ground. If the height above the ground needs to be considered, a more comprehensive algorithm can be used to calculate the height of the contour line on the right side of B3.

Claims

1. A method for drawing a mountain shadow passing through a certain point on a contour map based on CAD, characterized in that: The following steps are involved: S1: Collect standardized contour drawings; S2: Define the input parameters of the test point, contour layer, maximum box selection length, east-west component of the sun ray vector at 1m height, north-south component of the sun ray vector at 1m height, and the lowest height of the field; define the concept of the test line, the test elevation, the three-dimensional intersection, the profile of the mountain to be tested, the perihelion, the aphelion, the ability to block, the local block, the global block, the blocking line, and the principle of finding the intersection point using the slope-intercept equation; S3: Obtain all contour lines that touch the facade to be measured; S4: Obtain the three-dimensional intersection points of the facade to be measured and all contour lines; S5: Filter out all local occlusion points from the three-dimensional intersection points in step S4; S6: Filter out all global occlusion points from all local occlusion points in step S5; S7: Draw occlusion lines with all the global occlusion points in step S6 as starting points.

2. The method for drawing a mountain shadow passing through a certain point on a contour map based on CAD according to claim 1, characterized in that: The collection of standardized contour drawings follows the following principles: All contour lines in the drawing must be of polyline type; The height of the contour lines in the drawing should be reflected in the elevation parameters of the polyline; Each contour line in the drawing must be composed of straight line segments, and the line segments must not be curved; Contour lines in drawings must not cross or overlap; All contour lines in a drawing must be on the same layer.

3. The method for drawing a mountain shadow passing through a certain point on a contour map based on CAD according to claim 1, characterized in that: The step S3 comprises: S31, determining whether the point to be measured is a three-dimensional point, if it is a three-dimensional point, changing the point to be measured to a two-dimensional point; S32, from the top-down perspective, translate the frame line multiple times from the point to be measured to the positive direction of the sun ray vector at a height of 1m, and obtain a two-dimensional point, called "point 1", and translate the frame line multiple times from the point to be measured to the reverse direction of the sun ray vector at a height of 1m, and obtain a two-dimensional point, called "point 2", and obtain a line segment (point 1, point 2) of sufficient length; S33, calling the ssget function, adding all the contour lines of the contact line segment (point 1, point 2) into a selection set, called "contour line selection set to be tested"; S34. If the contour selection set to be tested does not contain any graphics element, define "direct end flag" as "yes".

4. The method for drawing a mountain shadow passing through a certain point on a contour map based on CAD according to claim 3, characterized in that: The step S4 comprises: S41: If the direct end flag is "yes", the remaining steps of S4 are not executed, otherwise the steps from S44 to S45 are repeated, and the number of repetitions is the number of contour lines in the contour line selection set to be tested; S42: Create a new counter "i", with an initial value of 0; S43: Create a new empty table "3D intersection list"; S44: Obtain the elevation, vertex list, and closure of the i-th contour line in the selected set of contour lines to be measured, obtain all two-dimensional line segments of the contour line through the vertex list and closure, obtain the two-dimensional intersection points of the line segment (point 1, point 2) and all line segments of the contour line, combine the elevation of the contour line with these two-dimensional intersection points to obtain all three-dimensional intersection points of the facade to be measured and the i-th contour line in the selected set, and add these three-dimensional intersection points to the three-dimensional intersection point list; S45: increment the counter i by 1; S46: At this point, a complete three-dimensional intersection point list has been obtained, and overlapping three-dimensional intersection points in the three-dimensional intersection point list are deleted so that the elements in the list are different; S47: Create a new concept "sunlight direction". If the absolute value of the east-west component of the sunlight vector at 1m height is greater than or equal to the absolute value of the north-south component, the sunlight direction is set to 0, otherwise it is set to 1. S48: When the following conditions are met: the direction of the sun's rays is 0 and the sun's rays vector is biased to the west, or the direction of the sun's rays is 1 and the sun's rays vector is biased to the south, the CAD extension function vl-sort is called to sort the elements in the three-dimensional intersection list and update the three-dimensional intersection list, and the order is arranged from small to large according to the th parameter value of the direction of the sun's rays of each three-dimensional point in the three-dimensional intersection list; otherwise, the CAD extension function vl-sort is called to sort the elements in the three-dimensional intersection list and update the three-dimensional intersection list, and the order is arranged from large to small according to the th parameter value of the direction of the sun's rays of each three-dimensional point in the three-dimensional intersection list; this step ultimately makes the three-dimensional points in the three-dimensional intersection list arranged in order from the farthest end to the closest end.

5. The method for drawing a mountain shadow passing through a certain point on a contour map based on CAD according to claim 4, characterized in that: The step S5 comprises: S51: If the direct end flag is "yes", the remaining steps of S5 are not executed, otherwise the steps from S56 to S511 are repeated, and the number of repetitions is the number of points in the three-dimensional intersection point list minus 1; S52: Find the cosecant value of the angle between the sun ray and the horizontal plane, which is equal to the length of the sun ray vector at a height of 1 m divided by the overhead length of the sun ray vector at a height of 1 m; S53: Create a new counter "i", with an initial value of 0; S54: Create a new empty table "local occlusion point list"; S55: Create a new proposition 2, with an initial value of "No", which is used to indicate whether the terrain 2 is greater than the angle between the sun's rays and the horizontal plane; S56: obtaining the ith 3D point in the 3D intersection point list, referred to as "point 1", obtaining the ith plus 1 th 3D point in the 3D intersection point list, referred to as "point 2", and the 3D line segment formed by point 1 and point 2 is referred to as the "ith 3D line segment"; S57: assign the value of Proposition 2 to Proposition 1 to indicate whether the terrain 1 is greater than the angle between the sun's rays and the horizontal plane. If the terrain 1 does not exist, the corresponding value of Proposition 1 is "No". S58: If the heights of point 1 and point 2 are equal, then let the cosecant value of the angle between the i-th three-dimensional line segment and the horizontal plane be equal to 1; if point 2 is higher than point 1, then let the cosecant value of the angle between the i-th three-dimensional line segment and the horizontal plane be equal to the three-dimensional distance between point 1 and point 2 divided by the overhead distance between point 1 and point 2; if point 2 is lower than point 1, then let the cosecant value of the angle between the i-th three-dimensional line segment and the horizontal plane be equal to negative 1 multiplied by the three-dimensional distance between point 1 and point 2 divided by the overhead distance between point 1 and point 2; S59: If the cosecant value of the angle between the i-th three-dimensional line segment and the horizontal plane is greater than the cosecant value of the angle between the sun's rays and the horizontal plane, then let Proposition 2 be "yes", otherwise let Proposition 2 be "no"; S510: If i is equal to the number of points in the three-dimensional intersection point list minus 2, that is, the i-th three-dimensional line segment is the last three-dimensional line segment in the three-dimensional intersection point list in the near-south direction, then if Proposition 2 holds, point 1 is added to the local occlusion point list; if i is not equal to the number of points in the three-dimensional intersection point list minus 2, that is, the i-th three-dimensional line segment is not the last three-dimensional line segment in the three-dimensional intersection point list in the near-south direction, then if Proposition 1 holds and Proposition 2 does not hold, point 1 is added to the local occlusion point list; S511: increment the counter i by 1; S512: At this time, a complete list of local occlusion points has been obtained. If the local occlusion point list is an empty table, that is, there is no mountain occlusion on the facade to be measured, then define the "direct end flag" as "yes", otherwise delete the overlapping local occlusion points in the local occlusion point list so that the elements in the list are different.

6. The method for drawing a mountain shadow passing through a certain point on a contour map based on CAD according to claim 4, characterized in that: The step S6 comprises: S61: If the direct end flag is "yes", the remaining steps of S6 are not executed, otherwise the steps of S65 to S68 are repeated, and the number of repetitions is the number of points in the local occlusion point list minus 1; S62: transposing the local occlusion point list, that is, arranging the three-dimensional points in the local occlusion point list in order from the perihelion to the aphelion; S63: Create a new counter "i", with an initial value of 1; S64: Create a new list "global occlusion point list". Because any point on the contour line cannot occlude the first local occlusion point of the perihelion, the initial value of the global occlusion point list is set to store the first 3D point of the local occlusion point list. S65: Obtain the i-th point in the local occlusion point list, referred to as "point 3"; S66: Obtain the last point in the global occlusion point list, referred to as "point 4"; S67: If the sunlight starting from point 4 can fall directly below point 3, that is, the local occlusion point 3 (x3, y3, z3) cannot be blocked by the global occlusion point 4 (x4, y4, z4), which is reflected as z3>z4-sqrt(((x4-x3)^2+(y4-y3)^2) / (dx^2+dy^2)), where dx and dy are the east-west component and north-south component of the sunlight vector at a height of 1m, respectively, then point 3 is added to the global occlusion point list; S68: increment the counter i by 1; S69: At this point, a complete global occlusion point list has been obtained.

7. The method for drawing a mountain shadow passing through a certain point on a contour map based on CAD according to claim 6, characterized in that: The step S7 comprises: S71: If the direct end flag is "yes", the remaining steps of S7 are not executed, otherwise the steps from S73 to S722 are repeated, and the number of repetitions is the number of points in the global occlusion point list; S72: Create a new counter "i", with an initial value of 0; S73: obtaining the ith three-dimensional point in the global occlusion point list, referred to as the "ith global occlusion point", and for the convenience of observation, drawing a circle at the ith global occlusion point with an arbitrary radius; S74: Obtain all contour lines that may be blocked by the i-th global blocking point. The contour lines that may be blocked by the i-th global blocking point meet three screening conditions: first, the elevation is less than the elevation of the i-th global blocking point; second, it is in contact with the aphelion end of the line to be measured with the i-th global blocking point as the boundary from a bird's-eye view; third, when the sunlight starting from the i-th global blocking point shines downward to an elevation equal to the lowest height of the field, the sunlight has touched the bottom, and the i-th global blocking point can no longer block any contour lines in the direction of the light's advance; based on the third condition, calculate the direction from the two-dimensional coordinates of the i-th three-dimensional intersection point as the starting point to the aphelion end of the line to be measured when calling the ssget function. The 2D coordinates of the end point of the 2D frame line segment extending from the end to the end are known. The coordinates of the ith global occlusion point (xi,yi,zi), the 1m height sun ray vector (dx,dy,1), and the lowest height hmin of the field area are known. The coordinates of the end point of the frame line segment can be calculated as (xi+(zi-hmin)*dx,yi+(zi-hmin)*dy). Call the ssget function to filter all the contour lines whose elevations of the contact line segments ((xi,yi), (xi+(zi-hmin)*dx,yi+(zi-hmin)*dy)) are less than zi and add them to the selection set. This selection set is called the "i-th contour line selection set to be calculated"; S75: create a new counter "j", with an initial value of 0; S76: Create a new empty table "i-th contour line parameter list to be calculated"; S77: Repeat the steps from S78 to S714, and the number of repetitions is the number of contour lines in the i-th contour line list to be calculated; S78: Obtain the jth contour line in the i-th list of contour lines to be calculated, referred to as the "jth contour line to be calculated", obtain the elevation, vertex list, and closure of the j-th contour line to be calculated, obtain all two-dimensional line segments of the j-th contour line to be calculated through the vertex list and closure, obtain the two-dimensional intersection points of the frame line ((xi,yi), (xi+(zi-hmin)*dx, yi+(zi-hmin))) and all line segments of the j-th contour line to be calculated, and remove the two-dimensional intersection points that overlap with the i-th global occlusion point in the top-down perspective, and add the obtained two-dimensional intersection points to the list, referred to as the "j-th two-dimensional intersection point list"; S79: Create a new counter "k", with an initial value of 0; S710: Repeat the steps S711 to S713, and the number of repetitions is the number of two-dimensional points in the j-th two-dimensional intersection point list; S711: Obtain the kth two-dimensional point in the jth two-dimensional intersection point list, referred to as the "kth two-dimensional point", with coordinates (xk, yk); S712: Calculate the height of the sunlight from the ith global occlusion point to the kth two-dimensional point = sqrt(((xk-xi)^2+(yk-yi)^2) / (dx^2)+dy^2)), the height minus the elevation of the jth contour line to be calculated is the height difference of the sunlight at the kth two-dimensional point to the ground, combine the height difference and the elevation of the jth contour line to be calculated with the kth two-dimensional point and add them to the parameter list of the ith contour line to be calculated; S713: increment the counter k by 1; S714: increment the counter j by 1; S715: At this time, the complete list of parameters of the i-th contour line to be calculated has been obtained, and the CAD extension function vl-sort is called to sort the elements in the list of parameters of the i-th contour line to be calculated and update the list of parameters of the i-th contour line to be calculated, and the order is arranged from small to large according to the two-dimensional coordinates stored in each element in the list and the overhead distance from the i-th global occlusion point; S716: Create a new counter "j", with an initial value of 1; S717: When j is less than the number of elements in the i-th contour line parameter list to be calculated, the steps S718 to S720 are executed in a loop; S718: Get the height difference between the sun's rays and the ground stored in the jth element in the i-th contour line parameter list. If the height difference is less than 0, that is, the i-th global occlusion point cannot block the contour line at the two-dimensional coordinates stored in the j-th element in the i-th contour line parameter list, then the two-dimensional coordinates of the end point of the occlusion line starting from the i-th global occlusion point must be located in the line segment from the two-dimensional coordinates stored in the j-th element in the i-th contour line parameter list to the two-dimensional coordinates stored in the j-th minus 1 element. A3 represents the three-dimensional coordinates of the point on the contour line stored in the j-th element in the i-th contour line parameter list to be calculated, B3 represents the three-dimensional coordinates of the point on the contour line stored in the j-th minus 1 element in the i-th contour line parameter list to be calculated, C3 represents the i-th global occlusion point, all the inputs of the slope-intercept equation principle for finding the intersection point described in S215 are known, the slope-intercept equation principle for finding the intersection point is called to find the three-dimensional coordinates of the end point of the occlusion line starting from the i-th global occlusion point and a straight line is drawn as the occlusion line; S719: If the drawing in S718 has been executed, j is adjusted to make its value equal to the number of elements in the i-th contour line parameter list to be calculated, so as to jump out of the loop in S717; S720: increment the counter j by 1; S721: At this time, the loop described in S717 has been jumped out. If the drawing described in S718 has not been executed, that is, the i-th global occlusion point is capable of blocking the three-dimensional intersection of the last contour line in the far-day direction of the facade to be measured and the facade to be measured, then it is stipulated that the horizontal and vertical coordinates (x, y) of the end point of the occlusion line starting from the i-th global occlusion point should be equal to the horizontal and vertical coordinates of the three-dimensional intersection of the last contour line in the far-day direction of the facade to be measured and the facade to be measured, and the height z of the end point is calculated as sqrt(((xi-x)^2+(yi-y)^2) / (dx^2)+dy^2)), and a straight line is drawn from the i-th global occlusion point as the starting point as the occlusion line; S722: increment the counter i by 1; S723: At this point, all the occlusion lines starting from the global occlusion point on the facade to be measured have been drawn.

8. A system for drawing mountain shadows at a certain point on a contour map based on CAD, characterized in that: Used to implement the method in any one of claims 1 to 7.