A method and system for automatic size number avoidance
By automatically resetting, grouping, sorting, and moving dimension figures, the problems of poor reading effect and low design efficiency caused by overlapping dimension annotations are solved, achieving a design effect of fast processing and clear expression.
Patent Information
- Application Number
- CN202411149220.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2044-08-21
AI Technical Summary
Existing 3D modeling software cannot effectively adjust overlapping dimension numbers when processing dimension annotations, resulting in poor drawing readability and low design efficiency.
Automatic resetting, grouping, sorting, and moving of dimension figures, including classifying and grouping according to the direction and spacing of dimension lines, and avoiding overlap through traversal and movement, achieves automatic avoidance of dimension figures.
It improves design efficiency, reduces repetitive work of manually moving dimensions, and ensures clear drawing representation and rapid design processing.
Smart Images

Figure CN119203280B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of architectural drawings, and in particular to a method and system for automatically avoiding dimension numbers. Background Art
[0002] In the field of architectural engineering design, two-dimensional engineering drawings are the only legally required deliverables for drawing review and delivery. Therefore, two-dimensional engineering drawings need to be detailed with information such as building dimensions, elevations, and text descriptions. Dimensions are used to clarify the size and position of the entire building and its parts, providing a basis for construction and architectural design. The components of dimensions include: dimension lines, dimension limits, dimension start and end symbols, and dimension numbers. Figure 1 As shown. Because architectural construction drawings require a lot of detailed information, some dimension annotations have small spacing, and dimension numbers overlap, resulting in poor drawing reading. In the process of automatic drawing based on 3D models, the generated planar construction drawings contain a large number of dimension annotations. Some of these annotations overlap, and if they are not avoided, the clarity of the drawing will be affected. When adjusting these dimension annotations, designers need to manually move the overlapping dimension numbers, resulting in a lot of repetitive work and low efficiency. Existing 3D modeling software does not process these dimension annotations, so there is an urgent need to develop dimension overlap processing technology.
[0003] In the prior art, the processing of dimension marking is generally only targeted at the X direction or the Y direction, and the position of dimension marking in other directions cannot be adjusted; or the adjustment is targeted at the dimension marking, not the dimension number. Summary of the Invention
[0004] (1) Technical issues to be resolved
[0005] Based on the above problems, the present invention provides a method for automatically avoiding dimension numerals to solve the problem that overlapping dimension numerals affect the reading effect and manual movement is inefficient.
[0006] (2) Technical solution
[0007] Based on the above technical problems, the present invention provides a method for automatically avoiding size numbers, comprising the following steps:
[0008] S1. Reposition the dimension number of the selected dimension mark to the middle position of the dimension;
[0009] S2. Group the reset dimensioning according to the spacing;
[0010] S3, sorting the dimension annotations in each group according to the distance from the coordinate origin;
[0011] S4. Move the dimension numbers of each group of sorted dimension labels according to their width or overlap:
[0012] S41. Traverse the grouped array to obtain the i-th array;
[0013] S42. Determine whether the quantity in the current array is empty. If not, traverse the N dimension labels in the i-th array to obtain the j-th dimension label in the array, where j ∈ [0, N-1], and proceed to step S43. If so, end;
[0014] S43. Calculate the width Wgap between the two dimension limits of the current dimension label, and calculate the width Wj of the dimension number of the current dimension label;
[0015] S44. Determine the size of j. If j = 0, proceed to step S45; if 0 < j < N-1, proceed to step S46; if j = N-1, proceed to step S47; if j > N-1, then i = i + 1, and return to step S42;
[0016] S45. Determine whether the current dimension label overlaps with the dimension labels of other groups, or whether Wj is greater than Wgap. If so, move the dimension number of the current dimension label to the left by a distance D2. Otherwise, let j = j + 1, and return to step S43;
[0017] S46. Determine whether the current dimension label overlaps with the previous dimension label, or whether Wj is greater than Wgap. If so, move the dimension number of the current dimension label down by a distance D3. Otherwise, let j = j + 1, and return to step S43;
[0018] S47. Determine whether the current dimension label overlaps with the previous dimension label, or whether Wj is greater than Wgap. If so, move the dimension number of the current dimension label to the right by a distance D4. Otherwise, let j = j + 1, and return to step S43.
[0019] Further, in S2, before the grouping, it further includes: classifying the reset dimension labels according to the direction of the dimension line.
[0020] Further, the classifying the reset dimension labels according to the direction of the dimension line includes: obtaining the head and tail coordinates of the dimension line of the current dimension label to obtain the direction vector Vi of the dimension line, and calculating the included angle θ between Vi and the positive X-axis vector Vx;
[0021] If θ is equal to 0° or 180°, it is classified as an X-direction dimension label, that is, a dimension label parallel to the X-axis, and included in the classification array vTypeX;
[0022] If θ is equal to 90° or 270°, it is classified as a Y-direction dimension label, that is, a dimension label parallel to the Y-axis, and included in the classification array vTypeY;
[0023] If θ is greater than 0° and less than 90°, or θ is greater than 180° and less than 270°, it is classified as XY dimensioning, that is, dimensioning in the first and third quadrants, and is included in the classification array vTypeXY;
[0024] If θ is greater than 90° and less than 180° or θ is greater than 270° and less than 360°, it is classified as a YX dimension, that is, a dimension in the second or fourth quadrant, and is included in the classification array vTypeYX.
[0025] Furthermore, S2 includes: determining whether the current dimension annotation and the previous dimension annotation meet the same group requirement; if so, the two dimension annotations are determined to be in the same group; otherwise, they are not in the same group, until all dimension annotations are traversed to form a group array; the same group requirement is that the rear dimension limit of the previous dimension coincides with the front dimension limit of the current dimension or is less than the set distance D1, and the dimension lines are parallel.
[0026] Furthermore, D2 and D4 are the sum of 0.5 times the width between the two dimension limits of the current dimension mark and the width of the current dimension number, and D3 is the height of the current dimension number plus 200 mm.
[0027] Furthermore, D1 is set to a larger value between 1.0-1.5 times the width of the current size number and 300 mm.
[0028] The present invention also discloses a size number automatic avoidance system, comprising:
[0029] at least one processor; and at least one memory communicatively coupled to the processor, wherein:
[0030] The memory stores program instructions that can be executed by the processor, and the processor can execute the method by calling the program instructions.
[0031] The present invention also discloses a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions enable the computer to execute the method.
[0032] (3) Beneficial effects
[0033] The above technical solution of the present invention has the following advantages:
[0034] (1) The present invention automatically resets, groups, sorts, and moves dimension numbers of dimension annotations, so that users only need to select any dimension annotation to be processed, and dimension annotations with overlapping dimension numbers can be quickly processed, thus avoiding the repetitive work of manually moving dimension numbers, saving design time, and improving design efficiency;
[0035] (2) The present invention also reduces the number of traversals and improves traversal efficiency by classifying according to the direction of the dimension line. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] The features and advantages of the present invention will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present invention in any way. In the accompanying drawings:
[0037] Figure 1 A schematic diagram of the dimensions of the present invention;
[0038] Figure 2 Schematic diagram of the flow of the automatic size number avoidance method according to an embodiment of the present invention;
[0039] Figure 3 A classification diagram of an embodiment of the present invention;
[0040] Figure 4 This is a schematic diagram of dimension marking after sorting and before moving according to an embodiment of the present invention;
[0041] Figure 5 This is a schematic diagram of dimension marking after movement processing according to an embodiment of the present invention;
[0042] Figure 6 Flowchart of the mobile processing according to an embodiment of the present invention. DETAILED DESCRIPTION
[0043] The following embodiments of the present invention are described in further detail with reference to the accompanying drawings and examples. The following examples are used to illustrate the present invention but are not intended to limit the scope of the present invention.
[0044] A method for automatically avoiding size numbers of the present invention, such as Figure 2 As shown, the following steps are included:
[0045] S1. Reposition the dimension number of the selected dimension mark to the middle position of the dimension;
[0046] Reset the dimension number of the dimension selected by the user so that the dimension number is located in the middle of the dimension.
[0047] S2. Classify the reset dimensioning according to the direction of the dimension line and group them according to the spacing;
[0048] The reset dimensions are grouped based on spacing, including: traversing the dimensions of the current category and determining whether the current dimension meets the same grouping requirement as the previous dimension. If so, the two dimensions are considered to be in the same group; otherwise, they are not. This process continues until all dimensions are traversed, forming a grouping array vGroup. The same grouping requirement for dimensions is that the previous dimension's rear dimension limit and the current dimension's front dimension limit coincide or are less than a set distance D1, and the dimension lines are parallel. D1 is set to the larger of 1.0-1.5 times the width of the current dimension number or 300mm.
[0049] Before grouping, the reset dimension annotations need to be classified according to the direction of the dimension line; this includes: obtaining the first and last coordinates of the dimension line of the current dimension annotation, obtaining the direction vector Vi of the dimension line, and calculating the angle θ between Vi and the positive vector Vx of the X axis. If θ is equal to 0° or 180°, it is classified as an X-direction dimension annotation, that is, a dimension annotation parallel to the X axis, and is included in the classification array vTypeX; if θ is equal to 90° or 270°, it is classified as a Y-direction dimension annotation, that is, a dimension annotation parallel to the Y axis, and is included in the classification array vTypeY If θ is greater than 0° and less than 90° or θ is greater than 180° and less than 270°, it is classified as XY dimensioning, that is, dimensioning in the first and third quadrants, and included in the classification array vTypeXY; if θ is greater than 90° and less than 180° or θ is greater than 270° and less than 360°, it is classified as YX dimensioning, that is, dimensioning in the second and fourth quadrants, and included in the classification array vTypeYX; thus forming four classification arrays vTypeX, vTypeY, vTypeXY, and vTypeYX, as shown Figure 3 shown.
[0050] For similar dimension numbers, overlap is more likely to occur. By classifying them according to the direction of the dimension line, the number of traversals in subsequent steps is reduced, and the traversal efficiency is improved.
[0051] You can also directly traverse all dimension annotations without classifying them according to the direction of the dimension line.
[0052] S3, sorting the dimension annotations in each group according to the distance from the coordinate origin;
[0053] Sort each group array vGroup according to the distance from the coordinate origin, such as Figure 4 As shown, it is convenient for subsequent overlap judgment and overlap processing.
[0054] S4, move the dimension numbers of each group of sorted dimensions according to the width or overlap of the dimension numbers; after the movement, Figure 5 As shown, the mobile processing method is as follows Figure 6As shown in the figure, specifically including:
[0055] S41. Traverse the grouped array to obtain the i-th array vGroup[i];
[0056] S42. Determine whether the quantity in the current array is empty. If not, traverse the N dimension annotations in the i-th array vGroup[i] to obtain the j-th dimension annotation in this array, where j ∈ [0, N - 1], and enter step S43. If so, end;
[0057] S43. Calculate the width Wgap between the two dimension boundaries of the current dimension annotation, and calculate the width Wj of the dimension number of the current dimension annotation;
[0058] S44. Judge the size of j. If j = 0, enter step S45; if 0 < j < N - 1, enter step S46; if j = N - 1, enter step S47; if j > N - 1, then i = i + 1, and return to step S42;
[0059] S42 has excluded the current array being empty, so N > 0, and j ∈ [0, N - 1]. In S44, when j is equal to 0, j represents the first dimension annotation in the sorted array; when j is greater than 0 and less than N - 1, j represents the dimension annotation in the middle position of the sorted array; when j is equal to N - 1, j represents the last dimension annotation in the sorted array; when j is greater than N - 1, it means that the dimension annotations of this array have been traversed, and enter the next array.
[0060] S45. Judge whether there is an overlap between the current dimension annotation and the dimension annotations of other groups, or whether Wj is greater than Wgap. If so, move the dimension number of the current dimension annotation to the left by a distance D2. Otherwise, do not process the dimension number of the current dimension annotation, let j = j + 1, and return to step S43;
[0061] When j represents the first dimension annotation in the sorted array, it is necessary to judge whether there is an overlap with the dimension annotations of other groups. If there is an overlap with the dimension annotations of other groups or Wj is greater than the width Wgap between the two dimension boundaries of the current dimension annotation, as long as one of them is satisfied, that is, there is an overlap with the dimension annotations of other groups, or the number of the current dimension annotation exceeds the dimension boundary, then the dimension number of the current dimension annotation needs to be moved. Since it is the first dimension annotation, move the dimension number to the left by a distance D2. The moving distance D2 is adjusted according to the current dimension annotation, and is set to the sum of 0.5 times the width between the two dimension boundaries of the current dimension annotation and the width of the current dimension number.
[0062] S46. Determine whether the current dimension overlaps with the previous dimension, or whether Wj is greater than Wgap. If so, move the dimension number of the current dimension downward by a distance D3. Otherwise, do not process the dimension number of the current dimension, set j = j + 1, and return to step S43.
[0063] When j represents the dimension at the middle position of the sorted array, if it overlaps with the previous dimension or Wj is greater than the width Wgap between the two dimension limits of the current dimension, the dimension number of the current dimension needs to be moved. Since it is the middle dimension, the dimension number is moved downward by a distance D3. The moving distance D3 is adjusted according to the current dimension and is set to the height of the current dimension number plus 200mm.
[0064] S47. Determine whether the current dimension overlaps with the previous dimension, or whether Wj is greater than Wgap. If so, move the dimension number of the current dimension rightward by a distance D4. Otherwise, do not process the dimension number of the current dimension, set j = j + 1, and return to step S43.
[0065] When j represents the last dimension in the sorted array, if it overlaps with the previous dimension or Wj is greater than the set width Wgap between the two dimension boundaries, if either of the two conditions is met, the dimension number of the current dimension needs to be moved. Since it is the last dimension, the dimension number is moved to the right by a distance D4. The moving distance D4 is adjusted according to the current dimension and is set to the sum of 0.5 times the width between the two dimension boundaries of the current dimension and the width of the current dimension number.
[0066] Through the movement processing of S45-S47, there is no overlap in the size numbers, such as Figure 5 shown.
[0067] Finally, it should be noted that the above method can be converted into software program instructions, which can be implemented by running a system including a processor and a memory, or by computer instructions stored in a non-transitory computer-readable storage medium. The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0068] In summary, the above-mentioned method and system for automatically avoiding size numbers have the following beneficial effects:
[0069] (1) The present invention automatically resets, groups, sorts, and moves dimension numbers of dimension annotations, so that users only need to select any dimension annotation to be processed, and dimension annotations with overlapping dimension numbers can be quickly processed, thus avoiding the repetitive work of manually moving dimension numbers, saving design time, and improving design efficiency;
[0070] (2) The present invention also reduces the number of traversals and improves traversal efficiency by classifying according to the direction of the dimension line.
[0071] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations shall fall within the scope defined by the appended claims.
Claims
1. A method for automatically avoiding size numbers, characterized in that: It includes the following steps: S1. Reposition the dimension value of the selected dimension annotation to the middle position of the dimension; S2. Group the repositioned dimension annotations according to the spacing; S3. Sort the dimension annotations in each group according to the distance from the coordinate origin; S4. Perform the movement processing of the dimension values for the sorted dimension annotations in each group according to the width of the dimension value or the overlapping situation: S41. Traverse the grouped array to obtain the i-th array; S42. Judge whether the quantity in the current array is empty. If not, traverse the N dimension annotations in the i-th array to obtain the j-th dimension annotation in the array, where j ∈ [0, N - 1], and enter step S43. If so, end; S43. Calculate the width Wgap between the two dimension boundaries of the current dimension annotation, and calculate the width Wj of the dimension value of the current dimension annotation; S44. Judge the value of j. If j = 0, enter step S45; if 0 < j < N - 1, enter step S46; if j = N - 1, enter step S47; if j > N - 1, then i = i + 1, and return to step S42; S45. Judge whether there is an overlap between the current dimension annotation and the dimension annotations in other groups, or whether Wj is greater than Wgap. If so, move the dimension value of the current dimension annotation to the left by a distance D2. Otherwise, let j = j + 1, and return to step S43; S46. Judge whether there is an overlap between the current dimension annotation and the previous dimension annotation, or whether Wj is greater than Wgap. If so, move the dimension value of the current dimension annotation downward by a distance D3. Otherwise, let j = j + 1, and return to step S43; S47. Judge whether there is an overlap between the current dimension annotation and the previous dimension annotation, or whether Wj is greater than Wgap. If so, move the dimension value of the current dimension annotation to the right by a distance D4. Otherwise, let j = j + 1, and return to step S43.
2. The automatic avoidance method for size numbers according to claim 1, characterized in that: In S2, before the grouping, it further includes: classifying the repositioned dimension annotations according to the direction of the dimension line.
3. The automatic size number avoidance method according to claim 2, characterized in that: The classifying the repositioned dimension annotations according to the direction of the dimension line includes: obtaining the head and tail coordinates of the dimension line of the current dimension annotation to get the direction vector Vi of the dimension line, and calculating the included angle θ between Vi and the positive X-axis vector Vx; If θ is equal to 0° or 180°, it is classified as an X-direction dimension annotation, that is, a dimension annotation parallel to the X-axis, and is included in the classification array vTypeX; If θ is equal to 90° or 270°, it is classified as a Y-direction dimension annotation, that is, a dimension annotation parallel to the Y-axis, and is included in the classification array vTypeY; If θ is greater than 0° and less than 90°, or θ is greater than 180° and less than 270°, it is classified as an XY-direction dimension annotation, that is, a dimension annotation in the first and third quadrants, and is included in the classification array vTypeXY; If θ is greater than 90° and less than 180° or θ is greater than 270° and less than 360°, it is classified as a YX-direction dimension annotation, that is, a dimension annotation in the second and fourth quadrants, and is included in the classification array vTypeYX.
4. The automatic size number avoidance method according to claim 1, characterized in that: The S2 includes: determining whether the current dimension annotation and the previous dimension annotation meet the same group requirement; if so, the two dimension annotations are determined to be in the same group; otherwise, they are not in the same group, until all dimension annotations are traversed to form a group array; the same group requirement is that the rear dimension limit of the previous dimension coincides with the front dimension limit of the current dimension or is less than a set distance D1, and the dimension lines are parallel.
5. The automatic avoidance method for size numbers according to claim 1, characterized in that: D2 and D4 are the sum of 0.5 times the width between the two dimension limits of the current dimension mark and the width of the current dimension number, and D3 is the height of the current dimension number plus 200 mm.
6. The automatic size number avoidance method according to claim 4, characterized in that: The D1 is set to a larger value between 1.0-1.5 times the width of the current size number and 300 mm.
7. A size digital automatic avoidance system, characterized in that: include: at least one processor; and at least one memory communicatively connected to the processor, wherein: The memory stores program instructions that can be executed by the processor, and the processor calls the program instructions to execute the method according to any one of claims 1 to 6.
8. A non-transitory computer-readable storage medium, characterized in that The non-transitory computer-readable storage medium stores computer instructions, which cause the computer to execute the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Automatic labeling and typesetting method for decoration drawings
CN110598195A
Drawing size mark retrieval method and device, electronic equipment and storage medium
CN114817604A