Railway subgrade multi-type annotation-oriented drawing layout adaptive optimization method

By establishing structural semantic information in railway subgrade CAD drawings, calculating the overlap rate dynamic adjustment coefficient, and using attraction and repulsion vectors to optimize the annotation position, the problem of unattractive drawings and poor readability caused by improper annotation distance is solved, and a compact and beautiful layout optimization is achieved.

CN122133215APending Publication Date: 2026-06-02CHINA RAILWAY DESIGN GRP CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA RAILWAY DESIGN GRP CO LTD
Filing Date
2025-12-29
Publication Date
2026-06-02

AI Technical Summary

Technical Problem

Existing railway subgrade CAD drawings suffer from problems such as excessively large or dense annotation spacing, resulting in unattractive drawings and poor readability. Furthermore, existing automatic optimization methods cannot effectively distinguish between different types of annotations, leading to unreasonable layouts.

Method used

By establishing structural semantic expression information, identifying annotation types and calculating dynamic adjustment coefficients for overlap rates, and optimizing annotation positions using attraction and repulsion vectors, adaptive optimization of drawing layout is achieved through iterative adjustments.

Benefits of technology

While ensuring that the annotations do not overlap, the layout of the drawings is optimized to make them compact and aesthetically pleasing, thereby improving the readability and standardization of the drawings.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122133215A_ABST
    Figure CN122133215A_ABST
Patent Text Reader

Abstract

This invention discloses an adaptive optimization method for the layout of railway subgrade drawings with multiple types of annotations, comprising: S1, establishing structural semantic expression information for all annotations in the CAD drawing; S2, identifying the annotation type of the CAD drawing, reading its structural semantic expression information, and obtaining the adjustment rules for each annotation; S3, calculating the dynamic adjustment coefficient of the overlap rate of all drawing annotations; S4, calculating the repulsive force vector between any two annotations, the attractive force vector between each annotation and its annotated object, and the overlapping repulsive force vector experienced by overlapping annotations; S5, calculating the resultant force vector experienced by each annotation, and moving the position of the annotation according to the direction of the resultant force vector and the annotation adjustment rules; S6, repeating S3 to S5 until the optimized railway subgrade CAD drawing is obtained. This method ensures that the overall layout of the CAD drawing is compact and aesthetically pleasing while guaranteeing that the annotations do not overlap.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of computer-aided design of railway subgrade engineering, and specifically relates to an adaptive optimization method for drawing layout for multiple types of annotations in railway subgrade. Background Technology

[0002] With the development of railway infrastructure construction in my country, Computer-Aided Design (CAD) technology has become a core tool in the industry. The standardization and accuracy of its annotation information directly affect the design expression, construction, and operation and maintenance processes. With the widespread adoption of 3D modeling technologies such as BIM in the industry, more and more roadbed-related drawings are automatically generated from 3D models into 2D results. However, due to the differences between 3D semantic expression and 2D drafting in terms of organization, granularity, and standard constraints, CAD drawings directly exported from 3D models often exhibit problems such as disordered placement, mutual occlusion, and overlap in annotations, weakening the readability of the drawings and increasing the complexity of review and handover.

[0003] Currently, the layout of railway subgrade CAD drawings mainly has the following problems:

[0004] 1. The distance between the annotation and the object being annotated is too large, making the drawing unsightly;

[0005] 2. The annotations on the drawings are too densely packed in the layout, and there are even overlaps between the annotations, which directly affects the readability of the drawings.

[0006] In the current workflow, the layout of annotations in railway subgrade CAD drawings still relies heavily on manual adjustments based on experience. While this method can meet engineering requirements to some extent, the workload of manual fine-tuning becomes enormous and inefficient as project size and the number of drawings increase. Existing automatic annotation optimization methods for CAD drawings only consider the issue of overlapping and occlusion of annotations. Although they also use force-directed methods for layout optimization, they do not define annotation rules for different annotation types, cannot consider the movement weights of different types of annotations during the optimization process, and cannot distinguish between different types of annotations. This leads to unreasonable annotation layouts, with key annotations potentially being over-moved while secondary annotations remain in overly fixed positions, thus affecting the standardization and readability of the drawings. Furthermore, the single force-directed method, due to its fixed force calculation coefficients, is prone to causing the layout to become overly scattered in order to avoid annotation overlap, resulting in unattractive drawings. Summary of the Invention

