Circuit layout trace segment movement obstacle detection method, device, medium and equipment

By constructing search rectangles and object rectangles to detect obstacle segments in the circuit layout, the problems of low efficiency and misjudgment when moving trace segments in circuit layout design are solved, achieving efficient and accurate obstacle segment detection and improving routing efficiency.

CN122113814APending Publication Date: 2026-05-29ORIGIN QUANTUM INSTR CO
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ORIGIN QUANTUM INSTR CO
Filing Date
2024-11-22
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

In existing technologies, it is difficult to efficiently and accurately detect obstacle segments when the trace segments move during circuit layout design, resulting in low wiring efficiency and a high risk of errors, especially in dense circuits.

Method used

By constructing a search rectangle and an object rectangle, candidate line segments that are parallel to and normal to the target line segment pointing to the endpoint of the movement are selected, and the target line segment is stretched to be collinear with each candidate line segment. Intersecting line segments are detected as obstacle line segments.

Benefits of technology

It enables automated detection of obstacle segments, improves wiring efficiency, ensures the accuracy and speed of detection, and allows users to quickly adjust wiring.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122113814A_ABST
    Figure CN122113814A_ABST
Patent Text Reader

Abstract

The application discloses a circuit layout wire segment moving obstacle detection method, device, medium and equipment. The method comprises the following steps: obtaining a target segment to be moved on a circuit layout wire and a moving endpoint thereof; constructing a search rectangle surrounding the moving endpoint and two endpoints of the target segment in a preset direction, and an object rectangle surrounding two endpoints of a segment on other wires; selecting a segment parallel to the target segment and located in the normal direction of the target segment pointing to the moving endpoint from the segments intersected by the object rectangle and the search rectangle as a candidate segment; stretching the target segment to be collinear with each candidate segment to obtain a stretched segment, and detecting whether each stretched segment intersects with the corresponding candidate segment; and determining the candidate segment with the detection result of intersection as an obstacle segment. The application can realize automatic detection of the obstacle segment affecting the movement of the segment, and improve the layout wiring efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of circuit layout design, and in particular to a method, apparatus, medium, and equipment for detecting obstacles to the movement of circuit layout trace segments. Background Technology

[0002] In circuit layout design, after drawing the layout graphics of components, pads, and other circuit entities, it is necessary to arrange polygonal traces between the connection points of each layout graphic to represent the circuit connection relationship. Existing routing methods include manual routing and automatic routing. Manual routing is done by designers manually, while automatic routing is performed automatically by software according to pre-set routing rules.

[0003] However, regardless of the routing method used, the resulting traces are rarely able to fully meet requirements for signal integrity, power distribution, timing, and area constraints, necessitating local adjustments by designers. In some scenarios, it's necessary to move the position of a trace segment, but this movement may be obstructed by parallel trace segments. Therefore, these parallel segments must also be moved, but this requires identifying which parallel segments will create obstacles. Currently, layout designers can only rely on visual inspection or manual calculation to determine which segments are obstacles. For circuit layouts with very dense routing and extremely narrow spacing, this method is extremely inefficient and prone to errors. Summary of the Invention

[0004] The purpose of this invention is to provide a method, apparatus, medium, and device for detecting obstacles in the movement of circuit layout trace segments, so as to solve the problems of low efficiency and easy error in the existing technology of finding obstacle segments by visual inspection or manual calculation. This invention can realize the automated detection of obstacle segments that affect the movement of trace segments, thereby improving the efficiency of circuit layout routing.

[0005] To solve the above technical problems, the present invention provides a method for detecting obstacles to the movement of trace segments in circuit layout, comprising:

[0006] Obtain the target line segment to be moved on the circuit layout and its endpoint.

[0007] Construct a search rectangle along a preset direction that surrounds the two endpoints of the moving endpoint and the target line segment, and an object rectangle that surrounds the two endpoints of line segments on other paths;

[0008] Select a line segment from the line segments where the object rectangle and the search rectangle intersect, that is located in the normal direction of the target line segment pointing to the moving endpoint and is parallel to the target line segment, as a candidate line segment;

[0009] The target line segment is stretched to be collinear with each of the candidate line segments to obtain a stretched line segment, and it is detected whether each stretched line segment intersects with the corresponding candidate line segment.

[0010] Candidate line segments that intersect in the test results are identified as obstacle line segments.

[0011] Preferably, the step of obtaining the target line segment to be moved and its endpoint on the circuit layout trace includes:

[0012] In response to a selection command, the current line segment on the circuit layout is used as the target line segment;

[0013] The mouse position point is acquired in real time and used as the endpoint of the movement of the target line segment.

[0014] Preferably, constructing a search rectangle along a preset direction that surrounds the moving endpoint and the two endpoints of the target line segment includes:

