A method and system for fast drawing of linear engineering
By automatically obtaining and sorting line pile numbers, calculating and rotating the printing area, and generating CAD script files, the problems of cumbersome manual operations and inaccurate drawings in the existing technology are solved, and efficient and accurate linear engineering rapid drawings are achieved.
Patent Information
- Application Number
- CN202411010175.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2044-07-26
AI Technical Summary
The existing CAD drawing method requires manual determination of the printing area, which cannot ensure that the line is located in the center of the drawing. In the case of complex models and long lines, the operation is cumbersome, which occupies a lot of memory and reduces work efficiency.
By obtaining the coordinates of the two-dimensional line pile numbers, sorting them according to the direction of the line, calculating the size and rotation angle of the printing area, generating a CAD script file, realizing the rotation, translation and scaling of the viewport, and automating the graph production process.
It improves the efficiency and accuracy of drawing, reduces manual operations, can be effectively applied in linear engineering projects such as rail transit and highways, and improves the accuracy of printing area division.
Smart Images

Figure CN118965514B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of CAD, and in particular to a fast drawing method and system for linear engineering. Background Art
[0002] Linear projects refer to railways, highways, oil and gas pipelines, channels, pipelines, urban integrated pipe networks, transmission lines and cableway projects. The length of linear projects often exceeds 10,000 meters, but the width is less than 100 meters. The aspect ratio is very large, and the plan needs to be printed in sections.
[0003] In addition to the large aspect ratio, the direction of linear engineering is restricted by routing, terrain and other conditions. Its line type is often not a straight line, and there will be turns, curves and avoidance. In order to make the line as close to the center of the drawing as possible, the direction of the drawing needs to be rotated, and the rotation direction of each drawing is also different.
[0004] The existing CAD drawing method is: ① Determine the size and scale of the viewport according to the size of the drawing format; ② In the model space, draw the printing area after scaling (the image in the printing area will be displayed in the viewport); ③ According to the direction of the line, translate and rotate the printing area to make the line located in the center of the printing area; ④ To ensure the continuity of the printing area, a certain overlapping area should be reserved between adjacent printing areas, and a compass should be inserted in the printing area; ⑤ In the layout space, establish a user coordinate system (UCS) in the viewport, adjust the direction of the view (PLAN), and zoom the view (ZOOM) to make the viewport coincide with the printing area in the model.
[0005] The existing drawing output method requires manual determination of the printing area, and cannot ensure that the line is accurately located in the center of the drawing; the compass is often arranged at the corners of the printing area, and there is a certain overlapping area between adjacent drawings. If the layout is unreasonable, multiple compasses may appear in one drawing; when the model is complex, a series of operations in the layout viewport will take up a lot of memory and reduce work efficiency; when the line is too long, the relevant layout operations need to be repeated dozens or even hundreds of times, which is repetitive work. Summary of the invention
[0006] The present invention proposes a method for fast drawing of linear engineering. The purpose of the present invention is to utilize vector information of CAD drawing to digitize and program the drawing process, thereby improving the drawing efficiency and accuracy.
[0007] The technical solution of the present invention is as follows:
[0008] A linear engineering rapid drawing method comprises the following steps:
[0009] Step S101: Simplify the route plan by obtaining the coordinates of the two-dimensional route stakes (including the starting point and the end point of the project) and sorting the obtained stakes according to the route advance direction.
[0010] Step S102: Determine the drawing output method, drawing format, viewport size, and set an appropriate scale.
[0011] Step S103: Calculate the size of the printing area according to the viewport size and scale. Filter out all the piles that should be included in the printing area of each drawing according to the starting pile number. To ensure the continuity of the printing area, the starting pile number of the next drawing should be the same as the ending pile number of the previous drawing.
[0012] Step S104: Calculate the rotation angle and the geometric center of the print area according to the coordinates of the pile number in the print area.
[0013] Step S105: Generate a CAD script file based on the information in step S102 and step S104 to realize the programmable viewport rotation, view translation and zoom, so as to achieve the purpose of rapid drawing.
[0014] In the preferred embodiment of the present invention, the step S101 proposes to abstract the continuous route plan into discrete stakes, and arrange the stakes in the order of the route (representing the actual mileage) (denoted as P i ). The lines between the stakes can be regarded as a simplified line plane and serve as the basis and nodes for the subsequent printing area division.
[0015] The pile numbers are usually set at equal intervals (representing the actual length, without considering chain breaks).
[0016] For straight segments, the connecting lines between pile numbers can be accurately represented; for curved segments (circular curves and transition curves), there will be certain errors in length and transverse direction, and the errors are related to the pile number interval s and the curve radius R.
[0017] The length error is: Δs = s-2Rsin(s / 2R)≈s 3 / (24R 2 )
[0018] The lateral error is: Δd = R-Rcos(s / 2R)≈s 2 / (8R)
[0019] Generally speaking, the density of pile number setting is related to the minimum plane curve radius of the line. For example, the minimum curve radius of a rail transit project is 300 meters, and piles are set every 100 meters. The maximum length error is 0.5 meters, and the maximum lateral error of the curve section is 4.2 meters, which are all within an acceptable range.
[0020] Preferably, the step S102 has two output modes: fixed format mode, i.e. all drawings adopt a uniform format size, which is convenient for subsequent batch printing; floating format mode (keep the width of the drawing unchanged, refer to GB / T 14689 to lengthen the drawing), i.e. one drawing is as long as possible, which can greatly reduce the number of drawings. Refer to GB / T 18229 to set the output ratio.
[0021] Preferably, in step S103, the length and width of the printing area are calculated according to the drawing mode, viewport size and scale (in floating format mode, only the width is calculated). To reflect the situation at both ends of the line, the longitudinal extension distance D is set. x Similarly, set the horizontal translation distance D y (For environmental assessment projects, D y should be slightly larger than the evaluation range).
[0022] In fixed format mode, all stakes in the printing area are filtered according to the length and width of the printing area;
[0023] In floating format mode, all the pile numbers in the printing area are screened according to the width of the printing area, and the required minimum printing format is calculated.
[0024] To ensure the continuity of the center line, the starting pile number of the next drawing should be the same as the ending pile number of the previous drawing.
[0025] Preferably, in step S104, based on the screened pile numbers, the smallest rectangle containing all pile numbers can be easily drawn, and its rotation angle and geometric center can be calculated; in the floating format mode, the minimum format length corresponding to each drawing should also be calculated.
[0026] Preferably, in step S105, the CAD layout operation command stream is saved in the form of a script file including but not limited to a script file, and each layout operation should include at least the following four commands:
[0027] Command 1: Draw the rotated viewport according to the viewport position and size determined in step S102 (in floating format mode, the viewport length is determined in step S104) and the rotation angle determined in step S104;
[0028] Command 2: Set the center of the print area in the viewport and the scale of the viewport according to the geometric center calculated in step S104 and the scale determined in step S102;
[0029] Command 3: Reset the rotated viewport to the normal position;
[0030] Command 4: Draw or insert a rotated compass at a specified position according to the rotation angle determined in step S104.
[0031] A linear engineering rapid drawing system, including the following modules:
[0032] M1: Data input module, used to receive data exported from CAD files and obtain coordinate information of CAD objects from them;
[0033] M2: Data processing module, used to sort the coordinate data obtained in M1 to meet the requirements of subsequent automatic calculation;
[0034] M3: Result generation module, which selects stake numbers according to the drawing requirements and calculates their rotation angle and geometric center based on the selected stake numbers;
[0035] M4: Result export module, used to output the results generated by M3 in the form of script files for CAD reading to achieve rapid drawing output.
[0036] Compared with the prior art, the present invention has the following beneficial technical effects:
[0037] 1. The present invention proposes a method for fast drawing of linear engineering, which simplifies the line plane model by pile number and serves as the basis for subsequent segmentation. According to the drawing setting, the printing range is determined, the pile number corresponding to each drawing is intercepted, and the line is located in the center of the drawing by rotating and scaling the viewport in the layout space. The accuracy of the printing area division is improved, and it can be effectively applied in linear engineering projects such as rail transportation and highways.
[0038] 2. The present invention outputs results in the form of scripts, which can replace repeated manual operations.
[0039] 3. All commands only involve layout space and do not modify (or rely on) the model, which means that all layout operations can be completed in a blank CAD file, which can greatly improve layout efficiency.
[0040] 4. The present invention proposes two drawing output methods, which can achieve batch printing or reduce the number of drawings, thereby improving practicality. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Other features, objects and advantages of the present invention will become more apparent from the detailed description of non-limiting embodiments made with reference to the following drawings:
[0042] Figure 1 This is a flowchart of the linear engineering rapid drawing method of the present invention.
[0043] Figure 2 This is a flowchart of sorting pile numbers according to the direction of travel proposed by the present invention
[0044] Figure 3 This is a schematic diagram of sorting pile numbers in Example 1.
[0045] Figure 4 This is a flowchart of the fast output of images in the fixed format mode of the present invention.
[0046] Figure 5 It is the minimum rectangular diagram corresponding to the pile number set
[0047] Figure 6 This is a flowchart of the fast drawing in the floating format mode of the present invention
[0048] Figure 7 This is a flowchart of layout view operation.
[0049] Figure 8 This is an example of the layout of the printing area in a fixed format mode for a highway project.
[0050] Fig. 9 This is an example of the layout of the printing area in floating format for a highway project.
[0051] Fig.10 It is the format size recommended by GB / T 14689
[0052] Fig.11 It is the drawing ratio recommended by GB / T 18229. DETAILED DESCRIPTION
[0053] The present invention is described in detail below in conjunction with specific embodiments. The following embodiments will help those skilled in the art to further understand the present invention, but are not intended to limit the present invention in any form. It should be noted that, for those of ordinary skill in the art, several changes and improvements can also be made without departing from the concept of the present invention. These all belong to the protection scope of the present invention.
[0054] In CAD (computer-aided design), pile number is an important concept, which is mainly used to identify and distinguish different pile foundations. Pile number is widely used in the design and construction of linear projects such as highways, railways, long-distance pipelines, and electricity. The following is a detailed explanation of pile number in CAD:
[0055] Pile numbers refer to the unified numbering of the designed foundation piles before construction to facilitate construction. The numbers are unique and non-repetitive. These numbers are used to identify and distinguish multiple "piles" so that the location and attributes of each pile can be accurately identified during construction, management and maintenance.
[0056] The role of pile number
[0057] Identify location: The pile number can clearly identify the specific location of each pile in the linear project, which is crucial for positioning, measurement and recording during construction.
[0058] 便于管理:通过桩号,可以方便地管理和跟踪桩的施工情况,包括施工进度、质量问题和维护记录等。
[0059] 提高效率:在CAD中,通过自动或手动给桩编号,可以大大提高绘图和管理的效率,减少人工错误。
[0060] 在高速公路等线性工程中,桩号通常与里程碑系统相结合,以“K千米数±米数”的形式表示。例如,起点处的桩号是k0+000,每隔一定距离(如100米)就会有一个桩号标记。这种表示方法使得桩号具有唯一性和连续性,便于施工人员和管理人员理解和使用。在CAD软件中,可以使用“文字”工具或“标注”工具来给桩编号。具体操作步骤包括打开CAD软件、创建新图纸、设置比例尺、绘制桩的位置以及使用“文字”工具输入桩号等。如果需要修改已经绘制好的桩的位置或编号,可以使用“移动”工具或“文字”工具进行相应的调整。
[0061] CAD中的桩号是施工前对设计基础桩进行统一编号的结果,用于标识和区分不同的桩基础。它具有唯一性、连续性和易于管理的特点,在多个领域的线性工程设计中都有广泛应用。在CAD软件中,可以通过各种工具和方法来编辑和管理桩号,以提高绘图和管理的效率。
[0062] 实施例1对桩号进行排序
[0063] 一般而言,可通过桩号对应的实际里程,对桩号进行排序。若无法将桩号与对应里程匹配,可参考 Figure 2 流程对桩号进行排序,实现效果见 Figure 3 。
[0064] 步骤S201:假设平面图中共有N个桩号,记作P j (1≤j≤N),工程起点记作P0,并令i=0。
[0065] 步骤S202:依次计算 的距离,记作l j (i<j≤N)。
[0066] 步骤S203:使用排序算法,将l j 按从小到大的顺序对P j (i<j≤N)重新排列。
[0067] Step S204: Set the adjacent stake number determination value, denoted as X0, that is, two stake numbers with a spacing less than X0 are considered adjacent. Since there are long chains in actual projects, its value can be slightly larger than the adjacent stake number spacing. Calculate successively Denoted as x j .
[0068] When x j < X0, continue the calculation until j > N, and go to Step S205;
[0069] If x j > X0, it means that P j and P j-1 are not adjacent. At this time, let i = j - 1, that is, starting from P j-1 , return to Step S202.
[0070] Step S205: Denote the end point of the project as P N+1 .
[0071] Example 2 Quick drawing in fixed format mode
[0072] If the fixed format mode is selected, the flowchart is shown in Figure 4 .
[0073] Step S401: Set the drawing format with reference to GB / T 14689, and set the viewport size. Set the drawing scale with reference to GB / T 18229, denoted as p. The viewport size is l0×b0. Therefore, the length L0 = l0 / p and width B0 = b0 / p of the printing range can be calculated.
[0074] Step S402: To reflect the situations at both ends of the line, set the longitudinal extension distance D x , similarly, to reflect the areas on both sides of the line, set the lateral translation distance D y .
[0075] Step S403: Used to determine the stake numbers that each drawing should contain.
[0076] Let the starting stake number within the printing area of the m-th drawing be denoted as P i , and the ending stake number be denoted as P j . For all stakes within the printing area, the corresponding minimum rectangle is a rectangle with the line connecting P i and P j as the x-axis. Therefore, its rotation angle can be rounded as required, and the actual rotation angle is denoted as α m . At this time, the length and width of the corresponding minimum rectangle are denoted as L m and B m , and the geometric center coordinates are denoted as (x C,m , y C,m ).
[0077] like Figure 5 The figure shows the linear engineering on both sides D y The smallest rectangle corresponding to the area. The lengths of its left, right, top and bottom extensions are respectively recorded as: ΔL l,m , ΔL r,m , ΔB u,m and ΔB d,m , whose value is related to the tilt angle and the actual rotation angle α m The difference is related to the relationship:
[0078]
[0079] ΔB u,m =D y |cos(α u,m -α m )|
[0080] ΔB d,m =D y |cos(α d,m -α m )|
[0081] To simplify the calculation process, the upper and lower expansion widths can be simplified to: ΔB u,m =ΔB d,m =D y .
[0082] To filter all the pile numbers in the printing area, it is necessary to satisfy P i ~P j Satisfy the judgment requirements and P i ~P j+1 The judgment requirements are not met. The judgment conditions are as follows:
[0083] First drawing: L m +max(D x ,ΔL l,m )+ΔL r,m ≤L0 and D m +2D y ≤B0;
[0084] Other drawings: L m +ΔL l,m +ΔL r,m ≤L0 and D m +2D y ≤B0 (Note: In fixed format mode, because the length of the output drawing is fixed, the extension length at the end of the last drawing may be less than D x of).
[0085] Step S404: Calculate the center of the print area of the viewport. The geometric center of the print area is denoted as (x0,m ,y 0,m ), is to focus on the area (both sides of the line centerline D y The inner area) is arranged at the center of the printing area, and a longitudinal offset ΔL is introduced x,m and lateral offset ΔL y,m . The relationship satisfies:
[0086] x 0,m =x c,m +ΔL x,m cos(α m )-ΔL y,m sin(α m )
[0087] y 0,m =y c,m +ΔL x,m sin(α m )+ΔL y,m cos(α m )
[0088] Where: Longitudinal offset of the first drawing: ΔL x,1 =(ΔL r,1 -max(D x ,ΔL l,1 )) / 2,
[0089] Last drawing: ΔL x,m =(L0-L m -ΔL l,1 ) / 2
[0090] Other drawings: ΔL x,m =(ΔL r,m -ΔL l,m ) / 2;
[0091] ΔL y Generally it is set to 0 and can be adjusted as required.
[0092] Step S405: Generate a script file based on the rotation angle and print area center data calculated in step S404 and referring to step S105.
[0093] Example 3: Fast drawing in floating format mode
[0094] If you select floating format mode, see the flowchart Figure 6 .
[0095] Step S601: Set the base format and base viewport size according to Table 1 of GB / T 14689. The extended format is obtained by increasing the short side of the basic format by an integer multiple. Set the output ratio according to Table 1 of GB / T 18229. The base viewport size is denoted as l0×b0, and the length of the extended viewport is obtained by increasing the short side of the basic format by an integer multiple, denoted as l 0,n , the length of the extended viewport is l0+nl 0,n .
[0096] Taking a horizontal A3 drawing as an example, its base format is A4, and its extended format is A4×(n+2) (n is an integer). The base viewport size is l0×b0, and in the extended format, the viewport size is (l0+210n)×b0.
[0097] Step S602: Same as step S402, set D x and D y .
[0098] Step S603: used to determine the pile numbers that each drawing should include.
[0099] Same as step S403, calculate the actual rotation angle α of each drawing m , the length and width of the corresponding minimum rectangle are denoted as L m and B m , the geometric center coordinates are denoted as (x C,m ,y C,m ), the left and right extension length of the drawing ΔL l,m , ΔL r,n .
[0100] To filter all the pile numbers in the printing area, it is necessary to satisfy P i ~P j Satisfy the judgment requirements and P i ~P j+1 Does not meet the judgment requirements. Judgment conditions: D m +2D y ≤B0.
[0101] Step S604: Determine the increased length of the drawing.
[0102] Length of the first drawing: (l0+nl 0,n ) / p≥L m +max(D x ,ΔL l,m )+ΔL r,m ;
[0103] The length of the last drawing: (l0+nl 0,n ) / p≥L m +ΔL l,m +max(Dx ,ΔL r,m );
[0104] The lengths of the remaining drawings are: (l0+nl 0,n ) / p≥L m +ΔL l,m +ΔL r,m .
[0105] Step S605: Calculate the print area center (x 0,m ,y 0,m ), same as step S404. The longitudinal offset of the last drawing is modified to ΔL x,m =(max(ΔL r,m ,D x )-ΔL l,m ) / 2.
[0106] Step S606: Generate a script file based on the rotation angle and print area center data calculated in step S605 and referring to step S105.
[0107] Each layout operation should contain at least the following 4 commands, and its flow chart is as follows Figure 7 shown.
[0108] Step S701: Draw the rotated viewport.
[0109] Step S702: Set the center and scale of the viewport.
[0110] Step S703: Return the viewport to the normal position.
[0111] Step S704: insert a compass.
[0112] The print areas of a highway project in fixed format and floating format, see Figure 8 and Fig. 9 .
[0113] The protection content of the present invention is not limited to the above embodiments. Without departing from the spirit and scope of the present invention, changes and advantages that can be thought of by those skilled in the art are included in the present invention and are protected by the attached claims.
Claims
1. A method for rapid drawing of linear engineering, characterized in that: The following steps are involved: Step S101: exporting and sorting the stake numbers of the line plane; Step S102: setting the printing mode, format, printing area and ratio; Step S103: Filter the pile numbers within the printing range of each drawing: calculate the size of the printing area according to the viewport size and scale, and filter out all the pile numbers that should be included in the printing area of each drawing according to the starting pile number. The starting pile number of the next drawing should be the same as the ending pile number of the previous drawing. Step S104: Calculate the rotation angle and the geometric center of the print area according to the coordinates of the pile number in the print area; Step S105: Generate a CAD script file for rapid drawing according to the printing mode, format, printing area and ratio, the rotation angle of the printing area and the pile geometric center; The sorting in step S101 specifically includes: Step S201: Assume that there are N stake numbers in the plan view, denoted as P j , where 1≤j≤N, the starting point of the project is denoted as P0, and i=0; Step S202: Calculate The distance is denoted as I j , where i <j≤N; Step S203: Use a sorting algorithm to sort I j in ascending order of P j , where i < j ≤ N, and rearrange them; Step S204: Set the adjacent stake number determination value, denoted as X0, that is, two stake numbers with a spacing less than X0 are considered adjacent. The value of the adjacent stake number determination value is slightly greater than the adjacent stake number spacing, and calculate successively where i < j ≤ N, denoted as x j ; When x j <When X is less than 0, continue the calculation until j > N, and go to step S205; If x j ≥X0, it means P j With P j-1 Not adjacent, let i = j-1, that is, P j-1 As the starting point, return to step S202; Step S205: The end point of the project is recorded as P N+1 .
2. A linear engineering rapid drawing method according to claim 1, characterized in that: In the step S101, the connection lines between the stakes are straight line segments, and the connection lines between the stakes are regarded as simplified line planes, and serve as the basis and nodes for subsequent printing area division.
3. A linear engineering rapid drawing method according to claim 1, characterized in that: In step S101, for the line between the pile numbers as a curve segment, the length error and the lateral error are related to the pile number interval s and the curve radius R, specifically: The length error is: Δs = s-2Rsin(s / 2R)≈s 3 / (24R 2 ) The lateral error is: Δd = R-Rcos(s / 2R)≈s 2 / (8R).
4. A linear engineering rapid drawing method according to claim 1, characterized in that: In the step S105, in the CAD layout operation command stream of the CAD script file, each layout operation should contain at least the following four commands: Command 1: Draw the rotated viewport according to the viewport position and size determined in step S102 and the rotation angle determined in step S104; Command 2: Set the center of the print area in the viewport and the scale of the viewport according to the geometric center calculated in step S104 and the scale determined in step S102; Command 3: Reset the rotated viewport to the normal position; Command 4: Draw or insert a rotated compass at a specified position according to the rotation angle determined in step S104.
5. A linear engineering rapid drawing system for executing the linear engineering rapid drawing method according to any one of claims 1 to 4, characterized in that: Includes the following modules: M1: Data input module, used to receive data exported from CAD files and obtain coordinate information of CAD objects from them; M2: Data processing module, used to sort the coordinate data obtained in M1 to meet the requirements of subsequent automatic calculation; M3: Result generation module, which selects stake numbers according to the drawing requirements and calculates their rotation angle and geometric center based on the selected stake numbers; M4: Result export module, used to output the results generated by M3 in the form of script files for CAD reading to achieve fast drawing output.