[0007] The purpose of this invention is to provide an adaptive optimization method for the layout of drawings for multiple types of annotations on railway subgrades, which adaptively makes the layout of drawings more compact and aesthetically pleasing while ensuring that the annotations in the CAD drawings do not overlap.

[0008] Therefore, the present invention adopts the following technical solution:

[0009] An adaptive optimization method for drawing layout for multi-type annotation of railway subgrade includes:

[0010] S1, establish structural semantic expression information for all drawing annotations in railway subgrade CAD drawings;

[0011] S2, Based on the structural semantic expression information, identify the annotation type of the drawing annotation, read its structural semantic expression information, and obtain the adjustment rules for all drawing annotations;

[0012] S3, calculate the dynamic adjustment coefficient for the overlap rate marked in the CAD drawing. The dynamic adjustment coefficient for the overlap rate includes the gravity adjustment coefficient. and repulsion adjustment coefficient ;

[0013] S4, calculate the repulsion vector between any two annotations in all drawing annotations. The gravitational vector between each annotation and its corresponding annotated object and the overlapping repulsion force vector experienced by overlapping labels. ;

[0014] S5, utilizing the repulsive vector Gravitational vector and overlapping repulsive force vector Calculate the resultant force vector of each annotation in the CAD drawing, and move the position of the annotation according to the direction of the resultant force vector and the adjustment rule obtained in S2;

[0015] S6. Repeat steps S3 to S5 for iteration until the optimized railway subgrade CAD drawings are obtained.

[0016] In step S1 above, the structural semantic expression information includes the geometric information of the annotation and the adjustment rules of the annotation. The geometric information and adjustment rules are defined by data name, data value, data type, and data interpretation list. For different annotation types, the adjustment rules are defined according to their importance in the drawing. The adjustment rules include attraction coefficient, repulsion coefficient, X-direction degree of freedom, Y-direction degree of freedom, movable range type, and movable range table.

[0017] In step S3 above, the gravity adjustment coefficient The calculation formula is:

[0018]

[0019] Repulsion adjustment coefficient The calculation formula is:

[0020]

[0021] in: It is the current overlap ratio marked during the drawing optimization process; It is the initial overlap ratio of the annotations; It is the gravitational gain coefficient, determined based on the optimization effect; It is the repulsion attenuation coefficient, with a value of 0.5 to 1.0, determined according to the optimization effect; the overlap ratio of the annotations is calculated by dividing the number of currently overlapping annotations by the total number of annotations in the drawing.

[0022] Preferably, the gravitational gain coefficient The value ranges from 0.3 to 0.8; the repulsive force attenuation coefficient The value ranges from 0.5 to 1.0.

[0023] In step S4 above, the repulsion vector between any two labels The calculation formula is:

[0024]

[0025] in, It is the repulsion coefficient, the value of which comes from the structural semantic expression information of the annotation; It is a label with annotation The difference in coordinate vectors, It is a label with annotation The magnitude of the difference between the coordinate vectors.

[0026] In step S4 above, the gravitational vector between each annotation and its corresponding annotated object The calculation formula is:

[0027]

[0028] in, It is the gravity coefficient, determined by the structural semantic information expressed in the annotation; It is the coordinate difference vector between the label and the labeled object.

[0029] In step S4 above, the overlapping repulsion force vector experienced by the overlapping annotations is... The calculation formula is:

[0030]

[0031] in:

[0032] It is a label The ratio of the overlapping area to the sum of the areas of the two labels;

[0033] It is the overlap penalty coefficient, and the preferred value is 800 to 1000.

[0034] In step S5 above, the method for moving the label position is as follows:

[0035] Determine whether it can move in the X direction based on the currently labeled X-direction degree of freedom. If it can, calculate the X-direction component of the resultant force vector; otherwise, the X-direction component is 0.

[0036] Determine whether it can move in the Y direction based on the currently labeled Y-direction degree of freedom. If it can, calculate the Y-direction component of the resultant force vector; otherwise, the Y-direction component is 0.