[0015] Path points are set at preset distances from both ends of the target line segment on the straight line where the target line segment is located;

[0016] Select the minimum x-coordinate, minimum y-coordinate, maximum x-coordinate, and maximum y-coordinate of the endpoint and the two path points;

[0017] A search rectangle is constructed along a preset direction, with the minimum value of the horizontal coordinate, the minimum value of the vertical coordinate, the maximum value of the horizontal coordinate, and the maximum value of the vertical coordinate as diagonal vertices.

[0018] Preferably, constructing the object rectangle surrounding the two endpoints of line segments on other routes along a preset direction includes:

[0019] Check whether the line segments on other routes are parallel or perpendicular to the preset direction;

[0020] Construct an object rectangle with the line segment as the axis and the width as the preset value on a line segment that is parallel or perpendicular to the preset direction;

[0021] Feature points, including endpoints, are selected at intervals on line segments that are not parallel or perpendicular to the preset direction. An object rectangle is constructed along the preset direction using two adjacent feature points as diagonal vertices.

[0022] Preferably, the feature points are selected at intervals of the preset line spacing.

[0023] Preferably, selecting a line segment from the line segments intersecting the object rectangle and the search rectangle that is parallel to the target line segment and located on the normal direction pointing from the target line segment to the moving endpoint, as a candidate line segment, includes:

[0024] Use the line segment where the object rectangle intersects the search rectangle as the first filtering line segment;

[0025] Select a line segment from the first filtered line segment that is parallel to the target line segment as the second filtered line segment;

[0026] Select from the second filtered line segments the line segment located in the normal direction of the target line segment pointing to the endpoint of the movement as the candidate line segment.

[0027] Preferably, stretching the target line segment to be collinear with each of the candidate line segments to obtain the stretched line segment includes:

[0028] Calculate the normal distance between the target line segment and each of the candidate line segments;

[0029] Determine whether the target line segment is connected to two adjacent line segments.

[0030] If there are two adjacent line segments, keep the slope and connection relationship of the adjacent line segments on the path where the target line segment is located unchanged, and move the target line segment toward the candidate line segment according to the normal spacing to form a stretched line segment;

[0031] If there is only one adjacent line segment, keep the slope and connection relationship of the adjacent line segments on the path where the target line segment is located unchanged, generate a ray with the angle between the target line segment and the target line segment as a preset angle, and move the target line segment toward the candidate line segment according to the normal spacing to form an stretched line segment with the endpoint located on the ray.

[0032] Preferably, detecting whether each of the stretched line segments intersects with the corresponding candidate line segments includes:

[0033] Detect whether the slope of each of the stretched line segments and the corresponding candidate line segments exists;

[0034] When the slope does not exist, the current stretched line segment and the corresponding candidate line segment are projected along the normal direction onto the Y-axis of the reference coordinate system; and when the slope exists, the current stretched line segment and the corresponding candidate line segment are projected along the normal direction onto the X-axis of the reference coordinate system.

[0035] Determine whether the projections of the currently stretched line segment and the corresponding candidate line segment on the X-axis or Y-axis coincide;

[0036] If they overlap, it is confirmed that the currently stretched line segment intersects with the corresponding candidate line segment.

[0037] To address the aforementioned technical problems, the present invention also provides a circuit layout trace segment movement obstacle detection device, comprising:

[0038] The acquisition module is used to acquire the target line segment to be moved on the circuit layout and its endpoint.

[0039] The construction module is used to construct a search rectangle that surrounds the two endpoints of the moving endpoint and the target line segment along a preset direction, as well as an object rectangle that surrounds the two endpoints of line segments on other paths.

[0040] The filtering module is used to select, from the line segments where the object rectangle and the search rectangle intersect, a line segment located in the normal direction of the target line segment pointing to the moving endpoint and parallel to the target line segment as a candidate line segment;

[0041] The detection module is used to stretch the target line segment to be collinear with each of the candidate line segments to obtain a stretched line segment, and to detect whether each stretched line segment intersects with the corresponding candidate line segment.

[0042] The confirmation module is used to identify intersecting candidate line segments as obstacle line segments.

[0043] To address the aforementioned technical problems, the present invention also provides a storage medium storing a computer program configured to execute the circuit layout trace segment movement obstacle detection method described in any of the preceding claims when running.

[0044] To address the aforementioned technical problems, the present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the circuit layout trace segment movement obstacle detection method described in any of the preceding claims.

