Unshielded lead marking method and system
By reading and sorting point labeling data in the drawing design, using the influence circle and cover judgment calculation methods to filter search points and generate lead labels, the problem of low efficiency and error-prone manual labeling is solved, and batch lead labeling is realized and the design is improved. efficiency.
Patent Information
- Application Number
- CN202411459194.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-01-21
AI Technical Summary
During the drawing design process, manually marking the range contours on the drawings one by one are inefficient, which are prone to omissions or errors, and requires manual dragging of the marking text to achieve mutual non-blocking, reducing design efficiency.
By reading the point marking data, after the sorting, the marking is marked in a specific order. It uses the influence circle and the cover to judge the computing method to screen out the non -covering search point, generate the leading of the lead, and realize the batch lead labeling.
Batch lead labeling of points is realized to ensure that the labeling text does not cover each other and improves the efficiency of drawing design.
Smart Images

Figure CN119337451A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of drawing design, and relates to a method and system for marking unobstructed lead lines. Background Art
[0002] In the process of drawing design, it is often necessary to mark the range outline or model on some drawings, for example, marking the range outline of the pattern to make the design drawings more readable.
[0003] In the prior art, it is usually necessary to manually annotate the range outlines on the drawings one by one. For drawings with a large number of annotated objects, the number of lead annotation points is huge, for example, hundreds or even thousands. Manual annotation one by one is very inefficient and there is a risk of omissions. It is easy to make mistakes and the annotation text needs to be manually dragged to ensure that they do not overlap each other, which greatly reduces the design efficiency. Summary of the invention
[0004] The object of the present invention is to provide a method and system for marking lead lines without obstruction, so as to realize batch lead marking of points without overlapping the marked texts, thereby improving drawing efficiency.
[0005] In order to achieve the above object, the basic scheme of the present invention is: a method for marking unobstructed lead lines, comprising the following steps:
[0006] S1, reading point marking data, wherein the point marking data includes the x-axis coordinate value, the y-axis coordinate value, and the marking text of the point in the drawing;
[0007] S2, sort all points according to their x-axis coordinate values from small to large. If two or more points have the same x-axis coordinate value, the point with the smaller y-axis coordinate value is placed first, and the point with the larger y-axis coordinate value is placed last. This order is used as the marking order;
[0008] S3, marking the points according to the marking order, and finding all the covering judgment points of each point;
[0009] S4, constructing a label search area for the current point;
[0010] S5, discretize the search area to obtain the search point;
[0011] S6, using the cover judgment operation method to screen the search points one by one, and screen out a search point that has no intersection with other point annotation data;
[0012] S7, if the search point is selected in step S6, a leader mark of the current point is generated with the search point, and then the next point is marked;
[0013] If all search points are traversed and no search point that meets the requirements is found, the influence circle radius R of the current point is increased. k Increase ΔR, which is equal to the length of the diagonal of the text's outer rectangle, that is L is the length of the rectangle surrounding the labeled text, H is the width of the rectangle surrounding the labeled text, all the covering judgment points of each point are re-calculated, and steps S4 to S6 are repeated until a search point that meets the requirements is found, and then the next point is marked;
[0014] S8, repeat steps S3 to S7 until all points are marked.
[0015] The working principle and beneficial effects of this basic solution are as follows: This technical solution reads the point annotation data provided by the designer, which includes the point's x-axis coordinate value, y-axis coordinate value, and annotation text. All points are sorted from small to large according to their x-axis coordinate values, and annotated in this order. The influence circle is used to filter out the cover judgment point of each point to reduce the cover judgment calculation time.
[0016] When marking points, first establish a marking search area, then discretize the search area to obtain search points, and use the cover judgment operation to filter the search points one by one. Filter out a search point that makes the current annotation and all its cover judgment point annotations not overlap, and use the search point to generate a leader annotation, which can realize batch leader annotation of points, and the annotation texts do not overlap each other, improving drawing efficiency.
[0017] Furthermore, in step S3, the points are marked in the marking order, and the method for obtaining all the covering judgment points of each point is as follows:
[0018] Construct the influence circle of the point: take the point as the center and the radius R k The resulting circle is called the influence circle, R k Greater than the diagonal length of the outer rectangle of the dimensioned text. The length of the outer rectangle of the dimensioned text is equal to the length of the dimensioned text plus the width of the left and right margins, and the width is equal to the height of the dimensioned text plus the width of the upper and lower margins.
[0019] Use the influence circle to find the covering judgment point: if the influence circle of another point intersects with the influence circle of the current point, then the other point is the covering judgment point of the current point; if there is no intersection, then it is not.
[0020] The influence circle is used to filter out the cover judgment points at each point to reduce the cover judgment calculation time.
[0021] Further, step S4 constructs a label search area for the current point, and the specific steps are as follows:
[0022] A local rectangular coordinate system is established with the current point as the origin, with the horizontal direction being the X-axis and the vertical direction being the Y-axis. The X-axis and the Y-axis divide the space into four regions, called four influence regions. The marked search area is included in these four influence regions, which correspond to the four quadrants of the X-Y coordinate system.
[0023] Construct a search area in each impact area, which is the area surrounded by two circles and two straight lines;
[0024] The outer radius of search area 1, search area 2, search area 3, and search area 4 is R2, and R2 is the radius of the influence circle R k , the inner circle radius is R1, R1 is greater than the diagonal length of the rectangle surrounding the labeled text, that is L is the length of the rectangle surrounding the labeled text, and H is the width of the rectangle surrounding the labeled text;
[0025] The two straight lines in search area 1 are x=L / 2 and y=H; the two straight lines in search area 2 are x=-L / 2 and y=H; the two straight lines in search area 3 are x=-L / 2 and y=-H; the two straight lines in search area 4 are x=L / 2 and y=-H.
[0026] Construct a marked search area for the current point to facilitate subsequent use.
[0027] Further, in step S5, the search area is discretized to obtain the search points as follows:
[0028] Draw an outer circle with radius OE through corner point B of search area n, n = 1, 2, 3, 4;
[0029] Divide BE into m1 equal parts to obtain equal nodes, where m1 is a positive integer;
[0030] Through these equally divided nodes, a series of concentric circles are drawn with the origin as the center, and multiple arcs are taken where each concentric circle is located within the search area n;
[0031] Divide the arc into equal parts. The number of equal parts of the arc is proportional to the length of the arc. The number of equal parts of the first arc closest to the origin is m2, and the number of equal parts of the remaining arcs is n. i for:
[0032]
[0033] Among them, L i is the length of arc i, L BC is the length of the first arc closest to the origin; when n i When n is a decimal, i Round up;
[0034] The equally divided points and endpoints of all arcs are the search points of the search area n.
[0035] Discretization is to divide the search area into point sets, and the points in the point set are called search points.
[0036] Further, in step S6, the search points that have no intersection with other point annotation data are specifically:
[0037] The text enclosing rectangle of the current point leader annotation has no intersection with the text enclosing rectangle of the marked cover judgment point;
[0038] The text enclosing rectangle of the current point leader line annotation has no intersection with the leader line of the marked cover judgment point;
[0039] The text enclosing rectangle of the current point leader annotation has no intersection with the sign graphics of all the covering judgment points of the current point;
[0040] The leader of the current point leader annotation has no intersection with the text outer rectangle of the marked cover judgment point.
[0041] Setting specific requirements for search points for filtering facilitates troubleshooting.
[0042] Furthermore, the method of using the cover judgment operation method to filter the search points one by one is:
[0043] The search areas are selected according to priority:
[0044] If the order of the points is odd, search in the order of search area 2, search area 1, search area 3, and search area 4;
[0045] If the order of the points is even, search in the order of search area 3, search area 4, search area 2, and search area 1;
[0046] Select a search point within the search area:
[0047] The acute angle between the line connecting the search point and the origin O and the X-axis is recorded as θ, and the length of the line connecting the search point and the origin O is recorded as r. For search area 2 and search area 3, the search starts from the lower limit of r, and for each r, the search is performed from small to large according to θ. For search area 1 and search area 4, the search starts from the upper limit of r, and for each r, the search is performed from large to small according to θ.
[0048] When the search point of search area 1 is selected, the search point is used as the upper right corner point of the rectangle surrounding the text part. When searching area 2 is selected, the search point is used as the upper left corner point. When searching area 3 is selected, the search point is used as the lower left corner point. When searching area 4 is selected, the search point is used as the lower right corner point.
[0049] Simple operation and easy to use.
[0050] The present invention also provides an unobstructed lead marking system, comprising a data acquisition unit and a processing unit, wherein the data acquisition unit is used to read point marking data provided by a designer;
[0051] The input end of the processing unit is connected to the output end of the data acquisition unit, and the processing unit executes the method of the present invention to perform unobstructed lead marking of the drawing.
[0052] The system utilizes data acquisition unit and processing unit to realize batch lead marking of points, and the marked texts do not cover each other, thus improving drawing efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] Figure 1 It is a schematic diagram of the process of the non-blocking lead marking method of the present invention;
[0054] Figure 2 It is a structural schematic diagram of a rectangle surrounding the marking text in the method for marking lead lines without obstruction according to the present invention;
[0055] Figure 3 It is a structural schematic diagram of solving the covering judgment point of the non-obstructed lead line marking method of the present invention;
[0056] Figure 4 It is a structural schematic diagram of the influence area of the unobstructed lead marking method of the present invention;
[0057] Figure 5 It is a structural schematic diagram of the search area of the unobstructed lead marking method of the present invention;
[0058] Figure 6 It is a structural schematic diagram of discretization of the search area of the unobstructed lead marking method of the present invention;
[0059] Figure 7 It is a structural schematic diagram of a search method for search area 2 of the unobstructed lead marking method of the present invention;
[0060] Figure 8 It is a structural schematic diagram of a search method of a search area 1 of the unobstructed lead marking method of the present invention;
[0061] Fig. 9 It is a structural schematic diagram of the relationship between the search point and the outer rectangle of the marked text in the unobstructed lead marking method of the present invention. DETAILED DESCRIPTION
[0062] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be understood as limiting the present invention.
[0063] In the description of the present invention, it is necessary to understand that the terms "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", etc., indicating the orientation or position relationship, are based on the orientation or position relationship shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0064] In the description of the present invention, unless otherwise specified and limited, it should be noted that the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a mechanical connection or an electrical connection, or it can be the internal connection between two components. It can be a direct connection or an indirect connection through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to the specific circumstances.
[0065] The present invention discloses a method for marking a non-blocking lead line. Figure 1 As shown, the following steps are included:
[0066] S1, reading point marking data, the point marking data includes the x-axis coordinate value, y-axis coordinate value, and marking text of the point in the drawing (such as CAD, etc.);
[0067] S2, sort all points according to their x-axis coordinate values from small to large. If two or more points have the same x-axis coordinate value, the point with the smaller y-axis coordinate value is placed first, and the point with the larger y-axis coordinate value is placed last. This order is used as the marking order;
[0068] S3, marking the points according to the marking order, and finding all the covering judgment points of each point;
[0069] S4, constructing a label search area for the current point;
[0070] S5, discretize the search area to obtain the search point;
[0071] S6, using the cover judgment operation method to screen the search points one by one, and screen out a search point that has no intersection with other point annotation data;
[0072] S7, if the search point is selected in step S6, a leader mark of the current point is generated with the search point, and then the next point is marked;
[0073] If all search points are traversed and no search point that meets the requirements is found, the influence circle radius R of the current point is increased. k Increase ΔR, which is equal to the length of the diagonal of the text's outer rectangle, that is L is the length of the rectangle surrounding the labeled text, H is the width of the rectangle surrounding the labeled text, all the covering judgment points of each point are re-calculated, and steps S4 to S6 are repeated until a search point that meets the requirements is found, and then the next point is marked;
[0074] S8, repeat steps S3 to S7 until all points are marked.
[0075] In a preferred embodiment of the present invention, the purpose of solving the covering judgment point is to reduce the time of covering judgment operation. If the covering is judged two by two for the lead line markings of all points, it will take a lot of time.
[0076] Therefore, in order to reduce the calculation time, for each point, the points that may be covered by its leader annotation are first screened out. These screened points are called the covering judgment points of the point, and the remaining points are not subjected to covering judgment calculation with the point. In step S3, the points are marked in the marking order, and the method for finding all the covering judgment points of each point is:
[0077] Construct the influence circle of the point: take the point as the center and the radius R k The resulting circle is called the influence circle, R k It is greater than the diagonal length of the outer rectangle of the dimension text. The length of the outer rectangle of the dimension text is equal to the length of the dimension text plus the width of the left and right margins. The width is equal to the height of the dimension text plus the width of the upper and lower margins. Figure 2 As shown, Ls is the length of the labeled text, Hs is the height of the labeled text, and Ls is the width of the blank space around the text;
[0078] Use the influence circle to find the covering judgment point: if the influence circle of another point intersects with the influence circle of the current point, then the other point is the covering judgment point of the current point; if there is no intersection, then it is not. Figure 3 As shown, for point A, B is the covering judgment point of A, but C is not.
[0079] In a preferred embodiment of the present invention, step S4 constructs a marked search area for the current point, and the specific steps are:
[0080] A local rectangular coordinate system is established with the current point as the origin, with the horizontal direction being the X-axis and the vertical direction being the Y-axis. The X-axis and the Y-axis divide the space into four regions, called four influence regions. The annotation search region is included in these four influence regions, such as Figure 4 As shown;
[0081] Construct a search area in each impact area, which is the area surrounded by two circles and two straight lines;
[0082] The outer radius of search area 1, search area 2, search area 3, and search area 4 is R2, and R2 is the radius of the influence circle R k , the inner circle radius is R1, R1 is greater than the diagonal length of the rectangle surrounding the labeled text, that is L is the length of the rectangle surrounding the labeled text, and H is the width of the rectangle surrounding the labeled text;
[0083] The two straight lines in search area 1 are x=L / 2 and y=H; the two straight lines in search area 2 are x=-L / 2 and y=H; the two straight lines in search area 3 are x=-L / 2 and y=-H; the two straight lines in search area 4 are x=L / 2 and y=-H. The search areas are as follows: Figure 5 shown.
[0084] In a preferred embodiment of the present invention, in step S5, the steps of discretizing the search area to obtain the search points are as follows:
[0085] like Figure 6 As shown, draw an outer circle with radius OE through corner point B of search area n (such as search area 1), n = 1, 2, 3, 4;
[0086] Divide BE into m1 equal parts to obtain equal nodes, where m1 is a positive integer;
[0087] Through these equally divided nodes, a series of concentric circles are drawn with the origin as the center, and multiple arcs of each concentric circle (including the outer circle and the inner circle of the search area) are taken that are located in the search area n;
[0088] Divide the arc into equal parts. The number of equal parts of the arc is proportional to the length of the arc. The number of equal parts of the first arc closest to the origin is m2, and the number of equal parts of the remaining arcs is n. i for:
[0089]
[0090] Among them, L i is the length of arc i, L BC is the length of the first arc closest to the origin; when n i When n is a decimal, i Round up;
[0091] The equally divided points and endpoints of all arcs are the search points of the search area n.
[0092] In a preferred embodiment of the present invention, in step S6, the search points that have no intersection with other point annotation data are specifically:
[0093] The text enclosing rectangle of the current point leader annotation has no intersection with the text enclosing rectangle of the marked cover judgment point;
[0094] The text enclosing rectangle of the current point leader line annotation has no intersection with the leader line of the marked cover judgment point;
[0095] The text enclosing rectangle of the current point leader annotation has no intersection with the sign graphics of all the covering judgment points of the current point;
[0096] The leader of the current point leader annotation has no intersection with the text outer rectangle of the marked cover judgment point.
[0097] In a preferred embodiment of the present invention, the method of screening the search points one by one by using the cover judgment operation method is:
[0098] The search areas are selected according to priority:
[0099] If the order of the points is odd, search in the order of search area 2, search area 1, search area 3, and search area 4;
[0100] If the order of the points is even, search in the order of search area 3, search area 4, search area 2, and search area 1;
[0101] Select a search point within the search area:
[0102] The acute angle between the line connecting the search point and the origin O and the X-axis is recorded as θ, and the length of the line connecting the search point and the origin O is recorded as r. For search areas 2 and 3, the search starts from the lower limit of r. For each r, the search is performed from small to large according to θ, such as Figure 7 As shown. For search area 1 and search area 4, start searching from the upper limit of r. For each r, search from large to small according to θ, as shown Figure 8 As shown;
[0103] When the search point of search area 1 is selected, the search point is used as the upper right corner point of the rectangle surrounding the text part. When the search area 2 is selected, the search point is used as the upper left corner point. When the search area 3 is selected, the search point is used as the lower left corner point. When the search area 4 is selected, the search point is used as the lower right corner point. Fig. 9 shown.
[0104] The present invention also provides an unobstructed lead marking system, including a data acquisition unit and a processing unit. The data acquisition unit is used to read the point marking data provided by the designer. The input end of the processing unit is electrically connected to the output end of the data acquisition unit. The processing unit executes the method described in the present invention to perform unobstructed lead marking of the drawing.
[0105] The system utilizes data acquisition unit and processing unit to realize batch lead marking of points, and the marked texts do not cover each other, thus improving drawing efficiency.
[0106] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0107] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A method for marking unobstructed lead lines, characterized in that: The steps include: S1, reading point marking data, wherein the point marking data includes the x-axis coordinate value, the y-axis coordinate value, and the marking text of the point in the drawing; S2, sort all points according to their x-axis coordinate values from small to large. If two or more points have the same x-axis coordinate value, the point with the smaller y-axis coordinate value is placed first, and the point with the larger y-axis coordinate value is placed last. This order is used as the marking order; S3, marking the points according to the marking order, and finding all the covering judgment points of each point; S4, constructing a label search area for the current point; S5, discretize the search area to obtain the search point; S6, using the cover judgment operation method to screen the search points one by one, and screen out a search point that has no intersection with other point annotation data; S7, if the search point is selected in step S6, a leader mark of the current point is generated with the search point, and then the next point is marked; If all search points are traversed and no search point that meets the requirements is found, the influence circle radius R of the current point is increased. k Increase ΔR, which is equal to the length of the diagonal of the text's outer rectangle, that is L is the length of the rectangle surrounding the labeled text, H is the width of the rectangle surrounding the labeled text, all the covering judgment points of each point are re-calculated, and steps S4 to S6 are repeated until a search point that meets the requirements is found, and then the next point is marked; S8, repeat steps S3 to S7 until all points are marked.
2. The unobstructed lead marking method according to claim 1, characterized in that: In step S3, the points are marked in the marking order, and the method for finding all the covering judgment points of each point is as follows: Construct the influence circle of the point: take the point as the center and the radius R k The resulting circle is called the influence circle, R k Greater than the diagonal length of the outer rectangle of the dimensioned text. The length of the outer rectangle of the dimensioned text is equal to the length of the dimensioned text plus the width of the left and right margins, and the width is equal to the height of the dimensioned text plus the width of the upper and lower margins. Use the influence circle to find the covering judgment point: if the influence circle of another point intersects with the influence circle of the current point, then the other point is the covering judgment point of the current point; if there is no intersection, then it is not.
3. The unobstructed lead marking method according to claim 1, characterized in that: Step S4 constructs the annotation search area of the current point, and the specific steps are as follows: A local rectangular coordinate system is established with the current point as the origin, with the horizontal direction being the X-axis and the vertical direction being the Y-axis. The X-axis and the Y-axis divide the space into four areas, called four influence areas. The marked search area is included in these four influence areas, which correspond to the four quadrants of the X-Y coordinate system. Construct a search area in each impact area, which is the area surrounded by two circles and two straight lines; The outer radius of search area 1, search area 2, search area 3, and search area 4 is R2, and R2 is the radius of the influence circle R k , the inner circle radius is R1, R1 is greater than the diagonal length of the rectangle surrounding the labeled text, that is L is the length of the rectangle surrounding the labeled text, and H is the width of the rectangle surrounding the labeled text; The two straight lines in search area 1 are x=L / 2 and y=H; the two straight lines in search area 2 are x=-L / 2 and y=H; the two straight lines in search area 3 are x=-L / 2 and y=-H; the two straight lines in search area 4 are x=L / 2 and y=-H.
4. The unobstructed lead marking method according to claim 3, characterized in that: In step S5, the search area is discretized to obtain the search points as follows: Draw an outer circle with radius OE through corner point B of search area n, n = 1, 2, 3, 4; Divide BE into m1 equal parts to obtain equal nodes, where m1 is a positive integer; Through these equally divided nodes, a series of concentric circles are drawn with the origin as the center, and multiple arcs are taken where each concentric circle is located within the search area n; Divide the arc into equal parts. The number of equal parts of the arc is proportional to the length of the arc. The number of equal parts of the first arc closest to the origin is m2, and the number of equal parts of the remaining arcs is n. i for: Among them, L i is the length of arc i, L BC is the length of the first arc closest to the origin; when n i When n is a decimal, i Round up; The equally divided points and endpoints of all arcs are the search points of the search area n.
5. The unobstructed lead marking method according to claim 1, characterized in that: In step S6, the search points that have no intersection with other point annotation data are specifically: The text enclosing rectangle of the current point leader annotation has no intersection with the text enclosing rectangle of the marked cover judgment point; The text enclosing rectangle of the current point leader line annotation has no intersection with the leader line of the marked cover judgment point; The text enclosing rectangle of the current point leader annotation has no intersection with the sign graphics of all the covering judgment points of the current point; The leader of the current point leader annotation has no intersection with the text outer rectangle of the marked cover judgment point.
6. The unobstructed lead marking method according to claim 5, characterized in that: The method of using the cover judgment operation method to filter the search points one by one is: The search areas are selected according to priority: If the order of the points is odd, search in the order of search area 2, search area 1, search area 3, and search area 4; If the order of the points is even, search in the order of search area 3, search area 4, search area 2, and search area 1; Select a search point within the search area: The acute angle between the line connecting the search point and the origin O and the X-axis is recorded as θ, and the length of the line connecting the search point and the origin O is recorded as r. For search area 2 and search area 3, the search starts from the lower limit of r, and for each r, the search is performed from small to large according to θ. For search area 1 and search area 4, the search starts from the upper limit of r, and for each r, the search is performed from large to small according to θ. When the search point of search area 1 is selected, the search point is used as the upper right corner point of the rectangle surrounding the text part. When searching area 2 is selected, the search point is used as the upper left corner point. When searching area 3 is selected, the search point is used as the lower left corner point. When searching area 4 is selected, the search point is used as the lower right corner point.
7. An unobstructed leader marking system, characterized in that: It includes a data acquisition unit and a processing unit, wherein the data acquisition unit is used to read the point marking data provided by the designer; The input end of the processing unit is connected to the output end of the data acquisition unit, and the processing unit executes the method described in any one of claims 1 to 6 to perform unobstructed lead marking of the drawing.