[0037] Multiply the X-direction component by the movement step size to obtain the X-direction movement vector; multiply the Y-direction component by the movement step size to obtain the Y-direction movement vector; obtain the new marked position from the X-direction movement vector and the Y-direction movement vector;

[0038] According to the movement rules, it is determined whether the new position of the marker is within the movement range of the marker. If not, the X-direction component and the Y-direction component are added together and then multiplied by the projection operator of the movable range to obtain the final movement position.

[0039] Preferably, the moving step size is 0.1.

[0040] In the above method, the iteration terminates when a preset number of iterations is reached; or, the iteration terminates when the current overlap ratio calculated during the iteration is 0. Preferably, if the drawing layout does not meet the requirements when the iteration terminates, the number of iterations is increased by 0.5 times the initial number to continue optimization.

[0041] This invention establishes structural semantic expression information for all drawing annotations, calculates the dynamic adjustment coefficient of the overlap rate of drawing annotations, and substitutes it into the calculation formula of repulsion vector and reference vector; the position of the annotations is optimized by the resultant force of repulsion vector, attraction vector and overlapping repulsion force vector; each time the position is optimized, the position of all adjustable annotations may change, and the corresponding repulsion and associated attraction will also change, so as to achieve dynamic adjustment of all annotations through multiple iterations, and realize the layout optimization of the entire railway subgrade drawing.

[0042] Compared with the prior art, the present invention has the following beneficial effects:

[0043] 1. The optimization method of the present invention establishes structural semantic expression information for annotations of all types of CAD drawings, defines their movement rules, adjusts their movement weights, and optimizes their layout based on the structural semantic expression information.

[0044] 2. The optimization method of the present invention adds a dynamic adjustment coefficient (attraction and repulsion adjustment coefficient) based on the overlap ratio in the calculation of attraction and repulsion. It can adaptively and dynamically adjust the force calculation according to the current overlap of the CAD drawing. Under the premise of ensuring that the annotations in the drawing do not overlap, the overall layout iteration effect of the CAD drawing is better, and the overall annotation layout is both compact and beautiful. Attached Figure Description

[0045] Figure 1 The flowchart shows the adaptive force-guided map layout optimization method for multi-type annotation of railway subgrade according to the present invention.

[0046] Figure 2 This is a schematic diagram of overlapping annotations in one embodiment of the present invention;

[0047] Figure 3 This is a schematic diagram showing the movement of the elevation markings and leader markings corresponding to Tables 1 and 2 in one embodiment of the present invention. Detailed Implementation

[0048] The method of the present invention will be described in detail below with reference to the accompanying drawings and embodiments.

[0049] See Figure 1 The adaptive force-guided map layout optimization method for multi-type annotation of railway subgrade of the present invention includes the following steps:

[0050] S1. Establish structural semantic representation information for all annotations in the railway subgrade CAD drawings. Annotation types in the CAD drawings include elevation annotations, leader line annotations, linear annotations, area annotations, split line annotations, line-along annotations, radius annotations, and / or angle annotations. The structural semantic representation information includes the geometric information of the annotations and the annotation adjustment rules, which are categorized by data name, data value, data type, and data interpretation list.

[0051] Tables 1 and 2 are structural semantic expression information established for elevation annotation and leader line annotation in one embodiment of the present invention. The first column of the table is the name of the data, the second column is the data value, the third column is the data type, and the fourth column is the data explanation.

[0052] Table 1. Structural semantic information of elevation annotations

[0053]

[0054] Table 2. Structural semantic information of leader annotations

[0055]

[0056] The adjustment rules for annotations include the gravitational coefficient, repulsive coefficient, X-direction degree of freedom, Y-direction degree of freedom, movable range type, and movable range. The gravitational coefficient and repulsive coefficient represent the weight of the movable distance of the annotation after it is subjected to a force. If an annotation is important in the drawing and its position is not to be moved too much, its gravitational coefficient and repulsive coefficient can be set to be small. In this way, the force it receives will be smaller, and its position will be less likely to move or will move less.

[0057] S2, based on the structural semantic expression information, identify the type of annotation in the CAD drawing, read the attraction coefficient, repulsion coefficient, X-direction degree of freedom, Y-direction degree of freedom, movable range type and movable range representation of each annotation, and obtain the adjustment rules for all annotations.