[0045] Unlike existing technologies, the circuit layout routing segment movement obstacle detection method provided by this invention, after obtaining the target line segment and its movement endpoint, first constructs a search rectangle surrounding the movement endpoint and the two endpoints of the target line segment, and an object rectangle surrounding the two endpoints of other line segments. Then, from the line segments where the object rectangle intersects with the search rectangle, line segments located on the normal direction pointing from the target line segment to the movement endpoint and parallel to the target line segment are selected as candidate line segments. The target line segment is then stretched to be collinear with each candidate line segment to obtain stretched line segments, and it is detected whether each stretched line segment intersects with the corresponding candidate line segment. Finally, the candidate line segments that intersect are determined as obstacle line segments. This invention can automatically detect obstacle line segments that affect line segment movement, and can efficiently, accurately, and quickly detect obstacle line segments of the line segment to be moved, facilitating users to quickly adjust the routing, thus improving the efficiency of layout routing.

[0046] The circuit layout trace segment movement obstacle detection device, storage medium, and electronic device provided by this invention belong to the same inventive concept as the circuit layout trace segment movement obstacle detection method, and therefore have the same beneficial effects, which will not be repeated here. Attached Figure Description

[0047] Figure 1 This is a schematic flowchart illustrating the method for detecting obstacles to the movement of circuit layout trace segments provided in an embodiment of the present invention.

[0048] Figure 2 This is a schematic diagram of the target line segment and its endpoint.

[0049] Figure 3 This is a diagram illustrating the search rectangle and the object rectangle.

[0050] Figure 4 This is a schematic diagram of the stretching line segment and the alternative line segment.

[0051] Figure 5 for Figure 1 A detailed flowchart of step S1 in the process shown.

[0052] Figure 6 This is a schematic diagram illustrating the process of constructing the search rectangle.

[0053] Figure 7 This is a schematic diagram of the search rectangle.

[0054] Figure 8 This is a diagram illustrating the process of constructing an object rectangle.

[0055] Figure 9 A schematic diagram of an object rectangle constructed on a line segment that is neither parallel nor perpendicular to a preset direction.

[0056] Figure 10 A flowchart illustrating the process of selecting candidate line segments.

[0057] Figure 11 A schematic diagram illustrating the specific process for generating stretched line segments.

[0058] Figure 12 A schematic diagram of stretching a line segment when the target line segment is connected to two adjacent line segments.

[0059] Figure 13 This is a diagram illustrating the stretching of a line segment when the target line segment is connected to only one adjacent line segment.

[0060] Figure 14 This is a schematic diagram illustrating the specific process of intersection detection between the target line segment and the candidate line segments.

[0061] Figure 15 This is a schematic diagram of the projection of the stretched line segment and the alternative line segment onto the Y-axis.

[0062] Figure 16 This is a schematic diagram of the projection of the stretched line segment and the alternative line segment onto the X-axis.

[0063] Figure 17 This is a schematic diagram of a circuit layout trace segment movement obstacle detection device. Detailed Implementation

[0064] The specific embodiments of the present invention will now be described in more detail with reference to the accompanying drawings. The advantages and features of the present invention will become clearer from the following description and claims. It should be noted that the drawings are all in a very simplified form and use non-precise proportions, and are only used to facilitate and clarify the illustration of the embodiments of the present invention.

[0065] In the description of this invention, it should be understood that the terms "center", "upper", "lower", "left", "right", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0066] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0067] Please refer to Figure 1 This invention provides a method for detecting obstacles to the movement of trace segments in a circuit layout. The method includes the following steps:

[0068] S1: Obtain the target line segment to be moved on the circuit layout and its endpoint.

[0069] In circuit wiring design, traces are often designed as zigzag lines. This design has many advantages, such as reducing signal interference during transmission, improving circuit reliability, and saving wiring space. The target line segment can be determined based on external input, such as the user selecting a segment of the trace using the mouse, thus designating it as the target line segment.

[0070] The endpoint is a coordinate point in a circuit layout that indicates the position of a target line segment after it has been moved along the normal direction. At this position, the target line segment will be collinear with the endpoint, meaning they will lie on the same line. The endpoint can be obtained in several ways, such as by clicking with a mouse, where the mouse cursor position is the endpoint, or by the user selecting the endpoint by inputting coordinates.

[0071] like Figure 2The diagram shown is a schematic of the target line segment and its endpoint. The target line segment H is a line segment of a path, and the endpoint P is located on one side of the target line segment H.

[0072] S2: Construct a search rectangle along a preset direction that surrounds the two endpoints of the moving endpoint and the target line segment, as well as an object rectangle that surrounds the two endpoints of line segments on other paths.

[0073] Both the search rectangle and the object rectangle are constructed along a preset direction, meaning that one axis of both the search rectangle and the object rectangle is parallel to the preset direction. The search rectangle encloses the two endpoints of the move endpoint and the target line segment; therefore, the two endpoints of the move endpoint and the target line segment can lie on the edge of the search rectangle or inside the search rectangle. Similarly, the object rectangle encloses the two endpoints of line segments on other lines; therefore, the two endpoints of line segments on other lines can lie on the edge of the object rectangle or inside the object rectangle.

