CN109035364B - Method for rapidly drawing section based on CAD topographic map - Google Patents

Method for rapidly drawing section based on CAD topographic map Download PDF

Info

Publication number
CN109035364B
CN109035364B CN201810810469.XA CN201810810469A CN109035364B CN 109035364 B CN109035364 B CN 109035364B CN 201810810469 A CN201810810469 A CN 201810810469A CN 109035364 B CN109035364 B CN 109035364B
Authority
CN
China
Prior art keywords
line
section line
section
coordinates
point
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810810469.XA
Other languages
Chinese (zh)
Other versions
CN109035364A (en
Inventor
徐飞
唐丽伟
焦玉国
魏凯
吴亚楠
赵新村
王延岭
夏学生
周绍智
陈伟清
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fifth Geological Brigade of Shandong Provincial Bureua of Geology and Mineral Resources of Fifth Geological and Mineral Exploration Institute of Shandong Province
Original Assignee
Fifth Geological Brigade of Shandong Provincial Bureua of Geology and Mineral Resources of Fifth Geological and Mineral Exploration Institute of Shandong Province
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fifth Geological Brigade of Shandong Provincial Bureua of Geology and Mineral Resources of Fifth Geological and Mineral Exploration Institute of Shandong Province filed Critical Fifth Geological Brigade of Shandong Provincial Bureua of Geology and Mineral Resources of Fifth Geological and Mineral Exploration Institute of Shandong Province
Priority to CN201810810469.XA priority Critical patent/CN109035364B/en
Publication of CN109035364A publication Critical patent/CN109035364A/en
Application granted granted Critical
Publication of CN109035364B publication Critical patent/CN109035364B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/203Drawing of straight lines or curves
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/20Drawing from basic elements, e.g. lines or circles
    • G06T11/206Drawing of charts or graphs

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention relates to the field of engineering drawing, in particular to a method for rapidly drawing a section view based on a CAD topographic map, which can rapidly acquire the intersection points and elevations of a section line and a series of contour lines and rapidly generate the section view. The method comprises the following steps: step 1: drawing a section line; step 2: judging the type of the section line; step 3: establishing a selection set of contour lines and collecting and sequencing intersection points; step 4: and obtaining coordinates, elevations and drawing sectional views of intersection points of the section lines and the contour lines. According to the method for rapidly drawing the section based on the CAD topographic map, which is disclosed by the invention, a user draws a section line by himself on the basis of the topographic map with the contour lines, and through the steps, the intersection points and the elevations of the section line and a series of contour lines can be rapidly obtained, the number of the intersection points can be infinite, and the section map can be rapidly generated.

Description

Method for rapidly drawing section based on CAD topographic map
Technical Field
The invention relates to the field of engineering drawing, in particular to a method for rapidly drawing a section view based on a CAD topographic map, which can rapidly acquire the intersection points and elevations of a section line and a series of contour lines and rapidly generate the section view.
Background
Topography refers to a projection of the topography and geographic location, shape on a horizontal plane. Specifically, the ground features and the landforms are projected horizontally (projected onto a horizontal plane along a plumb line) and drawn on a drawing on a scale, and the drawing is called a topography. Drawing a section line on the topographic map, and drawing the orthographic projection of the section line and the intersected contour line to obtain a figure which is a sectional view.
The cross-sectional view has wide application in engineering design report construction of hydraulic engineering ring geology, highway municipal engineering, railway and coal mine geology, and in the prospected ore deposit, when the ore body is transected into a plurality of sections by a series of sections (cross sections), then the ore block reserves between two adjacent sections and the reserves of the whole ore deposit can be estimated based on the cross-sectional views, so that the cross-sectional view has important application in a plurality of industry fields.
Engineering technicians need to calculate intersection point distances and elevations of section lines and contour lines one by one when drawing a section view, and then the section lines and the contour lines are displayed and painted on a drawing, so that the operation is complicated and the workload is large in the drawing process, a large amount of working time of the technicians is occupied, the efficiency is extremely low, and the accuracy of drawing results is difficult to guarantee due to the large workload.
Disclosure of Invention
In view of the above, the present invention aims to overcome the defects of the prior art, and provides a method for rapidly obtaining the intersection points and the elevations of a section line and a series of contour lines and rapidly generating a section view based on CAD topographic map.
The technical scheme adopted for solving the technical problems is as follows: the method comprises the following steps:
step 1: a cross-hatching is drawn. Opening a CAD topographic map file for drawing the profile on a CAD, drawing a section line at the position of the CAD topographic map for drawing the profile, and setting the elevation or Z value of the section line to be 0;
step 2: and judging the type of the section line. The types of section lines include straight lines and multi-section lines.
If the section line is a straight line, recording a starting point coordinate and an end point coordinate of the section line;
if the section line is a multi-section line, the starting point coordinate, the inflection point coordinate and the end point coordinate of the section line are recorded.
Step 3: and establishing a selection set of contour lines and collecting and sequencing intersection points. According to the starting point coordinate, the inflection point coordinate and the end point coordinate of the section line, a selection set is firstly created, wherein the selection set comprises all contour lines intersected with the section line, and then the intersection point of each contour line in the selection set and the section line is collected and sequenced.
Step 4: and obtaining coordinates, elevations and drawing sectional views of intersection points of the section lines and the contour lines. And (3) obtaining the coordinates and the elevations of the ith points of the section lines and the contour lines, recording the coordinates and the elevations of the ith points in an array, and drawing a section view according to the data in the array.
Further, in order to better implement the present invention, the following arrangement structure is adopted: the type of section line is identified by reading the name of the section line through the name attribute in step 2.
Further, in order to better implement the present invention, the following arrangement structure is adopted: in the step 2 described above, the process is carried out,
if the cross-sectional line is a straight line, the start point coordinate and the end point coordinate of the straight line are read and marked as (x 1 ,y 1 ),(x 2 ,y 2 );
If the section line is a multi-section line, acquiring the starting point coordinate, the inflection point coordinate and the end point coordinate of the multi-section line through the coordinates of the points, and recorded, the starting point coordinates are (x 1 ,y 1 ) Endpoint coordinates are (x n ,y n ) The inflection point is (x from left 2 ,y 2 )…(x n-1 ,y n-1 ) When the program reads the coordinates of the starting point, the inflection point and the end point of the multi-section line, the program defaults to read according to the drawing sequence of the points of the multi-section line, so that the coordinates of the starting point, the inflection point and the end point are continuously recorded in the array in sequence.
Further, in order to better implement the present invention, the following arrangement structure is adopted: in the step (3) of the process,
first, according to the starting point when the section line is a straight lineThe coordinates, the end point coordinates, or the starting point coordinates, the inflection point coordinates and the end point coordinates when the section line is a multi-section line acquire extreme values of an X region and a Y region of the position occupied by the section line, which are respectively X min ,y min ,x max ,y max
Then, a lower left corner coordinate is plotted as (x min ,y min ) The upper right corner coordinates are (x max ,y max ) Is a rectangular frame of (2);
finally, all contours within and through the rectangular box are defined by the SelectByPolygon method as a new selection set.
Further, in order to better implement the present invention, the following arrangement structure is adopted: in the step (3) of the process,
if the section line is a straight line, reading the number of items in the selection set through the count attribute, and traversing each object in the selection set to obtain an intersection point of each object and the section line;
if the section line is a multi-section line, the number of items in the selection set is read through the count attribute, then each object in the selection set is traversed, and every two adjacent points are used as a line segment according to the sequence of the starting point, the inflection point and the end point, and the intersection point is obtained with each object in the selection set in sequence.
Further, in order to better implement the present invention, the following arrangement structure is adopted: in the step (3) of the process,
if the section line is a straight line, the following steps are carried out:
step 3.1: reading a first object in the selection set, and recording an elevation value or a Z value of the object in a variable h;
step 3.2: setting the elevation value or Z value of the first object in the selection set to 0, thereby ensuring that the contour line and the section line are simultaneously arranged in an XOY plane;
step 3.3: the intersection point value of the object in the selection set and the section line is obtained by using an intersectwidth method, and the intersection point coordinates are recorded in a first array, so that the (x, y) coordinates of the intersection point are obtained, besides the condition that one contour line and the section line have one intersection point, the condition that one contour line and the section line have two or more intersection points, and when the intersectwidth method obtains the intersection point, the condition that the contour line and the section line have two or more intersection points is sequentially recorded in the first array:
step 3.4: setting Z values of all intersection points in the first array as h, wherein the h is the elevation of the object in the selection set in the step 3.2;
step 3.5: resetting the elevation value or Z value of the object in the selection set to h;
step 3.6: identifying the number of intersection points of the object and the cross-point line, and recording X, Y, Z values of all intersection points in the first array in a new two-dimensional array sCJ (a, b), wherein the a dimension in the array sCJ (a, b) is 3, namely the a dimension respectively represents X, Y, Z values, and the b dimension increases along with the increase of the number of intersection points, namely the number of all intersection points of the cross-point line and the selected object;
step 3.7: clearing the first array;
step 3.8: returning to the step 3.1, and acquiring an intersection point of the next object in the selection set and the section line;
step 3.9: after all objects in the selection set are traversed, all the contour lines intersecting with the section line or the intersection points of objects with elevations are obtained, and X, Y, Z values of all the intersection points are recorded in sCJ (a, b);
if the section line is a multi-segment line, the multi-segment line is obtained from the coordinates attribute, and the multi-segment line is composed of n-1 line segments, the starting point, the inflection point and the end point are sequentially connected into straight lines, and each straight line is sequentially executed with steps 3.1-3.9, so that an array of n-1 record intersection points, namely sCJ (a, b), sCJ (a, b), … … and scJn-1 (a, b) can be obtained.
Further, in order to better implement the present invention, the following arrangement structure is adopted: in step 3, the collected intersections are ordered by:
if it is a straight line:
comparing section line x 1 And x 2 Or y 1 And y is 2 Then ordering the intersections in sCJ (a, b) according to the determined direction, and after ordering, the intersections in sCJ (a, b) are orderedPoints are all intersection points along the section line direction.
If the multi-section line is:
comparative section line x 1 ,x 2 ,……,x n-1 ,x n Or y 1 ,y 2 ,……,y n-1 ,y n The horizontal or vertical coordinates of each two adjacent points are compared from left to right in consideration of the drawing direction of the multi-segment line, if x k <x k+1 Or y k <y k+1 (k is N, and k is more than or equal to 1 and less than or equal to N-1), the intersection points in the corresponding sCJk (a, b) are ordered in the left-to-right order (conversely, the intersection points in the corresponding sCJk (a, b) are ordered in the right-to-left order), and after all N-1 groups are ordered, the intersection points in the sCJk (a, b) are all intersection points along the drawing direction of a section line (a multi-section line).
Further, in order to better implement the present invention, the following arrangement structure is adopted: in step 4, the coordinates and the elevation of the ith point on the section line are obtained by the following steps:
if the section line is a straight line:
using the distance formula between two points to find the cross point and cross line (x) in sCJ (a, b) 1 ,y 1 ) If it is a distance from (x 2 ,y 2 ) Beginning ordering of the ends, x in the following formula 1 And y is 1 Replaced by x 2 And y is 2 ):
The sCJ (0, i) is the x coordinate of the ith point in sCJ (a, b);
the sCJ (1, i) is the y coordinate of the ith point in sCJ (a, b);
d is calculated i I.e. the x-coordinate of the ith point on the XOY two-dimensional plane, and the z-value (i.e. sCJ (2, i)) in sCJ (a, i) is the elevation of the profile line reaction on the XOY two-dimensional plane, i.e. the y-coordinate of the profile line reaction on the XOY two-dimensional plane, when b=i;
if the section line is a multi-section line:
using the distance formula between two points to find the intersection point of sCJk (a, b) in the kth line segment and the cross section line (x) k ,y k ) Distance of (2):
the sCJk (0, i) is the x coordinate of the ith point in the sCJk (a, b);
the sCJk (1, i) is the y coordinate of the ith point in the sCJk (a, b);
the dK obtained i Namely, the kth line segment of the section line reflects the ith point relative to x on the XOY two-dimensional plane k The z value in sCJk (a, i) (i.e., sCJk (2, i)) is the elevation of the section line reaction on the XOY two-dimensional plane, i.e., the y coordinate of the section line reaction on the XOY two-dimensional plane, when b=i.
Further, in order to better implement the present invention, the following arrangement structure is adopted: in the step 4 of the process, the process is carried out,
if the section line is a straight line:
d to be found i As x-coordinates, sCJ (2, i) is recorded as y-coordinates in a new array sPM (a, b), the dimension of a in the array sPM (a, b) is 2, that is, the x-coordinates and y-coordinates representing the section line reaction on the XOY two-dimensional plane, and the dimension of b is equal to the number of intersection points;
if the section line is a multi-section line:
for the first line segment, the same method as that of the straight line is adopted, but from the kth line segment, dK is needed i Adding the lengths of all the preceding line segments as x-coordinates, correspondingly recording sCJk (2, i) as y-coordinates in an array sPM (a, b) containing the preceding line segment data, wherein the dimension of b should also increase along with the increase of the number of line segments and intersection points, and finally the dimension of a in the array sPM (a, b) is 2, namely representing the x-coordinates and the y-coordinates of the section line reaction on the XOY two-dimensional plane, and the dimension of b is equal to the number of intersection points of the whole multi-segment line.
Further, in order to better implement the present invention, the following arrangement structure is adopted: in step 4, a cross-sectional view of the topographic map cut by the section line can be drawn according to the data in the array sPM (a, b) and in combination with the required scale, and then a complete cross-sectional view can be obtained by slightly modifying.
The beneficial effects of the invention are as follows: the method for rapidly drawing the section based on the CAD topographic map is characterized in that a user only needs to draw a section line on a topographic map foundation with contour lines, the number of intersection points and elevations of the section line and the contour lines can be rapidly obtained through the steps, and the number of the intersection points can be infinite, so that the section line can be rapidly generated.
Drawings
In order to more clearly illustrate the embodiments of the invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flow chart of a method of the present invention for rapidly drawing a cross-sectional view based on CAD topographic maps.
Fig. 2 is a topographical view of example 1 in which the section line is straight.
FIG. 3 is a cross-sectional view taken when the cross-sectional line is a straight line in example 1.
Fig. 4 is a topographical view of example 2 in which the section line is a multi-segment line.
FIG. 5 is a sectional view of example 2, wherein the sectional line is a multi-sectional line.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be described in detail below. It is to be understood that the described embodiments are only some of the embodiments of the present invention and not all the embodiments. All other embodiments, based on the examples herein, which are within the scope of the invention as defined by the claims, will be within the scope of the invention as defined by the claims.
The most common cases of the method for rapidly drawing the sectional view based on the CAD topographic map comprise two cases, namely the case that the section line is a straight line and the case that the section line is a multi-section line. In hydraulic loop geology, coal mine geology, or in calculating deposit reserves, the drawing of cross-sectional views is typically performed using straight lines as cross-section lines; in the industries such as roads, railways, and tunnels, a plurality of segments are often used as cross-sectional lines for drawing cross-sectional views due to the meandering of roads.
The invention will now be described in further detail with reference to two examples of embodiments in connection with the accompanying drawings.
Example 1:
according to fig. 1 and 2, when the section line is a straight line, the method for rapidly drawing the section based on the CAD topographic map comprises the following steps:
step 1: as shown in fig. 2, a section line is drawn on the CAD topography at the position where the section is required to be drawn, the section line drawn in this embodiment is a straight line, and then the elevation or Z value of the section line is set to 0;
step 2: and judging the type of the section line. The section line drawn in this embodiment is a straight line, so the type of the section line is determined to be a straight line, and then the start point coordinate and the end point coordinate of the section line are recorded.
Step 3: and establishing a selection set of contour lines and collecting and sequencing intersection points. According to the starting point coordinates and the ending point coordinates of the section lines, a selection set is firstly created, wherein the selection set comprises all the contour lines intersected with the section lines, and then the intersection point of each contour line in the selection set and the section lines is collected and sequenced.
Step 4: and obtaining coordinates, elevations and drawing sectional views of intersection points of the section lines and the contour lines. And (3) obtaining the coordinates and the elevations of the ith points of the section lines and the contour lines, recording the coordinates and the elevations of the ith points in an array, and drawing a section view according to the data in the array.
The specific implementation process of each step is described in detail below:
1. the type of section line is identified by reading the name of the section line through the name attribute in step 2. In this embodiment, the name of the section line read according to the name attribute is "AcDbLine", so the type of the section line is determined to be a straight line.
2. The start and end coordinates of the line were read and noted as (x 1 ,y 1 ),(x 2 ,y 2 );
3. In step 3, a selection set of contours is established by:
firstly, extreme values of an X region and a Y region of a position occupied by a section line are obtained, wherein the extreme values are respectively X min ,y min ,x max ,y max The method comprises the steps of carrying out a first treatment on the surface of the X in the present embodiment min =1,y min =1,x max =2,y max =2。
Then, a lower left corner coordinate is plotted as (x min ,y min ) The upper right corner coordinates are (x max ,y max ) Is a rectangular frame of (2);
finally: all contours within and through the rectangular box are defined by the SelectByPolygon method as a new selection set.
4. In step 3, reading the number of items in the selection set by a count method, and traversing each object in the selection set to obtain an intersection point of each object and a section line;
5. in step 3, the intersections of all contours in the selection set with the section lines are collected by:
step 3.1: reading a first object in the selection set, and recording an elevation value or a Z value of the object in a variable h;
step 3.2: setting the elevation value or Z value of the first object in the selection set to 0, thereby ensuring that the contour line and the section line are simultaneously arranged in an XOY plane;
step 3.3: the intersection point value of the object in the selection set and the section line is obtained by using an intersectwidth method, and the intersection point coordinates are recorded in a first array, so that the (x, y) coordinates of the intersection point are obtained, besides the condition that one contour line and the section line have one intersection point, the condition that one contour line and the section line have two or more intersection points, and when the intersectwidth method obtains the intersection point, the condition that the contour line and the section line have two or more intersection points is sequentially recorded in the first array:
step 3.4: setting Z values of all intersection points in the first array as h, wherein the h is the elevation of the object in the selection set in the step 3.2;
step 3.5: resetting the elevation value or Z value of the object in the selection set to h;
step 3.6: identifying the number of intersection points of the object and the cross-point line, and recording X, Y, Z values of all intersection points in the first array in a new two-dimensional array sCJ (a, b), wherein the a dimension in the array sCJ (a, b) is 3, namely the a dimension respectively represents X, Y, Z values, and the b dimension increases along with the increase of the number of intersection points, namely the number of all intersection points of the cross-point line and the selected object;
step 3.7: clearing the first array;
step 3.8: returning to the step 3.1, and acquiring an intersection point of the next object in the selection set and the section line;
step 3.9: after all objects in the selection set are traversed, all the contour lines intersecting with the section line or the intersection points of objects with elevations are obtained, and X, Y, Z values of all the intersection points are recorded in sCJ (a, b);
6. in step 3, the collected intersections are ordered by the following steps.
Comparing section line x 1 And x 2 Or y 1 And y is 2 And then ordering the intersection points in sCJ (a, b) according to the determined direction, and after ordering, the intersection points in sCJ (a, b) are all intersection points along the section line direction.
7. In step 4, the coordinates and the elevation of the ith point on the section line are obtained by the following steps:
using the distance formula between two points to find the cross point and cross line (x) in sCJ (a, b) 1 ,y 1 ) If it is a distance from (x 2 ,y 2 ) Beginning ordering of the ends, x in the following formula 1 And y is 1 Replaced by x 2 And y is 2 ):
The sCJ (0, i) is the x coordinate of the ith point in sCJ (a, b);
the sCJ (1, i) is the y coordinate of the ith point in sCJ (a, b);
d is calculated i I.e., the x-coordinate of the ith point on the XOY two-dimensional plane, and the z-value in sCJ (a, i) (i.e., sCJ (2, i)) for the corresponding b=i is the elevation of the profile line on the XOY two-dimensional plane, i.e., the y-coordinate of the profile line on the XOY two-dimensional plane.
8. In step 4, d i As x-coordinates, sCJ (2, i) is recorded as y-coordinates in a new array sPM (a, b), the dimension of a in array sPM (a, b) being 2, i.e. representing the x-and y-coordinates of the section line reaction on the XOY two-dimensional plane, the dimension of b being equal to the number of intersection points.
9. Finally, in step 4, a cross-sectional view of the topographic map cut by the section line can be drawn according to the data in the array sPM (a, b) and in combination with the required scale, and then a complete cross-sectional view can be obtained by slightly modifying (see fig. 3).
Example 2:
according to fig. 1 and 4, when the section line is a multi-section line, the method for rapidly drawing the section based on the CAD topographic map comprises the following steps:
step 1: as shown in fig. 4, a section line is drawn on the CAD topography at the position where the section is required to be drawn, the section line drawn in this embodiment is a multi-section line, and then the elevation or Z value of the section line is set to 0;
step 2: and judging the type of the section line. The section line drawn in this embodiment is a multi-section line, so the type of the section line is determined to be a multi-section line, and then the start point coordinate, the inflection point coordinate, and the end point coordinate of the section line are recorded.
Step 3: and establishing a selection set of contour lines and collecting and sequencing intersection points. According to the starting point coordinate, the inflection point coordinate and the end point coordinate of the section line, a selection set is firstly created, wherein the selection set comprises all contour lines intersected with the section line, and then the intersection point of each contour line in the selection set and the section line is collected and sequenced.
Step 4: and obtaining coordinates, elevations and drawing sectional views of intersection points of the section lines and the contour lines. And (3) obtaining the coordinates and the elevations of the ith points of the section lines and the contour lines, recording the coordinates and the elevations of the ith points in an array, and drawing a section view according to the data in the array.
The specific implementation process of each step is described in detail below:
1. the type of section line is identified by reading the name of the section line through the name attribute in step 2. In this embodiment, the name of the section line read according to the name attribute is "AcDblyline", so the type of the section line is determined to be a multi-section line.
2. The coordinates of the starting point, the coordinates of the inflection point, and the coordinates of the end point of the multi-segment line are obtained by the properties of the coordinates of the inflection point, and recorded, according to fig. 4, the coordinates of the starting point of the multi-segment line with two inflection points in addition to the starting point and the end point are (x) 1 ,y 1 ) Endpoint coordinates are (x 4 ,y 4 ) The inflection point is (x from left 2 ,y 2 )、(x 3 ,y 3 ) When the program reads the coordinates of the starting point, the inflection point and the end point of the multi-section line, the program defaults to read according to the drawing sequence of the points of the multi-section line, so that the coordinates of the starting point, the inflection point and the end point are continuously recorded in the array in sequence. The recording order of the coordinates in this embodiment is (x 1 ,y 1 )、(x 2 ,y 2 )、(x 3 ,y 3 )、(x 4 ,y 4 )。
3. In step 3, a selection set of contours is established by:
firstly, extreme values of an X region and a Y region of a position occupied by a section line are obtained, wherein the extreme values are respectively X min ,y min ,x max ,y max The method comprises the steps of carrying out a first treatment on the surface of the X in the present embodiment min =x 1 ,y min =y 1 ,x max =x 4 ,y max =y2。
Then, a lower left corner coordinate is plotted as (x min ,y min ) The upper right corner coordinates are (x max ,y max ) Is a rectangular frame of (2);
finally, all contours within and through the rectangular box are defined by the SelectByPolygon method as a new selection set.
4. In step 3, the number of items in the selection set is read through the count attribute, then each object in the selection set is traversed, every two adjacent points of the multi-section line are used as a line segment according to the sequence of a starting point, an inflection point and an ending point, in the embodiment, the section line consists of three line segments which are respectively a line segment AB, a line segment BC and a line segment CD, and the intersection point is obtained with each object in the selection set according to the sequence of the line segments AB, BC and CD;
5. in step 3, the intersections of all contours in the selection set with the section lines are collected by:
step 3.1: reading a first object in the selection set, and recording an elevation value or a Z value of the object in a variable h;
step 3.2, setting the elevation value or Z value of the first object in the selection set to 0 so as to ensure that the contour line and the section line are simultaneously arranged in an XOY plane;
step 3.3, using an intersectwidth method to obtain the intersection point value of the object in the selection set and the line segment AB, recording the intersection point coordinate in a first array, obtaining the (x, y) coordinate of the intersection point at the moment, and recording the condition that two or more intersection points exist between one contour line and the line segment AB in the first array in sequence when the intersectwidth method obtains the intersection point except the condition that one contour line and the line segment AB have one intersection point;
setting Z values of all intersection points in the first array as h, wherein the h is the elevation of the object in the selection set in the step 3.2;
step 3.5, resetting the elevation value or the Z value of the object in the selection set to be h;
step 3.6, identifying the number of intersection points of the object and the line segment AB, recording X, Y, Z values of all intersection points in the first array in a new two-dimensional array sCJ (a, b), wherein the a dimension in the array sCJ (a, b) is 3, namely the number of intersection points is represented by X, Y, Z, the dimension of b is increased along with the increase of the number of intersection points, namely the number of intersection points of the section line and the selected object;
step 3.7, emptying the first array;
and 3.8, returning to the step 3.1, and acquiring the intersection point of the next object in the selection set and the line segment AB.
Step 3.9: after all objects in the selection set are traversed, all the intersecting points of the contour lines intersecting the line segment AB or the objects with the elevations are obtained, and X, Y, Z values of all the intersecting points are recorded in sCJ (a, b);
and then returning to the step 3.1, collecting the intersections of all the contours in the selection set with the line segment BC and the line segment CD, and obtaining an array of 3 record intersections after finishing, namely sCJ (a, b), sCJ (a, b), sCJ (a, b).
6. In step 3, the collected intersections are ordered by the following steps.
Comparative section line x 1 ,x 2 ,……,x n-1 ,x n Or y 1 ,y 2 ,……,y n-1 ,y n The horizontal or vertical coordinates of each two adjacent points are compared from left to right in consideration of the drawing direction of the multi-segment line, if x k <x k+1 Or y k <y k+1 (k is N, and k is more than or equal to 1 and less than or equal to N-1), the intersection points in the corresponding sCJk (a, b) are ordered in the left-to-right order (conversely, the intersection points in the corresponding sCJk (a, b) are ordered in the right-to-left order), and after all N-1 groups are ordered, the intersection points in the sCJk (a, b) are all intersection points along the drawing direction of a section line (a multi-section line).
In this embodiment, taking the comparison of the x coordinates as an example, x can be known by comparing the sizes of two adjacent points 1 <x 2 ,x 2 >x 3 ,x 3 <x 4 The intersection points in sCJ (a, b) should be sequentially from left to right for the line segment ABThe line sorting should be performed such that the intersections in sCJ (a, b) are sorted in the order from right to left for the line segment BC, the intersections in sCJ (a, b) are sorted in the order from left to right for the line segment CD, and after all the 3 groups of the intersections are sorted, the intersections in sCJ (a, b), sCJ (a, b), sCJ (a, b) are all the intersections in the drawing direction of the multi-segment line, that is, in the ABCD direction.
7. In step 4, the coordinates and the elevation of the ith point on the section line are obtained by the following steps:
using the distance formula between two points to find the intersection point of sCJk (a, b) in the kth line segment and the cross section line (x) k ,y k ) Distance of (2):
the sCJk (0, i) is the x coordinate of the ith point in the sCJk (a, b);
the sCJk (1, i) is the y coordinate of the ith point in the sCJk (a, b);
the dK obtained i Namely, the kth line segment of the section line reflects the ith point relative to x on the XOY two-dimensional plane k The z value in sCJk (a, i) (i.e., sCJk (2, i)) is the elevation of the section line reaction on the XOY two-dimensional plane, i.e., the y coordinate of the section line reaction on the XOY two-dimensional plane, when b=i.
8. In step 4, as with the straight line method, d2i is added to the length of the first line segment (i.e., line segment AB) as the x-coordinate to the 2 nd line segment (i.e., line segment BC), sCJ (2, i) is correspondingly recorded as the y-coordinate in the array sPM (a, b) containing the data of the front line segment (i.e., line segment AB), d3i is added to the sum of the lengths of the first line segment (i.e., line segment AB) and the second line segment (i.e., line segment BC) as the x-coordinate to the third line segment (i.e., line segment CD), sCJ (2, i) is correspondingly recorded as the y-coordinate in the array sPM (a, b) containing the data of the front line segment (i.e., line segment AB and the front point BC), and the dimension of b is correspondingly increased as the number of line segments and intersections increases. The dimension of a in the final array sPM (a, b) is 2, that is, the x-coordinate and y-coordinate representing the section line reaction on the XOY two-dimensional plane, and the dimension of b is equal to the number of intersections of the entire multi-segment line (i.e., line segment AB, line segment BC, line segment CD).
9. Finally, in step 4, a cross-sectional view of the topographic map cut by the section line can be drawn according to the data in the array sPM (a, b) and in combination with the required scale, and then a complete cross-sectional view can be obtained by slightly modifying (see fig. 5).
According to the method for rapidly drawing the section based on the CAD topographic map, which is disclosed by the invention, a user draws a section line by himself on the basis of the topographic map with the contour lines, the intersection points, namely the elevations, of the section line and the contour lines can be rapidly obtained through the steps, the number of the intersection points can be infinite, and the section line can be rapidly generated.
The foregoing is merely illustrative of the present invention, and the present invention is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. The method for rapidly drawing the sectional view based on the CAD topographic map is characterized by comprising the following steps of:
step 1: drawing a section line, opening a CAD topographic map file for drawing the section map on the CAD, drawing a section line at the position of the CAD topographic map for drawing the section map, and setting the elevation or Z value of the section line to be 0;
step 2: judging the type of the section line, wherein the type of the section line comprises a straight line and a multi-section line, and if the section line is a straight line, recording the starting point coordinate and the end point coordinate of the section line; if the section line is a multi-section line, recording a starting point coordinate, an inflection point coordinate and an end point coordinate of the section line;
step 3: establishing a selection set of contour lines, collecting and sequencing intersection points, firstly establishing a selection set according to starting point coordinates, inflection point coordinates and end point coordinates of the section lines, wherein the selection set comprises all contour lines intersected with the section lines, and then collecting and sequencing the intersection points of each contour line in the selection set and the section lines;
step 4: obtaining coordinates and elevations of intersection points of the section lines and the contour lines, drawing a section diagram, obtaining coordinates and elevations of the section lines and the ith intersection points of the contour lines, recording the coordinates and elevations of the ith intersection points in an array, and drawing the section diagram according to data in the array;
in the step (3) of the process,
first, the extreme values of the X area and the Y area of the position occupied by the section line are obtained according to the starting point coordinate and the end point coordinate when the section line is a straight line or the starting point coordinate, the inflection point coordinate and the end point coordinate when the section line is a multi-section line, and are respectively X min ,y min ,x max ,y max
Then, a lower left corner coordinate is plotted as (x min ,y min ) The upper right corner coordinates are (x max ,y max ) Is a rectangular frame of (2);
finally, defining a new selection set by a SelectByPolygon method on all contour lines which are positioned in the rectangular frame and pass through the rectangular frame;
in the step (3) of the process,
if it is a straight line:
comparing section line x 1 And x 2 Or y 1 And y is 2 Then ordering the intersection points in sCJ (a, b) according to the determined direction, and after ordering, the intersection points in sCJ (a, b) are all intersection points along the section line direction;
if the multi-section line is:
comparative section line x 1 ,x 2 ,……,x n-1 ,x n Or y 1 ,y 2 ,……,y n-1 ,y n The horizontal or vertical coordinates of each two adjacent points are compared from left to right in consideration of the drawing direction of the multi-segment line, if x k <x k+1 Or y k <y k+1 Wherein k is N, and k is 1-1, and the corresponding sCJk (a,b) Ordering the intersections in if x k >x k+1 Or y k >y k+1 And ordering the intersection points in the corresponding sCJk (a, b) in the order from right to left, and after all n-1 groups of the ordered intersection points in the sCJk (a, b) are all intersection points along the drawing direction of the section line.
2. The method for quickly drawing a cross-section based on the CAD topographic map according to claim 1, wherein the method comprises the following steps: in step 2, the type of section line is identified by reading the name of the section line through the name attribute.
3. The method for quickly drawing a cross-section based on the CAD topographic map according to claim 1, wherein the method comprises the following steps: in the step 2 of the process, the process is carried out,
if the cross-sectional line is a straight line, the start point coordinate and the end point coordinate of the straight line are read and marked as (x 1 ,y 1 ),(x 2 ,y 2 );
If the section line is a multi-section line, acquiring the starting point coordinate, the inflection point coordinate and the end point coordinate of the multi-section line through the coordinates of the points, and recorded, the starting point coordinates are (x 1 ,y 1 ) Endpoint coordinates are (x n ,y n ) The inflection point is (x from left 2 ,y 2 )…(x n-1 ,y n-1 ) When the program reads the coordinates of the starting point, the inflection point and the end point of the multi-section line, the program defaults to read according to the drawing sequence of the points of the multi-section line, so that the coordinates of the starting point, the inflection point and the end point are continuously recorded in the array in sequence.
4. A method for rapidly drawing a cross-section based on CAD topography as claimed in claim 3, wherein: in the step (3) of the process,
if the section line is a straight line, reading the number of items in the selection set through the count attribute, and traversing each object in the selection set to obtain an intersection point of each object and the section line;
if the section line is a multi-section line, the number of items in the selection set is read through the count attribute, then each object in the selection set is traversed, and every two adjacent points are used as a line segment according to the sequence of the starting point, the inflection point and the end point, and the intersection point is obtained with each object in the selection set in sequence.
5. The method for quickly drawing the sectional view based on the CAD topographic map according to claim 4, wherein the method comprises the following steps: in the step (3) of the process,
if the section line is a straight line, the following steps are carried out:
step 3.1: reading a first object in the selection set, and recording an elevation value or a Z value of the object in a variable h;
step 3.2: setting the elevation value or Z value of the first object in the selection set to 0, thereby ensuring that the contour line and the section line are simultaneously arranged in an XOY plane;
step 3.3: the intersection point value of the object in the selection set and the section line is obtained by using an intersectwidth method, and the intersection point coordinates are recorded in a first array, so that the (x, y) coordinates of the intersection point are obtained, besides the condition that one contour line and the section line have one intersection point, the condition that one contour line and the section line have two or more intersection points, and when the intersectwidth method obtains the intersection point, the condition that the contour line and the section line have two or more intersection points is sequentially recorded in the first array;
step 3.4: setting Z values of all intersection points in the first array as h, wherein the h is the elevation of the object in the selection set in the step 3.2;
step 3.5: resetting the elevation value or Z value of the object in the selection set to h;
step 3.6: identifying the number of intersection points of the object and the cross-point line, and recording X, Y, Z values of all intersection points in the first array in a new two-dimensional array sCJ (a, b), wherein the a dimension in the array sCJ (a, b) is 3, namely the a dimension respectively represents X, Y, Z values, and the b dimension increases along with the increase of the number of intersection points, namely the number of all intersection points of the cross-point line and the selected object;
step 3.7: clearing the first array;
step 3.8: returning to the step 3.1, and acquiring an intersection point of the next object in the selection set and the section line;
step 3.9: after all objects in the selection set are traversed, all the contour lines intersecting with the section line or the intersection points of objects with elevations are obtained, and X, Y, Z values of all the intersection points are recorded in sCJ (a, b);
if the section line is a multi-segment line, n coordinates of the multi-segment line are obtained by using the coordinates attribute in the step 2, it is known that the multi-segment line is composed of n-1 line segments, the starting point, the inflection point and the end point are sequentially connected into straight lines, and each straight line is sequentially executed with the steps 3.1-3.9, so that an array of n-1 record intersection points, namely sCJ (a, b), sCJ (a, b), … … and scJn-1 (a, b), is obtained.
6. The method for quickly drawing a cross-section based on the CAD topographic map according to claim 1, wherein the method comprises the following steps: in the step 4 of the process, the process is carried out,
if the section line is a straight line:
using the distance formula between two points to find the cross point and cross line (x) in sCJ (a, b) 1 ,y 1 ) If it is a distance from (x 2 ,y 2 ) Beginning ordering of the ends, x in the following formula 1 And y is 1 Replaced by x 2 And y is 2 ):
The sCJ (0, i) is the x coordinate of the ith point in sCJ (a, b);
the sCJ (1, i) is the y coordinate of the ith point in sCJ (a, b);
d is calculated i I.e. the x-coordinate of the ith point on the XOY two-dimensional plane, and the z-value (i.e. sCJ (2, i)) in sCJ (a, i) is the elevation of the profile line reaction on the XOY two-dimensional plane, i.e. the y-coordinate of the profile line reaction on the XOY two-dimensional plane, when b=i;
if the section line is a multi-section line:
using the distance formula between two points to find the intersection point of sCJk (a, b) in the kth line segment and the cross section line (x) k ,y k ) Distance of (2):
the sCJk (0, i) is the x coordinate of the ith point in the sCJk (a, b);
the sCJk (1, i) is the y coordinate of the ith point in the sCJk (a, b);
the dK obtained i Namely, the kth line segment of the section line reflects the ith point relative to x on the XOY two-dimensional plane k The z value in sCJk (a, i) (i.e., sCJk (2, i)) is the elevation of the section line reaction on the XOY two-dimensional plane, i.e., the y coordinate of the section line reaction on the XOY two-dimensional plane, when b=i.
7. The method for quickly drawing the sectional view based on the CAD topographic map as set forth in claim 6, wherein: in the step 4 of the process, the process is carried out,
if the section line is a straight line:
d as defined in claim 6 i As x-coordinates, sCJ (2, i) is recorded as y-coordinates in a new array sPM (a, b), the dimension of a in the array sPM (a, b) is 2, that is, the x-coordinates and y-coordinates representing the section line reaction on the XOY two-dimensional plane, and the dimension of b is equal to the number of intersection points;
if the section line is a multi-section line:
for the first line segment, the same method as that of the straight line is adopted, but from the kth line segment, dK is needed i Adding the lengths of all the preceding line segments as x-coordinates, correspondingly recording sCJk (2, i) as y-coordinates in an array sPM (a, b) containing the preceding line segment data, wherein the dimension of b should also increase along with the increase of the number of line segments and intersection points, and finally the dimension of a in the array sPM (a, b) is 2, namely representing the x-coordinates and the y-coordinates of the section line reaction on the XOY two-dimensional plane, and the dimension of b is equal to the number of intersection points of the whole multi-segment line.
8. The method for quickly drawing the sectional view based on the CAD topographic map as set forth in claim 7, wherein: in step 4, a cross-section of the topography cut by the section lines is drawn according to the data in the array sPM (a, b) and combined with the required scale, and then the complete cross-section is obtained by slightly modifying.
CN201810810469.XA 2018-07-23 2018-07-23 Method for rapidly drawing section based on CAD topographic map Active CN109035364B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810810469.XA CN109035364B (en) 2018-07-23 2018-07-23 Method for rapidly drawing section based on CAD topographic map

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810810469.XA CN109035364B (en) 2018-07-23 2018-07-23 Method for rapidly drawing section based on CAD topographic map