[0058] Taking the elevation markings in Table 1 as an example, the resulting marking adjustment rules are as follows:

[0059] The gravitational coefficient is 0.005, the repulsive coefficient is 0.1; the X-direction degree of freedom is 1 (meaning that the elevation mark can only move in the positive direction in the X direction), the Y-direction degree of freedom is 0 (meaning that the elevation mark cannot move in the Y direction), the movable range type is Line (line segment), and the movable range is: the line segment range from point (2192.73852, 42.11575) to point (9999999, 9999999).

[0060] Similarly, for the leader line annotations in Table 2, the annotation adjustment rules are as follows:

[0061] The gravitational coefficient is 25, the repulsive coefficient is 100; the X and Y directions have 2 degrees of freedom (meaning there are no restrictions on movement in the X and Y directions); the movable range type is OPT (meaning the leader label can be moved arbitrarily).

[0062] S3 is the dynamic adjustment coefficient for the overlap rate of annotations on CAD drawings.

[0063] The dynamic overlap rate adjustment coefficient applies to all annotations in CAD drawings. The dynamic overlap rate adjustment coefficient includes a gravity adjustment coefficient. and repulsion adjustment coefficient The overlap ratio is calculated using the annotations, and the calculation formulas are as follows:

[0064]

[0065]

[0066] in:

[0067] It is the current overlap ratio marked during the drawing optimization process;

[0068] It is the initial overlap ratio of the annotations;

[0069] It is the gravitational gain coefficient, with a value ranging from 0.3 to 0.8, determined based on the optimization effect;

[0070] It is the repulsive force attenuation coefficient, with a value ranging from 0.5 to 1.0, determined based on the optimization effect;

[0071] The overlap rate of the annotations indicates the degree of overlap that occurs in the current drawing.

[0072] The overlap ratio of annotations is calculated by dividing the number of currently overlapping annotations by the total number of annotations in the drawing. For example, if there are 100 annotations in the entire drawing, and 10 of them overlap, then the current overlap ratio is 10 / 100 = 0.1.

[0073] The overlap ratio is variable. Assuming the initial overlap ratio of the drawing is 0.1, if the overlap ratio is 0.05 after the first iteration, the attraction force is increased and the repulsion force is decreased accordingly to make the annotations move more compactly. If the overlap ratio is 0.2 after the first iteration, the attraction force is decreased and the repulsion force is increased to reduce the overlap of the annotations.

[0074] S4 calculates the repulsive force vector between any two annotations in all drawings, the overlapping repulsive force vector of overlapping annotations, and the attractive force vector between each annotation and its corresponding annotated object.

[0075] The repulsion vector is set to prevent labels from overlapping or clustering due to excessive proximity. Overlapping labels should be avoided in the long run; therefore, this invention adds an overlap repulsion penalty for overlapping labels.

[0076] Setting a gravity vector is to avoid the annotation being too far from the object being annotated, which would make the entire drawing too scattered and unsightly. The gravity is calculated using a spring gravity model.

[0077] The specific steps are as follows:

[0078] S41, Calculate the repulsive force vector of each annotation from other annotations. :

[0079]

[0080] in, It is the repulsion coefficient, the value of which comes from the structural semantic expression information of the annotation; It is a label with annotation The difference in coordinate vectors, It is a label with annotation The magnitude of the difference between the coordinate vectors.

[0081] S42, Calculate the overlap repulsion force vector experienced by the overlapping labels. The calculation formula is:

[0082]

[0083] in: It is a label The ratio of the overlapping area to the sum of the areas of the two labels; It is the overlap penalty coefficient, with a value ranging from 800 to 1000.