[0074] like Figure 3 The diagram shows a search rectangle and an object rectangle. The search rectangle S and the object rectangle D are constructed along a preset direction F. The search rectangle S encloses the two endpoints of the movement endpoint P and the target line segment H. There are multiple object rectangles D, which correspond to line segments L1 to L9 on other paths and enclose the two endpoints of these line segments respectively.

[0075] S3: Select a line segment from the line segments where the object rectangle and the search rectangle intersect, that is parallel to the target line segment and located on the normal direction pointing to the end point of the movement, as a candidate line segment.

[0076] In this process, if the object rectangle does not intersect the search rectangle, it means that the line segment will not affect the movement of the target line segment. Only when the object rectangle intersects the search rectangle can the corresponding line segment potentially affect the movement of the target line segment. Furthermore, only parallel line segments that are also located in the normal direction of the target line segment pointing to the end point of movement will be considered obstacles. Therefore, candidate line segments need to meet three conditions: their object rectangle intersects the search rectangle, they are located in the normal direction of the target line segment pointing to the end point of movement, and they are parallel to the target line segment.

[0077] like Figure 3 As shown, among line segments L1 to L9, only the object rectangle D of line segments L2 and L8 intersects with the search rectangle S. However, only line segment L2 is parallel to the target line segment H and is located in the normal direction of the target line segment H pointing to the moving endpoint P. Therefore, line segment L2 is selected as the candidate line segment.

[0078] S4: Stretch the target line segment to be collinear with each candidate line segment to obtain the stretched line segment, and check whether each stretched line segment intersects with the corresponding candidate line segment.

[0079] Based on the geometric properties of polylines, one of the endpoints of the target line segment must be an endpoint of another line segment. If one endpoint of the target line segment is an endpoint of another line segment, the slope of the other line segment remains unchanged, and the endpoint moves as the target line segment moves. If one endpoint of the target line segment is not an endpoint of another line segment, a ray is generated on the side where the target line segment reaches its endpoint, originating from that endpoint and forming a preset angle with the target line segment. When the target line segment is stretched, the original endpoint position remains unchanged, while the endpoint of the stretched line segment lies on this ray. The preset angle is, for example, 45 degrees. Therefore, the length of the stretched line segment may be shorter or longer than the target line segment.

[0080] The intersection of the stretched line segment and the candidate line segment means that the stretched line segment and the candidate line segment at least partially overlap.

[0081] like Figure 4 The diagram shows the stretching segment and the candidate segments. Assume there are two candidate segments, L1 and L2. The left side of the diagram shows the target segment H before stretching and the candidate segments L1 and L2. The right side shows the stretching segments S1 and S2 and the candidate segments L1 and L2. Stretching segment S1 is collinear with candidate segment L1, and stretching segment S2 is collinear with candidate segment L2. Stretching segment S1 intersects candidate segment L1, while stretching segment S2 does not intersect candidate segment L2.

[0082] S5: Identify the candidate line segments that intersect as obstacle line segments based on the detection results.

[0083] If the stretched line segment intersects with the candidate line segment, then the candidate line segment is determined as the obstacle line segment of the target line segment. In other words, the target line segment will cross the obstacle line segment during its movement to be collinear with the destination.

[0084] like Figure 3 As shown, candidate line segment L2 is an obstacle line segment to target line segment H.

[0085] In the above manner, the circuit layout routing segment movement obstacle detection method provided by the embodiments of the present invention, after obtaining the target line segment and its movement endpoint, first constructs a search rectangle based on the two endpoints of the movement endpoint and the target line segment, and constructs an object rectangle based on the two endpoints of the line segments on other routing lines. Then, from the line segments where the object rectangle intersects with the search rectangle, line segments located on the normal direction of the target line segment pointing to the movement endpoint and parallel to the target line segment are selected as candidate line segments. The target line segment is then stretched to be collinear with each candidate line segment to obtain stretched line segments, and it is detected whether each stretched line segment intersects with the corresponding candidate line segment. Finally, the candidate line segments that intersect are determined as obstacle line segments. The present invention can automatically detect obstacle line segments that affect the movement of line segments, and can efficiently, accurately and quickly detect obstacle line segments of the line segment to be moved, which facilitates quick routing adjustments by users, thus improving the efficiency of layout routing.

[0086] In the embodiments of this application, please refer to Figure 5 ,yes Figure 1 The flowchart for step S1 in the illustrated process is shown below. Step S1, which involves obtaining the target line segment to be moved on the circuit layout trace and its endpoint, includes:

[0087] S11: In response to the selection instruction, the current line segment on the circuit layout is selected as the target line segment.

[0088] The selection command can be triggered by certain operations, such as the user clicking a preset key on the mouse or keyboard, or selecting a preset option on the user interface. At this time, the current line segment on the trace is identified as the target line segment. The current line segment can be identified by coordinate information, label information, or mouse cursor. For example, before the user clicks a preset mouse key, the line segment where the mouse cursor is currently located is the current line segment.