Publications (2)

Publication Number Publication Date
CN109035364A CN109035364A (en) 2018-12-18
CN109035364B true CN109035364B (en) 2023-12-05

Family

ID=64645107

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810810469.XA Active CN109035364B (en) 2018-07-23 2018-07-23 Method for rapidly drawing section based on CAD topographic map

Country Status (1)

Country Link
CN (1) CN109035364B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109741453B (en) * 2019-03-29 2023-08-22 长江岩土工程有限公司 Geological section map elevation calculation method based on CATIA engineering drawing
CN110503727B (en) * 2019-08-09 2023-07-18 长江水利委员会长江科学院 Batch rapid splicing method for CAD arbitrary multi-section lines
CN111159800B (en) * 2019-12-13 2023-02-17 佛山欧神诺云商科技有限公司 Method and device for automatically generating 3D model based on CAD file
CN111259555B (en) * 2020-01-20 2022-03-29 西北工业大学 Petroleum pipeline equidistant line generation method based on thread pool
CN111553836B (en) * 2020-04-23 2023-09-08 深圳市秉睦科技有限公司 Method for automatically generating closed filling surface by scattered multi-section lines
CN112132927B (en) * 2020-09-15 2023-10-20 成都工具研究所有限公司 Drawing system and method for generating two-dimensional and three-dimensional models on webpage interface
CN116910887B (en) * 2023-09-07 2023-12-08 长江水利委员会长江科学院 Automatic drawing method for batch river section diagrams
CN117670660B (en) * 2024-02-01 2024-04-30 中国电建集团西北勘测设计研究院有限公司 Method for quickly generating sectional view based on CATIA V6

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102930570A (en) * 2012-10-08 2013-02-13 长江勘测规划设计研究有限责任公司 Method for acquiring topographic profile information according to topographic map
CN106600661A (en) * 2016-12-20 2017-04-26 黄河勘测规划设计有限公司 Method of accurately producing arc geological section
CN107590833A (en) * 2017-08-23 2018-01-16 华南理工大学 A kind of enhancing of human ear contour feature and physiological parameter extracting method based on contour

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102930570A (en) * 2012-10-08 2013-02-13 长江勘测规划设计研究有限责任公司 Method for acquiring topographic profile information according to topographic map
CN106600661A (en) * 2016-12-20 2017-04-26 黄河勘测规划设计有限公司 Method of accurately producing arc geological section
CN107590833A (en) * 2017-08-23 2018-01-16 华南理工大学 A kind of enhancing of human ear contour feature and physiological parameter extracting method based on contour

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于AutoCAD的露天矿矿床地质模型及其更新技术的研究;邸鹏浩;《中国优秀硕士学位论文全文数据库》;20151015;第1-64页 *