[0084] by Figure 2 For example, the overlapping area of ​​label 1 and label 2 is calculated as follows: the smaller value of the right boundary of the rectangular borders of the two labels ( Subtract the larger value in the left boundary from the x-coordinate value corresponding to the edge. The x-coordinate value corresponding to the edge), is used as the width of the overlapping rectangle; among the two labeled rectangle borders, the smaller value of the upper boundary ( (y-coordinate value corresponding to the edge) minus the larger value in the lower boundary ( The y-coordinate value corresponding to the edge is used as the height of the overlapping rectangle; the width of the overlapping rectangle is multiplied by the height of the overlapping rectangle to obtain the marked overlapping area.

[0085] That is, the ratio of the overlapping area of ​​label 1 and label 2 to the sum of the areas of the two labels. =rectangle Area / (rectangle) Area + rectangle (area).

[0086] S42, Calculate the gravitational vector between the label and the labeled object using a spring model. The calculation formula is:

[0087]

[0088] in, It is the gravity coefficient, determined by the structural semantic information expressed in the annotation; It is the coordinate difference vector between the label and the labeled object.

[0089] S5, utilizing the repulsive vector Gravitational vector and overlapping repulsive force vector Calculate the resultant force on each annotation in the CAD drawing, and move the annotation position according to the direction of the resultant force and the annotation adjustment rules of the drawing to ensure that the moved position of the annotation conforms to the annotation movement range, thereby achieving the position optimization of the annotation in the drawing.

[0090] Table 1 and Figure 3 Taking the elevation label as an example, the process of moving the elevation label according to the label adjustment rules is as follows:

[0091] First, the vector F of the resultant force on the elevation is calculated by using the gravitational vector, repulsive vector, and overlapping repulsive force vector.

[0092] Then, according to the adjustment rules of the elevation marking obtained from Table 1, the elevation marking has 1 degree of freedom in the X direction and 0 degree of freedom in the Y direction. Therefore, the elevation marking can only move in the positive X direction.

[0093] Next, the projection of the resultant force F onto the X-axis is calculated, and then multiplied by the movement step size to obtain the movement vector of the label in the X direction, thus obtaining the moved label position. In one embodiment of the present invention, the movement step size is 0.1.

[0094] According to the movement rules obtained from Table 1, the movable range of this elevation mark is within the line segment connecting point (2192.73852, 42.11575) and point (9999999, 9999999).

[0095] Determine if the moved label position is within the range of the line segment. If not, multiply the moved label position by the projection operator within the movable range to obtain a position that conforms to the movement rules. For this elevation label, the projection operator is calculated by dividing the X-coordinate of the endpoint of the line segment closest to the current moved position by the X-coordinate of the current moved position.

[0096] Then refer to Table 2 and Figure 3 Taking the leader line annotation as an example, the process of moving the leader line annotation according to the annotation adjustment rules is as follows:

[0097] First, the resultant force vector F is calculated using the gravitational vector, repulsive vector, and overlapping repulsive force vector.

[0098] Then, according to the adjustment rules of the leader label obtained from Table 2, the leader label has 2 degrees of freedom in the X direction and 2 degrees of freedom in the Y direction.

[0099] Calculate the projections of the resultant force F onto the X and Y axes respectively, and then multiply them by a step size of 0.1 to obtain the movement vectors of the leader label in the X and Y directions, thereby obtaining the position of the leader label after its movement.

[0100] As can be seen from the movement rules obtained from Table 2, the movement range of the leader label is any position. Therefore, the leader label is moved according to the movement vectors of the leader label in the X and Y directions to obtain the position after movement.

[0101] S6 sets the number of iterations for S3 to S5, performs iterative optimization, and obtains the optimized railway subgrade CAD drawings.

[0102] Specifically, during the initial optimization, the iteration of the CAD drawing ends when there is no overlap, i.e., the overlap ratio of the annotations stops. However, at this point, the drawing may be too complex and fail to meet requirements for aesthetics and readability. Therefore, it is preferable to continue iterative optimization by increasing the number of iterations by 0.5 times the initial number.

[0103] The above description is a detailed description of the preferred embodiments of the present invention. However, the embodiments are not intended to limit the scope of the patent application of the present invention. All equivalent changes or modifications made under the technical spirit of the present invention shall fall within the protection scope of the present invention.

Claims

1. An adaptive optimization method for drawing layout for multi-type annotation of railway subgrade, characterized in that, include: S1, establish structural semantic expression information for all drawing annotations in railway subgrade CAD drawings; S2, identify the type of each annotation in the CAD drawing, read its structural semantic expression information, and obtain the adjustment rules for all drawing annotations; S3, calculate the dynamic adjustment coefficient for the overlap rate marked in the CAD drawing. The dynamic adjustment coefficient for the overlap rate includes the gravity adjustment coefficient. and repulsion adjustment coefficient ; S4, calculate the repulsion vector between any two annotations in all drawing annotations. The gravitational vector between each annotation and its corresponding annotated object and the overlapping repulsion force vector experienced by overlapping labels. ; S5, utilizing the repulsive vector Gravitational vector and overlapping repulsive force vector Calculate the resultant force vector of each annotation in the CAD drawing, and move the position of the annotation according to the direction of the resultant force vector and the adjustment rule obtained in S2; S6. Repeat steps S3 to S5 for iteration until the optimized railway subgrade CAD drawings are obtained.

2. The adaptive optimization method for drawing layout according to claim 1, characterized in that: The structural semantic expression information mentioned in S1 includes the geometric information of the annotation and the adjustment rules of the annotation. The geometric information and adjustment rules are defined by data name, data value, data type, and data interpretation list. For different annotation types, their adjustment rules are defined according to their importance in the drawing. The adjustment rules include attraction coefficient, repulsion coefficient, X-direction degree of freedom, Y-direction degree of freedom, movable range type, and movable range table.

3. The adaptive optimization method for drawing layout according to claim 1, characterized in that, In S3: Gravity adjustment coefficient The calculation formula is: ; Repulsion adjustment coefficient The calculation formula is: ; in: It is the current overlap ratio marked during the drawing optimization process; It is the initial overlap ratio of the annotations; It is the gravitational gain coefficient, determined based on the optimization effect; It is the repulsive force attenuation coefficient, with a value ranging from 0.5 to 1.0, determined based on the optimization effect; The overlap ratio of annotations is calculated by dividing the number of currently overlapping annotations by the total number of annotations in the drawing.

4. The adaptive optimization method for drawing layout according to claim 3, characterized in that: Gravitational gain coefficient The value ranges from 0.3 to 0.8; the repulsive force attenuation coefficient The value ranges from 0.5 to 1.

0.

5. The adaptive optimization method for drawing layout according to claim 3, characterized in that: In S4, the repulsion vector between any two labels The calculation formula is: ; in, It is the repulsion coefficient, the value of which comes from the structural semantic expression information of the annotation; It is a label with annotation The difference in coordinate vectors, It is a label with annotation The magnitude of the difference between the coordinate vectors.

6. The adaptive optimization method for drawing layout according to claim 5, characterized in that: In S4, the gravitational vector between each label and its corresponding labeled object The calculation formula is: in, It is the gravity coefficient, determined by the structural semantic information expressed in the annotation; It is the coordinate difference vector between the label and the labeled object.

7. The adaptive optimization method for drawing layout according to claim 6, characterized in that: In S4, the overlapping repulsion force vector experienced by the overlapping labels. The calculation formula is: in: It is a label The ratio of the overlapping area to the sum of the areas of the two labels; It is the overlap penalty coefficient, and the preferred value is 800 to 1000.

8. The adaptive optimization method for drawing layout according to claim 7, characterized in that, The method for moving the label position in S5 is as follows: Determine whether it can move in the X direction based on the currently labeled X-direction degree of freedom. If it can, calculate the X-direction component of the resultant force vector; otherwise, the X-direction component is 0. Determine whether it can move in the Y direction based on the currently labeled Y-direction degree of freedom. If it can, calculate the Y-direction component of the resultant force vector; otherwise, the Y-direction component is 0. Multiply the X-direction component by the movement step size to obtain the X-direction movement vector; multiply the Y-direction component by the movement step size to obtain the Y-direction movement vector; obtain the new marked position from the X-direction movement vector and the Y-direction movement vector; According to the movement rules, it is determined whether the new position of the marker is within the movement range of the marker. If not, the X-direction component and the Y-direction component are added together and then multiplied by the projection operator of the movable range to obtain the final movement position. Preferably, the moving step size is 0.

1.

9. The adaptive optimization method for drawing layout according to claim 8, characterized in that: The iteration terminates when the preset number of iterations is reached; or, the iteration terminates when the current overlap ratio calculated during the iteration process is 0.

10. The adaptive optimization method for drawing layout according to claim 9, characterized in that: If the drawing layout does not meet the requirements when the iteration ends, the number of iterations is increased by 0.5 times the initial number to continue optimization.