[0089] S12: Real-time acquisition of mouse position point, using the mouse position point as the endpoint of the target line segment's movement.

[0090] Once the target line segment is confirmed, the position of the mouse cursor in the circuit layout is obtained in real time, and this position is used as the endpoint of the target line segment's movement.

[0091] In the embodiments of this application, please refer to Figure 6 This is a schematic diagram illustrating the process of constructing a search rectangle. The steps for constructing a search rectangle along a preset direction, enclosing the two endpoints of the moving endpoint and the target line segment, include:

[0092] S21A: Set path points on the straight line where the target line segment is located, at preset distances from both ends of the target line segment.

[0093] Here, a path point is a point outside the target line segment. The two path points are on the same straight line as the target line segment, and the distance from the two path points to the nearest endpoint of the target line segment is a preset line distance.

[0094] S22A: Select the minimum x-coordinate, minimum y-coordinate, maximum x-coordinate, and maximum y-coordinate of the endpoint and the two path points.

[0095] In the coordinate system of the circuit layout, the endpoint and path point of the movement have coordinate values. The minimum value of the horizontal coordinate, the minimum value of the vertical coordinate, the maximum value of the horizontal coordinate, and the maximum value of the vertical coordinate are selected from all the coordinate values.

[0096] S23A: Construct a search rectangle along a preset direction with the minimum x-coordinate, minimum y-coordinate, maximum x-coordinate, and maximum y-coordinate as the diagonal vertices.

[0097] The preset direction is a reference direction set according to actual needs. To facilitate coordinate calculation, the preset direction can be set as the direction of the coordinate axes of the coordinate system. The minimum x-coordinate and minimum y-coordinate are used as one vertex of the diagonal, and the maximum x-coordinate and maximum y-coordinate are used as the other vertex of the diagonal. The search rectangle along the preset direction can be obtained from the diagonal vertices.

[0098] like Figure 7 The diagram shows a schematic of the search rectangle. In the diagram, path points M are set at the two ends of the target line segment H at a preset distance d. The preset direction is the X-axis of the coordinate system. One axis of the search rectangle S is parallel to the preset direction. The search rectangle S is the smallest rectangle enclosing the moving endpoint P and the two path points M.

[0099] For further details, please refer to... Figure 8 This is a schematic diagram illustrating the construction process of an object rectangle. The steps for constructing an object rectangle that surrounds the two endpoints of line segments on other traces along a preset direction include:

[0100] S21B: Detect whether the line segments on other routes are parallel or perpendicular to the preset direction.

[0101] S22B: Constructs an object rectangle with the line segment as the axis and the width as the preset value on a line segment that is parallel or perpendicular to the preset direction.

[0102] Among them, such as Figure 3 As shown, line segments L1, L4, and L7 are parallel to a preset direction, while line segments L3, L6, and L9 are perpendicular to the preset direction F. The rectangle D constructed on these line segments extends to both sides with a total preset width around the axes of these line segments. The preset value can be set according to actual needs.

[0103] S23B: Select feature points, including endpoints, at intervals on line segments that are not parallel or perpendicular to the preset direction, and construct an object rectangle along the preset direction using two adjacent feature points as diagonal vertices.

[0104] If a line segment is not parallel or perpendicular to a preset direction, an endpoint on the line segment is selected as a feature point. Feature points are then selected at intervals starting with the first feature point, continuing until the distance between the last feature point and another endpoint is less than the selection interval. The last endpoint is also selected as a feature point. Then, an object rectangle is constructed along the preset direction using two adjacent feature points as diagonal vertices. In this embodiment, feature points are selected at preset line spacing intervals.

[0105] like Figure 9 The diagram shows an object rectangle constructed on a line segment that is neither parallel nor perpendicular to a preset direction. In the diagram, line segment L2 is neither parallel nor perpendicular to the preset direction F. Feature points T are selected on line segment L2 at preset line spacing d intervals, and then an object rectangle D is constructed along the preset direction F with two adjacent feature points T as diagonal vertices.

[0106] When selecting candidate line segments, the line segments need to meet three conditions: they must be located on the normal direction pointing to the endpoint of the target line segment, parallel to the target line segment, and intersect with the search rectangle. These three conditions need to be filtered sequentially. For example, in this embodiment, please refer to... Figure 10 This is a flowchart illustrating the selection of candidate line segments. Step S3 involves selecting a line segment from the line segments intersecting the object rectangle and the search rectangle that is parallel to the target line segment and located on the normal direction pointing to the endpoint of the movement. Step S3 includes:

[0107] S31: Use the line segment where the object rectangle intersects the search rectangle as the first filtering line segment.