Also Published As

Publication number Publication date
CN109035364A (en) 2018-12-18

Similar Documents

Publication Publication Date Title
CN109035364B (en) Method for rapidly drawing section based on CAD topographic map
CN110220521B (en) High-precision map generation method and device
CN101901503B (en) Stretch-driven mesh parameterization method using spectral analysis
CN102521884A (en) Three-dimensional roof reconstruction method based on LiDAR data and ortho images
CN108898672A (en) A kind of semi-automatic cloud method making three-dimensional high-definition mileage chart lane line
CN108519094A (en) Local paths planning method and cloud processing end
CN111858810B (en) Modeling elevation point screening method for road DEM construction
CN106897445A (en) It is a kind of that the novel method that operation delimited on border is improved based on ArcGIS
CN111047682B (en) Three-dimensional lane model generation method and system
CN110032771A (en) A kind of accurate method of cutting out of open coal mine DEM for taking local detail feature into account
CN111199064A (en) Method for generating three-dimensional center line of subway rail surface
CN107993242B (en) Method for extracting boundary of missing area based on airborne LiDAR point cloud data
Milde et al. Building reconstruction using a structural description based on a formal grammar
CN115375872B (en) Automatic sketching method for GNSS measurement linear ground objects
JP4203599B2 (en) Topographic data processing program
CN109025981A (en) Accumulate correlation of sand bodies method and system in meandering stream side
CN115170751A (en) Water system section drawing method and device
JP3755002B2 (en) Topographic data processing program
JP2006120167A (en) Topographic data processing program
CN113128122A (en) BIM-based municipal road detection method
JP3572253B2 (en) Three-dimensional model generation method and apparatus, and recording medium recording execution program of this method
JP2006268053A (en) Geographical feature data processing method
CN108170988B (en) Three-step seven-step method for tunnel excavation based on BIM technology
JP2006091909A (en) Geographical feature data processing program
CN114329575B (en) Contour line encryption method, system, medium, and device based on interpolated ridge line

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Xu Fei

Inventor after: Chen Weiqing

Inventor after: Tang Liwei

Inventor after: Jiao Yuguo

Inventor after: Wei Kai

Inventor after: Wu Yanan

Inventor after: Zhao Xincun

Inventor after: Wang Yanling

Inventor after: Xia Xuesheng

Inventor after: Zhou Shaozhi

Inventor before: Xu Fei

Inventor before: Wu Yanan

Inventor before: Tang Liwei

Inventor before: Zhou Shaozhi

Inventor before: Zhao Xincun

Inventor before: Jiao Yuguo

Inventor before: Chen Weiqing

Inventor before: Wei Kai

Inventor before: Wang Yanling

Inventor before: Xia Xuesheng

GR01 Patent grant
GR01 Patent grant