[0108] In the circuit layout, the line segments where the object rectangle and the search rectangle intersect are line segments that may block the movement of the target line segment. Therefore, filtering only the line segments where the object rectangle and the search rectangle intersect can filter out some line segments.

[0109] S32: Select a line segment parallel to the target line segment from the first filtered line segment as the second filtered line segment.

[0110] In the first screening process, only line segments parallel to the target line segment need to be considered. Therefore, selecting line segments parallel to the target line segment can further filter out some line segments. The parallelism between line segments and the target line segment can be detected by slope calculation. When the calculated slope is the same as the slope of the target line segment, the line segment can be confirmed to be parallel to the target line segment.

[0111] S33: Select the line segment located in the normal direction of the target line segment pointing to the endpoint of the movement from the second filtered line segment as the candidate line segment.

[0112] Since the target line segment moves towards the destination, and line segments moving away from the target line segment's direction of movement will not block the target line segment, only line segments in the second selection line segment that are in the normal direction of the target line segment pointing to the destination will constitute an obstacle to the target line segment's movement. Therefore, after selecting line segments in the normal direction of the target line segment pointing to the destination from the second temporary line segment, the number of line segments that meet the conditions is relatively small, which can significantly reduce the amount of computer computation.

[0113] Please refer to Figure 11 This is a schematic diagram illustrating the specific process of generating an extruded line segment. The steps for stretching the target line segment to be collinear with each candidate line segment to obtain the extruded line segment include:

[0114] S41A: Calculate the normal distance between the target line segment and each candidate line segment.

[0115] The normal distance between the target line segment and the candidate line segment is the line spacing between the line containing the target line segment and the line containing the candidate line segment.

[0116] S42A: Determine whether there are two adjacent line segments connected to the target line segment on the routing line.

[0117] All the lines are broken lines, and the target line segment is a segment of the broken line. If the target line segment is an edge line segment, then the target line segment is connected to only one adjacent line segment. If the target line segment is a middle line segment, then the target line segment is connected to two adjacent line segments.

[0118] S43A: If there are two adjacent line segments, keep the slope and connection relationship of the adjacent line segments on the path where the target line segment is located unchanged, and move the target line segment toward the candidate line segment according to the normal spacing to form a stretched line segment.

[0119] As the target line segment moves along the normal distance, the slope and connection relationship of the adjacent line segments before and after the target line segment remain unchanged. Therefore, the length of the adjacent line segments before and after the target line segment will decrease or the side length will increase as the target line segment moves. Furthermore, since the two endpoints of the target line segment will change position with the adjacent line segments before and after, the length of the target line segment will also decrease or increase.

[0120] like Figure 12 The diagram shows a stretched line segment when the target line segment is connected to two adjacent line segments. The left side of the diagram is a schematic diagram of the target line segment H before it moves, and the right side is a schematic diagram of the stretched line segment J formed after the target line segment H moves. As the target line segment H moves according to the normal spacing, its length gradually decreases, while the lengths of its two adjacent line segments H1 and H2 increase and their slopes remain unchanged. After the movement is completed, the stretched line segment J is obtained.

[0121] S44A: If there is only one adjacent line segment, keep the slope and connection relationship of the adjacent line segments on the path where the target line segment is located unchanged, generate a ray with the angle between the target line segment and the target line segment as the preset angle, and move the target line segment toward the candidate line segment according to the normal spacing to form an stretched line segment with the endpoint on the ray.

[0122] When the target line segment has only one adjacent line segment, as the target line segment moves according to the normal spacing, the adjacent line segments will shorten or lengthen as the target line segment moves, because the slope and connection relationship of the adjacent line segments remain unchanged. The endpoints of the target line segment without connecting line segments are called suspended endpoints. After generating a ray with a preset angle between the suspended endpoint and the target line segment, the endpoints of the target line segment will always lie on the ray. That is, the length of the target line segment may shorten or remain unchanged, depending on the direction of movement of the target line segment.

[0123] like Figure 13 The diagram shows the stretching of a target line segment when it is connected to only one adjacent line segment. The left side of the diagram shows the target line segment H before it moves, and the right side shows the stretching line segment J formed after the target line segment H moves. When the target line segment H moves according to the normal spacing, since the endpoint must be located on the ray G starting from the suspended endpoint, the angle between ray G and the target line segment H is assumed to be 45 degrees. The length of the adjacent line segment H1 gradually increases while the slope remains constant. Therefore, the length of the target line segment H gradually decreases. After the movement is completed, the stretching line segment J is obtained.

[0124] For further details, please see Figure 14 This is a schematic diagram illustrating the specific process for detecting the intersection of the target line segment and the candidate line segment. The steps for detecting whether each stretched line segment intersects with the corresponding candidate line segment include:

[0125] S41B: Detects whether the slope of each stretched line segment and the corresponding candidate line segment exists.

[0126] In a coordinate system, if a line segment is parallel to the Y-axis, then the slope does not exist.

[0127] S42B: When the slope does not exist, project the current stretched line segment and the corresponding candidate line segment along the normal direction onto the Y-axis of the reference coordinate system, and when the slope exists, project the current stretched line segment and the corresponding candidate line segment along the normal direction onto the X-axis of the reference coordinate system.

[0128] If the slope of the stretched line segment and the candidate line segment is nonexistent, it indicates that they are parallel to the Y-axis. Therefore, the stretched line segment and the candidate line segment are projected along the normal direction onto the Y-axis of the reference coordinate system. If the slope of the stretched line segment and the candidate line segment exists, it indicates that they are parallel to the X-axis or neither parallel to the Y-axis nor the X-axis. Therefore, the stretched line segment and the candidate line segment are projected along the normal direction onto the X-axis of the reference coordinate system.

[0129] like Figure 15 The diagram shows the projection of the stretched line segment J and the candidate line segment onto the Y-axis. The stretched line segment J and the candidate line segment L are parallel to the Y-axis, and both are projected onto the Y-axis along the normal direction.

[0130] like Figure 16 The diagram shows the projection of the stretched line segment J and the candidate line segment onto the X-axis. The stretched line segment J and the candidate line segment L are not parallel to either the Y-axis or the X-axis; they are projected onto the X-axis along their normal directions.

[0131] S43B: Determine whether the projections of the current stretched line segment and the corresponding candidate line segment on the X-axis or Y-axis coincide.

[0132] S44B: If they coincide, then confirm that the current stretched line segment intersects with the corresponding alternative line segment.

[0133] Specifically, if the projections of the stretched line segment and the candidate line segment coincide, it indicates that they intersect. This detection method can avoid misjudging that the stretched line segment and the candidate line segment do not intersect due to errors that may cause them to be on the same straight line.

[0134] Please refer to Figure 17 Another embodiment of the present invention provides a circuit layout trace segment movement obstacle detection device, the device comprising:

[0135] The acquisition module 11 is used to acquire the target line segment to be moved on the circuit layout and its endpoint.

[0136] The construction module 12 is used to construct a search rectangle that surrounds the two endpoints of the moving endpoint and the target line segment along a preset direction, as well as an object rectangle that surrounds the two endpoints of line segments on other paths.

[0137] The filtering module 13 is used to select line segments that are parallel to the target line segment and located on the normal direction pointing to the endpoint of the movement from the line segments where the object rectangle and the search rectangle intersect.

[0138] The detection module 14 is used to stretch the target line segment to be collinear with each candidate line segment to obtain a stretched line segment, and to detect whether each stretched line segment intersects with the corresponding candidate line segment.

[0139] The confirmation module 15 is used to identify intersecting candidate line segments as obstacle line segments.

[0140] The circuit layout trace segment movement obstacle detection device of this embodiment may also include other technical features of the circuit layout trace segment movement obstacle detection method of the foregoing embodiment, implement all the steps of the circuit layout trace segment movement obstacle detection method of the foregoing embodiment, and have the same technical effect as the circuit layout trace segment movement obstacle detection method of the foregoing embodiment, which will not be repeated here.

[0141] The present invention also provides a storage medium storing a computer program, which is configured to execute the circuit layout trace segment movement obstacle detection method of the foregoing embodiments when running.

[0142] Specifically, in this embodiment, the storage medium may include, but is not limited to, USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks, and other media capable of storing computer programs.

[0143] The present invention also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to execute the circuit layout trace segment movement obstacle detection method of the foregoing embodiments.

[0144] Specifically, the memory and processor can be connected via a data bus. Furthermore, the aforementioned electronic device may also include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0145] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," or "specific example," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments. In addition, those skilled in the art can combine and integrate the different embodiments or examples described in this specification.

[0146] The above are merely preferred embodiments of the present invention and do not constitute any limitation on the present invention. Any equivalent substitutions or modifications made by those skilled in the art to the technical solutions and content disclosed in the present invention without departing from the scope of the present invention shall be deemed to have remained within the protection scope of the present invention.

Claims

1. A method for detecting obstacles to the movement of trace segments in a circuit layout, characterized in that, include: Obtain the target line segment to be moved on the circuit layout and its endpoint. Construct a search rectangle along a preset direction that surrounds the two endpoints of the moving endpoint and the target line segment, and an object rectangle that surrounds the two endpoints of line segments on other paths; Select a line segment from the line segments where the object rectangle and the search rectangle intersect, that is located in the normal direction of the target line segment pointing to the moving endpoint and is parallel to the target line segment, as a candidate line segment; The target line segment is stretched to be collinear with each of the candidate line segments to obtain a stretched line segment, and it is detected whether each stretched line segment intersects with the corresponding candidate line segment. Candidate line segments that intersect in the test results are identified as obstacle line segments.

2. The method according to claim 1, characterized in that, The acquisition of the target line segment to be moved and its endpoint on the circuit layout trace includes: In response to a selection command, the current line segment on the circuit layout is used as the target line segment; The mouse position point is acquired in real time and used as the endpoint of the movement of the target line segment.

3. The method according to claim 1, characterized in that, The construction of a search rectangle along a preset direction, enclosing the two endpoints of the moving endpoint and the target line segment, includes: Path points are set at preset distances from both ends of the target line segment on the straight line where the target line segment is located; Select the minimum x-coordinate, minimum y-coordinate, maximum x-coordinate, and maximum y-coordinate of the endpoint and the two path points; A search rectangle is constructed along a preset direction, with the minimum value of the horizontal coordinate, the minimum value of the vertical coordinate, the maximum value of the horizontal coordinate, and the maximum value of the vertical coordinate as diagonal vertices.

4. The method according to claim 3, characterized in that, The construction of the object rectangle that surrounds the two endpoints of line segments on other routes along a preset direction includes: Check whether the line segments on other routes are parallel or perpendicular to the preset direction; Construct an object rectangle with the line segment as the axis and the width as the preset value on a line segment that is parallel or perpendicular to the preset direction; Feature points, including endpoints, are selected at intervals on line segments that are not parallel or perpendicular to the preset direction. An object rectangle is constructed along the preset direction using two adjacent feature points as diagonal vertices.

5. The method according to claim 4, characterized in that, The feature points are selected at intervals based on the preset line spacing.

6. The method according to claim 1, characterized in that, The step of selecting a line segment from the line segments intersecting the object rectangle and the search rectangle, located on the normal direction of the target line segment pointing to the moving endpoint and parallel to the target line segment, as a candidate line segment includes: Use the line segment where the object rectangle intersects the search rectangle as the first filtering line segment; Select a line segment from the first filtered line segment that is parallel to the target line segment as the second filtered line segment; Select from the second filtered line segments the line segment located in the normal direction of the target line segment pointing to the endpoint of the movement as the candidate line segment.

7. The method according to claim 1, characterized in that, The step of stretching the target line segment to be collinear with each of the candidate line segments to obtain the stretched line segment includes: Calculate the normal distance between the target line segment and each of the candidate line segments; Determine whether the target line segment is connected to two adjacent line segments. If there are two adjacent line segments, keep the slope and connection relationship of the adjacent line segments on the path where the target line segment is located unchanged, and move the target line segment toward the candidate line segment according to the normal spacing to form a stretched line segment; If there is only one adjacent line segment, keep the slope and connection relationship of the adjacent line segments on the path where the target line segment is located unchanged, generate a ray with the angle between the target line segment and the target line segment as a preset angle, and move the target line segment toward the candidate line segment according to the normal spacing to form an stretched line segment with the endpoint located on the ray.

8. The method according to claim 7, characterized in that, The step of detecting whether each of the stretched line segments intersects with the corresponding candidate line segments includes: Detect whether the slope of each of the stretched line segments and the corresponding candidate line segments exists; When the slope does not exist, the current stretched line segment and the corresponding candidate line segment are projected along the normal direction onto the Y-axis of the reference coordinate system; and when the slope exists, the current stretched line segment and the corresponding candidate line segment are projected along the normal direction onto the X-axis of the reference coordinate system. Determine whether the projections of the currently stretched line segment and the corresponding candidate line segment on the X-axis or Y-axis coincide; If they overlap, it is confirmed that the currently stretched line segment intersects with the corresponding candidate line segment.

9. A circuit layout trace segment movement obstacle detection device, characterized in that, include: The acquisition module is used to acquire the target line segment to be moved on the circuit layout and its endpoint. The construction module is used to construct a search rectangle that surrounds the two endpoints of the moving endpoint and the target line segment along a preset direction, as well as an object rectangle that surrounds the two endpoints of line segments on other paths. The filtering module is used to select, from the line segments where the object rectangle and the search rectangle intersect, a line segment located in the normal direction of the target line segment pointing to the moving endpoint and parallel to the target line segment as a candidate line segment; The detection module is used to stretch the target line segment to be collinear with each of the candidate line segments to obtain a stretched line segment, and to detect whether each stretched line segment intersects with the corresponding candidate line segment. The confirmation module is used to identify intersecting candidate line segments as obstacle line segments.

10. A storage medium, characterized in that, The storage medium stores a computer program, which is configured to execute the circuit layout trace segment movement obstacle detection method according to any one of claims 1 to 8 when it runs.

11. An electronic device, characterized in that, The device includes a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the circuit layout trace segment movement obstacle detection method according to any one of claims 1 to 8.