Method and device for determining copper laying area of same-layer same-power-supply network in printed circuit board
By obtaining the endpoint coordinate data of the dispersed copper pour areas of the same power network in the printed circuit board, determining the shortest connection path and drawing the minimum connection polygon, and integrating and optimizing the overall copper pour area, the problems of low efficiency and high error rate of manual processing are solved, and efficient and automated copper pour area planning is realized.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-04-07
AI Technical Summary
In existing printed circuit board (PCB) designs, manually planning connection paths for scattered or isolated copper areas of the same power network on the same layer is inefficient and has a high probability of error, especially when there are many PCB layers or a large number of power networks.
By obtaining the endpoint coordinates of the scattered copper pour areas of the same power network in the target layer of the printed circuit board, the shortest connection path between adjacent areas is determined, and the minimum connection polygon is drawn and integrated into the overall copper pour area. Finally, optimization is performed with the narrowest width reaching the preset optimization target as a constraint.
It enables automatic planning, connection integration, and contour optimization of dispersed copper pouring areas, saving manpower, improving processing efficiency, and reducing the probability of errors.
Smart Images

Figure CN121809383A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of printed circuit board, and particularly relates to a method and device for determining copper plating of same-layer same-power-network in a printed circuit board. BACKGROUND
[0002] Power network copper plating refers to an operation of filling a power network with a copper layer, which aims to provide stable and low-impedance power supply, reduce noise, and improve overall electrical performance. Therefore, in the process of designing a printed circuit board (PCB), isolated or scattered copper skins belonging to the same power network in the same layer need to be integrated into one whole, so as to realize complete power network copper plating. In the existing PCB design, processing of the same-layer scattered or isolated same-power-network copper plating area needs to manually find or plan a connection path under the constraints of minimum flow width and shape standard copper plating rules, and to perform layer-by-layer connection integration of the copper plating area of the related power network, and to optimize the profile of the integrated copper plating area.
[0003] However, such manual layer-by-layer connection path planning, constraint rule matching, and shape optimization of isolated copper plating areas not only depend on human labor and engineer experience, but also when the number of PCB layers is large or the number of power networks is large, the efficiency of manual processing will be significantly reduced, and the probability of errors will also increase. SUMMARY
[0004] The embodiments of the present application provide a method and device for determining copper plating area of same-layer same-power-network in a printed circuit board, which can automatically plan connection integration and profile optimization of each scattered copper plating area.
[0005] In a first aspect, the embodiments of the present application provide a method for determining copper plating area of same-layer same-power-network in a printed circuit board, comprising:
[0006] obtaining endpoint coordinate data of a plurality of scattered copper plating areas of the same power network in a target layer of a printed circuit board;
[0007] determining a shortest connection path between each two adjacent scattered copper plating areas in the plurality of scattered copper plating areas according to the endpoint coordinate data of each scattered copper plating area;
[0008] drawing a minimum connection polygon between each two adjacent scattered copper plating areas according to the shortest connection path between each two adjacent scattered copper plating areas;
[0009] integrating the plurality of scattered copper plating areas and the minimum connection polygon of each adjacent scattered copper plating area to obtain a first overall copper plating area;
[0010] With the narrowest width of the first overall copper pour area reaching a preset optimization target as a constraint, the first overall copper pour area is optimized to obtain a target overall copper pour area that achieves the preset optimization target.
[0011] Secondly, embodiments of this application provide a device for determining the copper pouring area of a same layer and power network in a printed circuit board, comprising:
[0012] The first acquisition module is used to acquire the endpoint coordinate data of multiple dispersed copper pour areas of the same power network in the target layer of the printed circuit board.
[0013] The first determining module is used to determine the shortest connection path between any two adjacent dispersed copper pour areas in the plurality of dispersed copper pour areas based on the endpoint coordinate data of each of the dispersed copper pour areas;
[0014] The drawing module is used to draw the minimum connection polygon between two adjacent dispersed copper pour areas based on the shortest connection path between each pair of adjacent dispersed copper pour areas.
[0015] An integration module is used to integrate the multiple dispersed copper pour areas and the minimum connecting polygons of each adjacent dispersed copper pour area to obtain a first overall copper pour area.
[0016] The optimization module is used to optimize the first overall copper pour area by taking the narrowest width of the first overall copper pour area as a preset optimization target as a constraint, so as to obtain a target overall copper pour area that achieves the preset optimization target.
[0017] The method and apparatus for determining copper pour areas of the same layer and power network in a printed circuit board according to embodiments of this application can determine the shortest connection path between pairs of adjacent dispersed copper pour areas based on the endpoint coordinate data of multiple dispersed copper pour areas of the same power network in the target layer of the printed circuit board, and draw the minimum connection polygons of each pair of adjacent dispersed copper pour areas. Then, the multiple dispersed copper pour areas and the minimum connection polygons of each adjacent dispersed copper pour area are integrated to obtain a first overall copper pour area. Finally, the first overall copper pour area is optimized with the minimum width of the first overall copper pour area reaching a preset optimization target as a constraint to obtain a target overall copper pour area that meets the preset optimization target. Thus, in this embodiment of the application, by using the endpoint coordinate data of multiple dispersed copper pour areas of the same power network in the target layer of the printed circuit board, the connection integration and contour optimization of each dispersed copper pour area are automatically planned. Compared with manual processing, this not only saves manpower and improves processing efficiency, but also reduces the probability of errors in copper pour areas of the same layer and power network in the printed circuit board. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a flowchart illustrating a method for determining the copper pouring area of a printed circuit board with the same power supply network on the same layer, as provided in an embodiment of this application.
[0020] Figure 2 This is a flowchart illustrating another method for determining the copper pouring area of a printed circuit board with the same power supply network on the same layer, provided in an embodiment of this application.
[0021] Figure 3 This is a schematic diagram of the process for obtaining the shortest connection path between dispersed copper-filled areas provided in an embodiment of this application;
[0022] Figure 4 This is a schematic diagram of the process for obtaining the minimum connected polygon provided in an embodiment of this application;
[0023] Figure 5 This is a schematic diagram of the process for obtaining the minimum width of an irregular polygon provided in an embodiment of this application;
[0024] Figure 6 This is a diagram of the distribution of copper-plated areas on the same layer of a power network, provided in one embodiment of this application.
[0025] Figure 7 This is a schematic diagram of the minimum circumcircle of each dispersed copper-paved area provided in one embodiment of this application;
[0026] Figure 8 This is a schematic diagram of the minimum connection polygon between adjacent dispersed copper pour areas provided in one embodiment of this application;
[0027] Figure 9 This is a schematic diagram of the initial overall copper pour area provided in one embodiment of this application;
[0028] Figure 10 This is a schematic diagram of the integrated and optimized overall copper pour area that basically conforms to the relevant constraints, provided in one embodiment of this application;
[0029] Figure 11 This is another embodiment of the present application that provides a diagram of the distribution of copper-plated areas on the same layer of a power network;
[0030] Figure 12 This is a schematic diagram of the minimum circumcircle of each dispersed copper-paved area provided in another embodiment of this application;
[0031] Figure 13This is a schematic diagram of the minimum connection polygon between adjacent dispersed copper pour areas provided in another embodiment of this application;
[0032] Figure 14 This is a schematic diagram of the initial overall copper plating area provided in another embodiment of this application;
[0033] Figure 15 This is a comparison image of the initial overall copper plating area expanded to meet constraints according to another embodiment of this application;
[0034] Figure 16 This is a schematic diagram of the integrated and optimized overall copper pour area that basically conforms to the relevant constraints, provided in another embodiment of this application;
[0035] Figure 17 This is a schematic diagram of the structure of the device for determining the copper pouring area of the same layer and power supply network in a printed circuit board provided in the embodiments of this application. Detailed Implementation
[0036] The features and exemplary embodiments of various aspects of this application will be described in detail below. To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain this application and not to limit it. For those skilled in the art, this application can be implemented without some of these specific details. The following description of the embodiments is merely to provide a better understanding of this application by illustrating examples.
[0037] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes said element.
[0038] Power network copper pouring refers to the process of filling power networks with copper layers. Its purpose is to provide stable, low-impedance power supply while reducing noise and improving overall electrical performance. Therefore, in the design of printed circuit boards (PCBs), it is necessary to integrate isolated or scattered copper areas belonging to the same power network on the same layer into a unified whole, thereby achieving complete power network copper pouring. In existing PCB designs, handling scattered or isolated copper pouring areas of the same power network on the same layer requires manually finding or planning connection paths within the constraints of copper pouring rules such as minimum current throughput width and outline standards. This involves connecting and integrating the copper pouring areas of related power networks layer by layer, and then optimizing the outline of the integrated copper pouring area.
[0039] However, manually planning the connection paths, matching constraints, and optimizing the shape of isolated copper pour areas layer by layer not only relies on manpower and engineers' experience, but also the efficiency of manual processing will be significantly reduced when there are many PCB layers or a large number of power networks, and the probability of errors will also increase.
[0040] To address the problems of the prior art, embodiments of this application provide a method and apparatus for determining the copper pour area of a network with the same power supply on the same layer in a printed circuit board. The method for determining the copper pour area of a network with the same power supply on the same layer in a printed circuit board, as provided in this application embodiment, will be described below.
[0041] Figure 1 This illustration shows a flowchart of a method for determining the copper pour area of a same-layer, same-power network in a printed circuit board according to an embodiment of this application. Figure 1 As shown, a method for determining the copper pour area of the same layer and power network in a printed circuit board may include the following steps S101 to S105:
[0042] S101. Obtain the endpoint coordinate data of multiple dispersed copper pour areas of the same power network in the target layer of the printed circuit board.
[0043] S102. Based on the endpoint coordinate data of each dispersed copper pouring area, determine the shortest connection path between any two adjacent dispersed copper pouring areas in the multiple dispersed copper pouring areas.
[0044] S103. Draw the minimum connection polygon between two adjacent scattered copper pour areas based on the shortest connection path between each pair of adjacent scattered copper pour areas.
[0045] S104. Integrate multiple scattered copper pour areas and the minimum connecting polygons of each adjacent scattered copper pour area to obtain the first overall copper pour area.
[0046] S105. Using the narrowest width of the first overall copper pour area as a constraint to achieve the preset optimization target, optimize the first overall copper pour area to obtain the target overall copper pour area that achieves the preset optimization target.
[0047] The method for determining copper pour areas of the same layer and power network in a printed circuit board according to embodiments of this application can determine the shortest connection path between pairs of adjacent dispersed copper pour areas based on the endpoint coordinate data of multiple dispersed copper pour areas of the same power network in the target layer of the printed circuit board, and draw the minimum connection polygons of each pair of adjacent dispersed copper pour areas. Then, the multiple dispersed copper pour areas and the minimum connection polygons of each adjacent dispersed copper pour area are integrated to obtain a first overall copper pour area. Finally, the first overall copper pour area is optimized with the minimum width of the first overall copper pour area reaching a preset optimization target as a constraint to obtain the target overall copper pour area that meets the preset optimization target. Thus, in this embodiment of the application, by using the endpoint coordinate data of multiple dispersed copper pour areas of the same power network in the target layer of the printed circuit board, the connection integration and contour optimization of each dispersed copper pour area are automatically planned. Compared with manual processing, this not only saves manpower and improves processing efficiency, but also reduces the probability of errors in copper pour areas of the same layer and power network in the printed circuit board.
[0048] In S101, the aforementioned printed circuit board may include at least one layer, and the multiple dispersed copper areas of the same power network in different layers are different, and each dispersed copper area is an irregular pattern. The aforementioned target layer is any one of the at least one layer of the printed circuit board.
[0049] In some embodiments of this application, the endpoint coordinate data of multiple dispersed copper pour areas in the same power network in the target layer of the printed circuit board are obtained. For example, the endpoint coordinate data of the copper pour areas in .txt format exported from any electronic design automation (EDA) software can be read and stored in a nested list shape. Each sublist in the nested list shape stores the endpoint coordinates of each dispersed copper pour area arranged in clockwise or counterclockwise order.
[0050] In S102, the shortest connection path between any two adjacent dispersed copper pour areas in the above-mentioned multiple dispersed copper pour areas can, for example, be the shortest geometric length copper connection channel between any two spatially adjacent areas in multiple (more than two) copper pour areas isolated in the same network.
[0051] In some embodiments of this application, the shortest connection path between pairs of adjacent copper pour areas is determined based on the endpoint coordinate data of each dispersed copper pour area. For example, each irregular copper pour area shape can be equated to a reference point, and then the acquisition of the shortest path between areas can be transformed into solving a minimum spanning tree between a series of discrete points. Thus, the shortest connection path between copper pour areas is obtained based on the minimum spanning tree between the reference points. Alternatively, the A* search algorithm or Dijkstra's algorithm can be used to search for the shortest path from the edge of one copper pour area to the edge of another adjacent copper pour area.
[0052] In S103, the minimum connecting polygon between the two adjacent dispersed copper pour areas can refer to the polygon copper sheet with the smallest area that can connect the two adjacent dispersed copper pour areas. It is a morphological extension of the concept of "shortest connection path", not just a "line", but a "surface".
[0053] In some embodiments of this application, the minimum connection polygon of each pair of adjacent dispersed copper pour areas is drawn based on the shortest connection path between them. For example, this can be achieved by determining the nearest edge of each pair of adjacent dispersed copper pour areas based on the coordinates of the shortest connection point in the shortest connection path. The nearest edge is the edge containing the coordinates of the shortest connection point among the multiple edges of the dispersed copper pour area. Based on the coordinates of the four endpoints of the nearest edge, the target opposite edge is determined. The target opposite edge is the two edges connecting the two pairs of adjacent dispersed copper pour areas based on the coordinates of the four endpoints of the nearest edge, and the line segments of the target opposite edge do not intersect each other and do not intersect any non-endpoint edges of the multiple dispersed copper pour areas. The nearest edge and the target opposite edge of each pair of adjacent dispersed copper pour areas are then intersected to draw the minimum connection polygon of the two pairs of adjacent dispersed copper pour areas. Alternatively, the area formed by widening the "central axis" of the shortest connection path (ensuring the width is greater than or equal to the minimum current flow width) can be derived from this method.
[0054] In S104, the aforementioned first overall copper pour area can be obtained by integrating multiple dispersed copper pour areas and the minimum connecting polygons of each adjacent dispersed copper pour area.
[0055] In some embodiments of this application, multiple dispersed copper pour areas and the minimum connected polygons of each adjacent dispersed copper pour area are integrated to obtain a first overall copper pour area. For example, this can be achieved by processing the shape list, combining the endpoint coordinates of the sequentially arranged endpoints in the shape sublists into the format of each edge endpoint, and then merging each list to generate a new nested list shape_edges_list. Each sublist in shape_edges_list stores the endpoint coordinates of an edge of a dispersed copper pour area. Simultaneously, the smallest_connect_list is processed in the same way to obtain a nested matrix connect_edges_list, where each sublist stores the endpoint of an edge of a minimum connected polygon. Then, connect_edges_list and shape_edges_list are deduplicated and merged to obtain a new nested matrix new_shape_edges_list, which stores the endpoints of the edges of the dispersed copper pour areas. First, input the endpoint coordinates of all edges after the copper pour area is integrated. Then, reorder and clean the endpoints of `new_shape_edges_list` to obtain the endpoint coordinates of the integrated copper pour area in clockwise or counterclockwise order. Specifically, store the two endpoints from the first sublist of `new_shape_edges_list` into a nested list `new_shape_list`. Using the second endpoint coordinate from the first sublist as the starting point, iterate through all sublists in `new_shape_edges_list`. When a sublist contains endpoint coordinates identical to the starting point and is different from the first sublist, store the other endpoint coordinate from that sublist into `new_shape_list`. Use this point as the new traversal point and repeat the traversal process until the obtained point matches the starting point. At this point, `new_shape_list` stores the endpoint coordinates of the entire copper pour area obtained after integrating the scattered copper pour areas in clockwise or counterclockwise order.
[0056] In S105, the aforementioned preset optimization objective may include a preset width threshold. Furthermore, in this embodiment, the preset optimization objective may also include: 1. The slope of any side of the copper-paved area polygon should be any one of 0, infinity, -1, or 1; 2. The included angle of all sides of the copper-paved area polygon should be 135°.
[0057] The aforementioned target overall copper pour area can be the overall copper pour area that meets the preset optimization target after optimizing the first overall copper pour area.
[0058] In some embodiments of this application, the first overall copper pour area is optimized to achieve a target overall copper pour area that meets the preset optimization goal, with the narrowest width of the first overall copper pour area as a constraint. For example, this may include: if the narrowest width of the first overall copper pour area is greater than a preset width threshold, directly performing edge optimization on the first overall copper pour area to obtain the target overall copper pour area. Alternatively, if the narrowest width of the first overall copper pour area is less than or equal to a preset width threshold, the first overall copper pour area may be widened to obtain a second overall copper pour area; the narrowest width of the second overall copper pour area may be calculated; if the narrowest width of the second overall copper pour area is greater than the width threshold, edge optimization on the second overall copper pour area may be performed to obtain the target overall copper pour area.
[0059] In some embodiments, the above-described S102 may specifically include:
[0060] Based on the endpoint coordinates of each dispersed copper pour area, determine the minimum circumcircle of each dispersed copper pour area;
[0061] The center of the smallest circumcircle of each dispersed copper pour area is determined as the reference point of each dispersed copper pour area.
[0062] Based on the reference points of multiple dispersed copper pour areas, a minimum spanning tree of multiple dispersed copper pour areas is generated. The minimum spanning tree includes multiple branches, and each branch corresponds to a set of reference points of two adjacent dispersed copper pour areas.
[0063] On the polygonal edges of the two adjacent scattered copper pour areas corresponding to each branch, a preset number of points are collected to construct the first point set and the second point set of the two adjacent scattered copper pour areas. The first point set is one of the two adjacent scattered copper pour areas, and the second point set is the other of the two adjacent scattered copper pour areas.
[0064] Based on the first and second point sets, determine the shortest connection path between each pair of adjacent dispersed copper-paved areas.
[0065] In some embodiments of this application, the minimum circumcircle of each dispersed copper pour area is determined based on the endpoint coordinate data of each dispersed copper pour area. For example, the minimum circumcircle of the polygon of the current dispersed copper pour area can be obtained by using the minimum circle covering algorithm. That is, three points are randomly selected from the endpoints of the polygon as the boundary area to calculate the minimum circumcircle. Then, all the endpoints of the polygon are traversed. If the traversed endpoint is within the current minimum circumcircle, the current minimum circumcircle remains unchanged. If the traversed endpoint is not within the current minimum circumcircle, the current point is recorded as k, the current boundary area is cleared, two points are randomly selected from the original endpoints to form a new boundary area, the minimum circumcircle is recalculated and traversal begins. The above steps are repeated until all endpoints are contained within the minimum circumcircle, and the loop stops, thereby obtaining the minimum circumcircle of the polygon of the current dispersed copper pour area.
[0066] The reference point for each of the aforementioned dispersed copper pour areas can be the center of the smallest circumcircle of each dispersed copper pour area. Due to the randomness of the shape of the copper pour area, the geometric center of the dispersed copper pour area is not easy to calculate, and it cannot be guaranteed that the distance to each endpoint of the polygon is the shortest distance. Using it as the graphic reference point for obtaining the shortest path between dispersed copper pour areas has poor universality and operability. However, by using the center of the smallest circumcircle of each dispersed copper pour area, it can be guaranteed that the shortest distance is as close as possible to each endpoint of the polygon. Therefore, this application uses the center of the smallest circumcircle of the polygon of the dispersed copper pour area as the graphic reference point to obtain the shortest path between each dispersed area.
[0067] The aforementioned minimum spanning tree can include multiple branches, where each branch corresponds to a set of reference points for a pair of adjacent dispersed copper pour areas.
[0068] In some embodiments of this application, a minimum spanning tree for multiple dispersed copper pour areas is generated based on the reference points of multiple dispersed copper pour areas. For example, the Prim algorithm can be used to solve for the minimum spanning tree of the reference points. That is: first, all the smallest circumcircle centers are used as reference points and stored in the reference point list circle_node_list. Then, any one of the reference points in the list is selected as the starting point to initialize an empty spanning tree. Then, the spanning tree is expanded. Each time, from all the edges connected to the current spanning tree, the edge with the smallest weight is selected and the new node is added to the spanning tree. This step is repeated, and the edge with the smallest weight is selected from the adjacent points of the newly added node. The spanning tree is gradually expanded. When the spanning tree contains all nodes, the current minimum spanning tree is obtained.
[0069] The first set of points mentioned above can be one of two adjacent dispersed copper pouring regions, and the second set of points can be the other of two adjacent dispersed copper pouring regions.
[0070] In some embodiments of this application, a preset number of points are collected on the polygonal edges of the pairwise adjacent dispersed copper pour areas corresponding to each branch to construct a first point set and a second point set of the pairwise adjacent dispersed copper pour areas. For example, it can be that all branches of the minimum spanning tree are traversed, the edges of the dispersed copper pour area polygons corresponding to the two reference points on each branch of the minimum spanning tree are sampled, 100 points are uniformly sampled from each edge, and these points, together with the polygon endpoints, are stored in two lists, node_list1 and node_list2, respectively.
[0071] In some embodiments of this application, based on a first set of points and a second set of points, the shortest connection path between two adjacent scattered copper pour areas is determined. For example, this can be achieved by traversing node_list1 and node_list2, finding the two points closest to each other in the two lists, which are the shortest connection points between the two adjacent scattered copper pour areas. The coordinates of the two shortest connection points are stored in a nested closest_node_list. The traversal continues until all branches are traversed, at which point the shortest connection path between all scattered copper pour areas can be obtained by expanding from the minimum spanning tree of the reference point. Furthermore, after completing the shortest path traversal, this application also stores the indices of the two scattered copper pour areas at both ends of each branch in the shortest path within a nested list closest_index, ensuring a one-to-one correspondence between closest_index and the order in closest_node_list.
[0072] In this embodiment, the minimum circumcircle center of each dispersed copper pour region ensures that the shortest distance is used to get as close as possible to each endpoint of the polygon. Using the minimum circumcircle center of each dispersed copper pour region as the reference point, multiple minimum spanning trees of dispersed copper pour regions are generated. Each minimum spanning tree includes multiple branches, with each branch corresponding to a set of reference points for a pair of adjacent dispersed copper pour regions. Then, a preset number of points are collected on the polygon edges of the pair of adjacent dispersed copper pour regions corresponding to each branch, constructing a first point set and a second point set for each pair of adjacent dispersed copper pour regions. The first point set represents one of the pair of adjacent dispersed copper pour regions, and the second point set represents the other. Finally, the shortest connection path between the pair of adjacent dispersed copper pour regions is accurately found from the first and second point sets. Thus, each complex polygon is simplified to the minimum circumcircle center, and a preset number of points are collected on the edges of the entire polygon to construct a point set. From a global perspective, the shortest total length among all connection schemes is found, improving the efficiency of determining the shortest connection path.
[0073] In some embodiments, the shortest connection path may include the coordinates of the shortest connection points between two adjacent dispersed copper pour areas, and S103 may specifically include:
[0074] Based on the coordinates of the shortest connection point in the shortest connection path between two adjacent scattered copper pour areas, the nearest edge between two adjacent scattered copper pour areas is determined. The nearest edge is the edge containing the coordinates of the shortest connection point among multiple edges of the scattered copper pour area.
[0075] Based on the coordinates of the four endpoints of the nearest edge of each pair of adjacent scattered copper pour areas, the target opposite edge of each pair of adjacent scattered copper pour areas is determined. The target opposite edge is the two edges that connect the two pairs of adjacent scattered copper pour areas based on the coordinates of the four endpoints of the nearest edge, and the line segments of the target opposite edge do not intersect each other and do not intersect with any non-endpoint of the multiple scattered copper pour areas.
[0076] The nearest edge and the target edge of each pair of adjacent scattered copper pour areas are intersected to draw the minimum connecting polygon of each pair of adjacent scattered copper pour areas.
[0077] The nearest edge mentioned above can be the edge containing the coordinates of the shortest connection point among multiple edges in the dispersed copper pour area.
[0078] In some embodiments of this application, the nearest edge of each pair of adjacent dispersed copper pour areas is determined based on the coordinates of the shortest connection point in the shortest connection path between the two adjacent dispersed copper pour areas. For example, this can involve determining the endpoint coordinates of the two adjacent endpoints of the two adjacent dispersed copper pour areas; if the coordinates of the shortest connection point of the dispersed copper pour area are located on the edge formed by the two adjacent endpoints, then the edge formed by the two adjacent endpoints is determined as the nearest edge of the dispersed copper pour area; if the coordinates of the shortest connection point of the dispersed copper pour area are located at an endpoint, then the two edges on either side of the endpoint are determined as the initial nearest edges of the dispersed copper pour area; among the initial nearest edges of the two adjacent dispersed copper pour areas, the two initial nearest edges with the closest slopes are determined as the nearest edges of the two adjacent dispersed copper pour areas. Alternatively, the "nearest edge" can be accurately determined by calculating the distances between the endpoints of the shortest connection path and all edges of the polygon, and finding the edge with the smallest distance.
[0079] The aforementioned target edge can be two edges that connect two adjacent scattered copper pour areas based on the coordinates of the four endpoints of the nearest edge, and the line segments of the target edge do not intersect each other and do not intersect with any non-endpoints of the multiple scattered copper pour areas.
[0080] In some embodiments of this application, the target opposite edge of each pair of adjacent dispersed copper pour areas is determined based on the coordinates of the four endpoints of the nearest edge of each pair of adjacent dispersed copper pour areas. For example, the coordinates of the four endpoints of the nearest edge of each pair of adjacent dispersed copper pour areas can be recombined in pairs, and the target opposite edge of each pair of adjacent dispersed copper pour areas can be determined according to preset filtering constraints, namely: 1. The two new line segments generated after recombination do not intersect each other; 2. The new line segments do not intersect or coincide with any non-endpoint edges of the copper pour areas in the shape. The two new line segments that meet the above filtering constraints are the target opposite edges of each pair of adjacent dispersed copper pour areas.
[0081] In this embodiment, the nearest edge of each pair of adjacent dispersed copper pour areas can be determined based on the coordinates of the shortest connection point in the shortest connection path between the two adjacent dispersed copper pour areas. Then, the target opposite edge of each pair of adjacent dispersed copper pour areas can be determined based on the coordinates of the four endpoints of the nearest edge. The target opposite edge is the two edges that connect the two adjacent dispersed copper pour areas based on the coordinates of the four endpoints of the nearest edge, and the line segments of the target opposite edge do not intersect each other and do not intersect any non-endpoints of the multiple dispersed copper pour areas. Finally, the nearest edge and the target opposite edge of each pair of adjacent dispersed copper pour areas are intersected to draw the minimum connection polygon of each pair of adjacent dispersed copper pour areas. The connection polygon generated in this way is seamless and native, and ensures that the generated minimum connection polygon will never have any spacing violations with any other net (trace, copper, pad).
[0082] In some embodiments, determining the nearest edge between two adjacent dispersed copper pour areas based on the coordinates of the shortest connection point in the shortest connection path between the two adjacent dispersed copper pour areas may specifically include:
[0083] Determine the endpoint coordinates of each pair of adjacent endpoints of the two adjacent dispersed copper pour areas;
[0084] If the shortest connection point of the dispersed copper pour area is located on the edge formed by two adjacent endpoints, the edge formed by two adjacent endpoints is determined as the nearest edge of the dispersed copper pour area.
[0085] When the shortest connection point of the dispersed copper pour region is located at the endpoint, the two edges on both sides of the endpoint are determined as the initial nearest edges of the dispersed copper pour region; among the initial nearest edges of each pair of adjacent dispersed copper pour regions, the two initial nearest edges with the closest slopes are determined as the nearest edges of each pair of adjacent dispersed copper pour regions.
[0086] The aforementioned endpoint coordinates can be the coordinates of the two adjacent endpoints of each of the two adjacent copper pour areas.
[0087] The above-mentioned determination of the endpoint coordinates of the two adjacent endpoints of the two adjacent scattered copper pour areas can be exemplified by searching for the endpoint coordinates of the two adjacent endpoints of the two adjacent scattered copper pour areas from the endpoint coordinates of each scattered copper pour area arranged in clockwise or counterclockwise order stored in each sublist of the nested list shape.
[0088] In some embodiments of this application, when the coordinates of the shortest connection point of the dispersed copper pour area are located on the edge formed by two adjacent endpoints, the edge formed by the two adjacent endpoints is determined as the nearest edge of the dispersed copper pour area. For example, it can be done by obtaining the index of two dispersed copper pour areas on the same shortest path branch through each sublist in closest_index, reading the corresponding dispersed copper pour area from shape using the index, and then traversing the coordinates of the adjacent endpoints of the corresponding copper pour area through the corresponding shortest connection point coordinates stored in each sublist in closest_node_list. If the current shortest connection point satisfies the straight line equation calculated by the two adjacent endpoints, it means that the current shortest connection point is located on the edge formed by the two adjacent endpoints, and this edge is the nearest edge.
[0089] In some embodiments of this application, when the shortest connection point coordinates of the dispersed copper pour region are located at the endpoint, the two edges on both sides of the endpoint are determined as the initial nearest edges of the dispersed copper pour region; among the initial nearest edges of pairwise adjacent dispersed copper pour regions, the two initial nearest edges with the closest slopes are determined as the nearest edges of pairwise adjacent dispersed copper pour regions. For example, this can be achieved by obtaining the indices of two dispersed copper pour regions on the same shortest path branch through each sublist in `closest_index`, reading the corresponding dispersed copper pour region from the `shape` using the indices, and then using the corresponding shortest connection point coordinates stored in each sublist in `closest_node_list`. Iterate through the coordinates of the adjacent endpoints of the corresponding copper pour area. If the current shortest connection point is located at an endpoint, then both edges on either side of that endpoint are taken as the initial nearest edges. Store the endpoint coordinates of the initial nearest edges of the two adjacent areas in a nested list closest_line_list. Each sublist in closest_line_list contains two second-level sublists, which store the endpoint coordinates of one or both initial nearest edges of a pair of adjacent copper pour areas, respectively. Then, define the similar_segments_check function, which uses this function to obtain the two initial nearest edges with the slopes that are as close as possible in the two first-level lists of the current sublist as the nearest edges in the minimum connected polygon.
[0090] In this application embodiment, different methods for determining the nearest edge are provided for different situations where the shortest connection point of the dispersed copper pour area is located on the edge formed by two adjacent endpoints or at the endpoints, thereby achieving accurate determination of the nearest edge.
[0091] In some embodiments, the above-described method of intersecting the nearest edge and the target opposite edge of each pair of adjacent dispersed copper pour areas to draw the minimum connected polygon of each pair of adjacent dispersed copper pour areas may specifically include:
[0092] The nearest edge and the target opposite edge of each pair of adjacent scattered copper pour areas are intersected to draw the initial connection polygon of each pair of adjacent scattered copper pour areas.
[0093] In the case where multiple initial connection polygons in multiple dispersed copper pour areas intersect, calculate the coordinates of the intersection points of the non-endpoint intersection lines of the corresponding target opposite edges of the multiple initial connection polygons that intersect.
[0094] Multiple initial connected polygons that intersect are deduplicated and merged according to their nearest edges. Based on the coordinates of the intersection points, the minimum connected polygons for each pair of adjacent dispersed copper pour areas are obtained.
[0095] The aforementioned multiple initial connection polygons of the multiple dispersed copper pour areas may intersect. For example, edges may be repeated in different sublists of connect_list, while non-endpoint intersections may occur in the corresponding sublist of new_connect_list.
[0096] The above process involves merging the nearest edges of multiple intersecting initial connecting polygons and obtaining the minimum connecting polygons for each pair of adjacent copper-filled areas based on the intersection coordinates. For example, the calculated intersections can be used to replace the endpoints of the original line segments. After the replacement, the sublists of connected_list containing duplicate edges are merged and the sublists of new_connect_list that have undergone intersection point replacement are merged. The processed connected_list and new_connect_list are then merged into a new nested list, smallest_connect_list. Each sublist in smallest_connect_list stores the endpoint coordinates of each minimum connecting polygon edge.
[0097] In this embodiment, the nearest edge and the target opposite edge of each pair of adjacent dispersed copper pour areas are first intersected to draw the initial connection polygons of each pair of adjacent dispersed copper pour areas. Then, when there are intersections among the multiple initial connection polygons of multiple dispersed copper pour areas, the intersection coordinates of the non-endpoint intersection lines of the target opposite edges of the multiple initial connection polygons with intersections are calculated. The nearest edges of the multiple initial connection polygons with intersections are deduplicated and merged. Finally, the minimum connection polygon of each pair of adjacent dispersed copper pour areas is obtained by combining the intersection coordinates. This deduplication and merging process accurately identifies the shared boundaries and retains only one copy. Combined with the intersection coordinates, the redrawn minimum connection polygon perfectly shares the common path, eliminates all redundant copper data, achieves true material saving, and makes the final generated target overall copper pour area more concise and the impedance performance of the connection is also optimized.
[0098] In some embodiments, the narrowest width of the first overall copper-clad area can be calculated using the following steps:
[0099] Obtain the endpoint coordinates of all non-adjacent endpoint connections within the first overall copper pour area;
[0100] Calculate the diagonal values of all non-adjacent endpoints in the first overall copper pour area;
[0101] Among the diagonal values of all non-adjacent endpoints in the first overall copper pour area, the smallest diagonal value is determined as the narrowest width of the first overall copper pour area.
[0102] The above-mentioned method of obtaining the endpoint coordinates of all non-adjacent endpoints in the first overall copper pour area can be exemplified by iterating and combining the nested list new_shape_list obtained in the above steps to obtain the endpoint coordinates of all non-adjacent endpoints in the initial overall copper pour area, and storing them sequentially in a nested list initial_diagonal_list, where each sublist of the list stores the endpoint coordinates of one non-adjacent endpoint in the initial overall copper pour area.
[0103] The above calculation of the diagonal values of all non-adjacent endpoints in the first overall copper pour area can, for example, be performed by determining whether the line segments stored in each sublist of `initial_diagonal_list` are diagonals of the initial overall copper pour area. As the diagonal of a polygon, in addition to satisfying the condition of connecting two non-adjacent endpoints of the polygon, the entire line segment should also be entirely located inside the polygon. Therefore, the line segments stored in the sublist are sampled, with 100 sample points evenly sampled from the start point to the end point of the line segment. At the same time, a zone determination function `zone_check` is defined to determine whether these sampled points are located inside the polygon. The `zone_check` function takes the nested matrix `new_shape_edges_list` and the coordinates of the sampled points as input parameters, and draws a line from the sampled point along the vector (1,0) direction, that is, horizontally to the right. For a ray, if the number of intersections between the ray and the edges of the initial overall copper pour area stored in `new_shape_edges_list` is odd, then the sampling point is located within the initial overall copper pour area; otherwise, the point is located outside the initial overall copper pour area. If the ray coincides with an edge of the initial overall copper pour area, and the number of intersections between the ray and the edge is 0 or odd, then the sampling point is located inside the initial copper pour area; otherwise, the sampling point is located outside the initial copper pour area. The `zone_check` function is used to judge each sublist in `initial_diagonal_list`. When all sampling points on the line segment in the sublist are located within the initial copper pour area, the current line segment is determined to be a valid diagonal. The length of the diagonal is calculated and stored in the list `diagonal_length_list`.
[0104] Among the diagonal values of all non-adjacent endpoints in the first overall copper pour area, the minimum diagonal value is determined as the narrowest width of the first overall copper pour area. For example, after the initial_diagonal_list traversal process is completed, the minimum value of the elements in the diagonal_length_list is the minimum value of the diagonal, which is the approximate minimum width of the initial overall copper pour area.
[0105] In this embodiment, since the first overall copper pour area is usually a polygon with an extremely irregular shape, it is difficult to obtain its narrowest width using conventional methods. Therefore, by using the coordinates of the endpoints of the lines connecting all non-adjacent endpoints in the first overall copper pour area, the diagonal values of all non-adjacent endpoints in the first overall copper pour area are calculated. Among the diagonal values of all non-adjacent endpoints in the first overall copper pour area, the smallest diagonal value is determined as the narrowest width of the first overall copper pour area. In this way, by calculating the shortest diagonal of the irregular polygon, the narrowest width is approximately solved, simplifying the calculation method of the first overall copper pour area with an extremely irregular shape and further improving the calculation efficiency of the narrowest width of the first overall copper pour area.
[0106] In some embodiments, the above-described S105 may specifically include:
[0107] If the narrowest width of the first overall copper pour area is less than or equal to a preset width threshold, the first overall copper pour area is widened to obtain the second overall copper pour area.
[0108] Calculate the narrowest width of the second overall copper-clad area;
[0109] If the narrowest width of the second overall copper pour area is greater than the width threshold, edge optimization processing is performed on the second overall copper pour area to obtain the target overall copper pour area.
[0110] For example, the aforementioned width threshold can be achieved by first reading the minimum current-carrying width constraints for each power network and storing them as the variable `width_threshold`. Since the minimum width of the copper pour area not only needs to meet the minimum current-carrying width constraint but also requires a certain margin, twice `width_threshold` can be used as the width threshold. It should be noted that the width threshold is not limited to twice `width_threshold`; it can also be other values that ensure the current-carrying width `width_threshold` is met without causing excessive margin.
[0111] In some embodiments of this application, a first overall copper pour area is widened to obtain a second overall copper pour area. For example, this can be achieved by identifying the rotation direction of each endpoint in the first overall copper pour area, including clockwise and counterclockwise directions; and moving each endpoint in the first overall copper pour area along the normal direction, according to the corresponding rotation direction indication, by a preset distance in either the positive or negative direction, to obtain the second overall copper pour area. Clockwise direction indicates a negative direction, and counterclockwise direction indicates a positive direction. Alternatively, only the narrowest part of the first overall copper pour area can be specifically stretched and expanded to obtain the second overall copper pour area, such that the narrowest width of the second overall copper pour area is greater than or equal to a width threshold.
[0112] For the calculation process of the narrowest width of the second overall copper pour area, please refer to the calculation process of the narrowest width of the first overall copper pour area, which will not be repeated here.
[0113] In some embodiments of this application, edge optimization processing is performed on the second overall copper pour area to obtain a target overall copper pour area. For example, this can be done by calculating the slope of all edges in the second overall copper pour area; if the slope of each edge in the second overall copper pour area does not meet the preset target slope, the endpoint coordinates of each edge in the second overall copper pour area are adjusted to obtain a third overall copper pour area, where the slope of all edges in the third overall copper pour area meets the target slope; the included angle between the two sides at all endpoints in the third overall copper pour area is calculated; if the included angle in the third overall copper pour area does not meet the preset target included angle, the endpoints of each included angle in the third overall copper pour area are chamfered to obtain the target overall copper pour area, where the included angle between the two sides at all endpoints in the target overall copper pour area meets the target included angle. Alternatively, one could start from a vertex of the original polygon and move along the contour; attempt to fit a subsequent segment of the original contour with a constrained line segment (horizontal, vertical, or 45°), checking if the maximum error (i.e., offset distance) between the newly generated line segment and the original contour it fits is within acceptable tolerance; if within tolerance, accept the new line segment and jump to its endpoint to continue processing; otherwise, shorten the length of the line segment being fitted and re-check the error; continue until the entire original contour is covered by a series of constrained new line segments; finally, overlay a very fine orthogonal grid onto the second overall copper pour area, capture the coordinates of all vertices of the fitted new polygon onto this fine grid, force all edges to become horizontal or vertical, and obtain the target overall copper pour area.
[0114] In this embodiment of the application, when the narrowest width of the first overall copper pour area is less than or equal to a preset width threshold, the first overall copper pour area can be widened to obtain a second overall copper pour area. The narrowest width of the second overall copper pour area is calculated again. Finally, when the narrowest width of the second overall copper pour area is greater than the width threshold, edge optimization processing is performed on the second overall copper pour area to obtain the target overall copper pour area that achieves the preset optimization target.
[0115] In some embodiments, the above-described widening process of the first overall copper pour area to obtain a second overall copper pour area may specifically include:
[0116] Identify the rotation direction of each endpoint in the first overall copper pour area, including clockwise and counterclockwise directions;
[0117] The endpoints of the first overall copper pour area are moved along the normal direction according to the rotation direction of each endpoint, and a preset moving distance is made in the positive or negative direction to obtain the second overall copper pour area. The clockwise direction is used to indicate the negative direction, and the counterclockwise direction is used to indicate the positive direction.
[0118] The aforementioned rotation direction can include clockwise and counterclockwise directions.
[0119] In some embodiments of this application, the rotation direction of each endpoint in the first overall copper pour area is identified. For example, a direction_check function can be defined to determine the rotation direction of the endpoints of the first overall copper pour area. The direction_check function determines the endpoint direction by calculating the directed area of the first copper pour area. The method for calculating the directed area is given by Formula 1:
[0120]
[0121] In Formula 1, (x i ,y i ) and (x i+1 ,y i+1 ) represents the coordinates of adjacent endpoints in the polygon, which has n endpoints. S is the directed area of the polygon. When S>0, it means that the endpoints of the polygon rotate counterclockwise, and direction_check returns True. When S<0, it means that the endpoints of the polygon rotate clockwise, and direction_check returns False.
[0122] In some embodiments of this application, each endpoint of the first overall copper pour area is moved along the normal direction by a preset distance in the positive or negative direction according to the rotation direction of each endpoint, to obtain the second overall copper pour area. For example, the direction vector and normal direction of each edge of the non-repeating endpoints in the polygon of the first overall copper pour area can be calculated, and then the endpoint of each edge can be moved a certain distance along the normal direction. The moving distance is given by Formula 2:
[0123] l mov =d step ·r tab (Formula 2)
[0124] In Formula 2, l mov d represents the distance traveled. step For the expansion step size, in this application, the expansion step size can be 5 mil, r tab r is the rotation direction marker for the endpoint of the first overall copper-paved area. tab The value of is given by formula 3:
[0125]
[0126] Formula 3 means that the positive and negative directions of expansion need to be adjusted according to the rotation direction of the endpoints of the first overall copper-clad area.
[0127] In some embodiments of this application, after the above expansion is completed, a list of endpoint coordinates of the second overall copper pour area is obtained. Since the expansion changes the position of the endpoints, the expanded graphic may have intersecting edges. This application handles the possible intersections as follows: First, it handles the intersection of adjacent edges by traversing the new endpoint list of the copper pour area and performing intersection detection on adjacent edges. If there is an intersection point between adjacent edges, the intersection point is taken as the new endpoint, and the original endpoints other than the intersection point are removed. After the traversal process is completed, there are no intersecting adjacent edges in the copper pour area. Then, this application handles the case of non-intersecting edges by using the same traversal loop. This application checks all the intersection points of the current copper pour area. The non-adjacent edges are checked for intersection. If an intersection exists, the index of the current edge endpoint in the endpoint list is recorded and stored in a nested list `cross_line_node_list`. After the loop finishes, each sublist in `cross_line_node_list` stores the index of the intersecting edges of the copper pour area in the endpoint list. Each sublist is processed, and only the maximum and minimum index values are retained. Finally, this application uses the endpoint index recorded in each sublist of `cross_line_node_list` as a slice index to delete these slices from the endpoints of the copper pour area, resulting in a list of endpoint coordinates of the copper pour area that do not have any intersecting edges.
[0128] In some embodiments, if the narrowest width of the second overall copper pour region is less than or equal to the width threshold of this application, the second overall copper pour region of this application is iteratively widened until the narrowest width of the second overall copper pour region is greater than the width threshold of this application. For example, after completing the above expansion and intersection line processing, this application calculates the minimum width of the expanded overall copper pour region based on the above minimum width calculation method. If the minimum width is greater than twice the width_threshold, the processing ends, and the endpoint coordinate list new_shape_list of the processed overall copper pour region satisfies the minimum current flow width constraint. If not, the specific steps of the above widening process are repeated until the current flow width constraint is satisfied. After this expansion algorithm processing, the second overall copper pour region satisfies the minimum current flow width constraint.
[0129] In this embodiment, by identifying the rotation direction of each endpoint in the first overall copper pour area, and moving each endpoint in the first overall copper pour area along the normal direction according to the corresponding rotation direction of each endpoint, a preset moving distance is obtained in the positive or negative direction, thus obtaining the second overall copper pour area. In this way, the first overall copper pour area can be widened without making a big change to the outline of the copper pour area. Compared with the method of only stretching and expanding the narrowest part of the copper pour area, this embodiment will not cause deformation of the copper pour area or introduce new excessively narrow areas.
[0130] In some embodiments, the above-described edge optimization processing of the second overall copper-clad area may specifically include:
[0131] Calculate the slope of all edges in the second overall copper-paved area;
[0132] If the slope of each side in the second overall copper pour area does not meet the preset target slope, adjust the endpoint coordinates of each side in the second overall copper pour area to obtain the third overall copper pour area, in which the slope of all sides in the third overall copper pour area meets the target slope.
[0133] Calculate the included angle between the two sides at all endpoints in the third overall copper pour area;
[0134] If the included angles in the third overall copper pour area do not conform to the preset target included angles, the endpoints of the included angles in the third overall copper pour area are chamfered to obtain the target overall copper pour area. The included angles on both sides of all endpoints in the target overall copper pour area conform to the target included angles.
[0135] The target slope mentioned above can include 0, infinity, -1, or 1. In some embodiments, the target slope is not limited to the above examples and can be set according to the user's actual needs, without specific limitations here. The slopes of all edges in the third overall copper pour area mentioned above conform to the target slope.
[0136] In some embodiments of this application, the endpoint coordinates of each side in the second overall copper pour area are adjusted to obtain the third overall copper pour area. For example, this can be achieved by moving two points on each side of the second overall copper pour area to become new endpoints, so that the original side becomes three sides with slopes that satisfy the target slope. If the coordinates of the two endpoints of the current side are (x1, y1) and (x2, y2) respectively, the coordinates of the two points after the movement are given by Formula 4:
[0137]
[0138] In Formula 4 (x) c1 ,y c1 ), (x c2 ,y c2 Let s be the coordinates of the new endpoints generated by the two points on the moving edge. ll is the slope of the current edge. s1 l s2 l s3 l s4 l represents the horizontal or vertical movement distance of the coordinate system. s1 l s2 l s3 l s4 The value of is given by formula 5.
[0139]
[0140] The target angle mentioned above, for example, can be 135°. Of course, the target angle is not limited to 135°; it can be set according to actual needs, and no specific limitation is made here. The included angles on both sides of all endpoints within the overall copper-poured area of the target conform to the target angle.
[0141] In some embodiments of this application, the endpoints of each included corner in the third overall copper pour area are chamfered to obtain the target overall copper pour area. For example, the endpoints of each included corner in the third overall copper pour area are chamfered to obtain the target overall copper pour area. The basic logic of the chamfering process is to move the current endpoint along the direction of the edge connected to the endpoint by the chamfering depth distance, so that the original endpoint becomes two new endpoints. After the chamfering process, the original 90° included angle becomes two 135° included angles, and the chamfering depth is 5mil.
[0142] In some embodiments of this application, the included angles at all endpoints of the target overall copper-clad area can also be checked. If the included angle of the endpoint is a multiple of 45° and cannot be divided by 90°, the endpoint is retained; otherwise, the endpoint is deleted.
[0143] In this embodiment, when the slope of each side in the second overall copper pour area does not meet the preset target slope, the endpoint coordinates of each side in the second overall copper pour area are adjusted to obtain the third overall copper pour area. In the third overall copper pour area, when the included angles in the third overall copper pour area do not meet the preset target included angles, the endpoints of each included angle in the third overall copper pour area are chamfered, so that in the target overall copper pour area, not only do the slopes of all sides meet the target slope, but the included angles of both sides at all endpoints also meet the target included angles, thus achieving the preset optimization target.
[0144] To facilitate understanding of the method for determining the copper pouring area of the same layer and power network in the printed circuit board in the embodiments of this application, the actual application process of this method for determining the copper pouring area of the same layer and power network in the printed circuit board is described as follows:
[0145] This application takes the edge coordinates of each dispersed copper pour area in the same network as input. First, it performs shortest path search and planning to obtain the shortest path between each dispersed copper pour area. Then, based on the shortest path, it finds the nearest adjacent edge of each dispersed copper pour area, draws the minimum connecting polygon, integrates all dispersed areas, and performs edge coordinate cleaning to integrate the dispersed copper pour areas and connecting polygons into a new copper pour area polygon. Finally, this application designs a corresponding polygon expansion algorithm and angle optimization algorithm to optimize the integrated copper pour area according to constraints such as minimum current width and shape specifications, and outputs the optimized copper pour area edge coordinate data. This achieves automatic and efficient integration and optimization of dispersed copper pour areas in the same network with high accuracy, further saving manpower and improving the design efficiency and accuracy of PCBs.
[0146] This application provides a method for determining the copper pour area of the same layer and power network in a printed circuit board, such as... Figure 2 As shown, the steps of this method are as follows:
[0147] Step 201: Read the data and constraint data of each dispersed copper pour area of the same power network in the same layer of the PCB.
[0148] This application reads the endpoint coordinate data of copper pour areas in .txt format exported from any EDA software, and then stores it in a nested list `shape`. Each sublist in `shape` stores the endpoint coordinates of each dispersed copper pour area arranged in clockwise or counterclockwise order. Simultaneously, this application reads the minimum current-carrying width constraint condition of the corresponding power network and stores it as the variable `width_threshold`. `shape` and `width_threshold` will be used for subsequent integration and optimization of the dispersed copper pour areas.
[0149] Step 202: Calculate the shortest connection path between the dispersed copper pour areas.
[0150] The copper-filled areas on each layer of the PCB are irregular shapes, with random numbers of edges and lengths of each edge. Given the complexity of these multiple shapes, calculating the shortest path is difficult. Therefore, as... Figure 3As shown, the basic logic of this application for obtaining the shortest connection path between dispersed copper-paved areas is as follows: Each irregular copper-paved area is treated as an equivalent reference point. Then, the acquisition of the shortest path between areas is transformed into solving a minimum spanning tree between a series of discrete points. Based on this minimum spanning tree, the shortest connection path between the copper-paved areas is obtained. Due to the randomness of the copper-paved area shape, the geometric center of the dispersed copper-paved area is difficult to calculate, and it cannot be guaranteed that the distance to each endpoint of the polygon is the shortest. Using it as a reference point for obtaining the shortest path between dispersed copper-paved areas has poor universality and operability. However, the minimum circumcircle center of the polygon obtained through optimization methods can guarantee that it is as close as possible to each endpoint of the polygon with the shortest distance. Therefore, this application uses the minimum circumcircle center of the polygon in the dispersed copper-paved area as the reference point for obtaining the shortest path between each dispersed area. This application uses the minimum circle coverage algorithm to obtain the minimum circumcircle of the polygon in the copper-paved area. Specifically, it randomly selects 3 points from the endpoints of the polygon as the boundary region to calculate the minimum circumcircle. Then, it iterates through all the endpoints of the polygon. If the endpoint is within the current minimum circumcircle, the current minimum circumcircle remains unchanged. If the endpoint is not within the current minimum circumcircle, the current point is marked as k, the current boundary region is cleared, two points are randomly selected from the original endpoints to form a new boundary region, the minimum circumcircle is recalculated, and the traversal begins again. The above steps are repeated until all endpoints are contained within the minimum circumcircle, at which point the loop stops, and the minimum circumcircle of the current polygon is obtained.
[0151] like Figure 3This application adopts the above logic: S301, calculate the minimum circumcircle for each sublist in the shape list in step 201; S302, obtain the minimum circumcircle of all scattered copper pour areas; S303, this application uses the center of all minimum circumcircles as reference points and stores them in the reference point list circle_node_list; S304, solve for the minimum spanning tree of all elements in circle_node_list. This application uses Prim's algorithm to solve for the minimum spanning tree of the reference points, that is: first, select any reference point in the list as the starting point and initialize an empty spanning tree; then, expand the spanning tree, each time from all edges connected to the current spanning tree, select the edge with the smallest weight, add the new node to the spanning tree, and repeat this step, continue to select the edge with the smallest weight from the adjacent points of the newly added node, and gradually expand the spanning tree. When the spanning tree contains all nodes, the current minimum spanning tree is obtained. After obtaining the minimum spanning tree of the reference points of the dispersed copper pour area, S305, this application traverses all branches of the minimum spanning tree. S306, the copper pour area index of the minimum spanning tree branch is stored in closest_index. S307, the edges of the dispersed copper pour area polygons corresponding to the two reference points on each branch of the minimum spanning tree are sampled, and 100 points are uniformly sampled from each edge. These points, along with the polygon endpoints, are stored in two lists, node_list1 and node_list2, respectively. S308, then node_list1 and node_list2 are traversed to find the two points that are closest in distance to each other. These two points are the shortest connection points between the two adjacent dispersed copper pour areas. The coordinates of the two shortest connection points are stored in the nested closest_node_list. S309, the traversal continues. After completing the traversal of all branches, the shortest connection path between all dispersed copper pour areas can be obtained by expanding from the minimum spanning tree of the reference points. S310. After completing the shortest path traversal, this application stores the indexes of the two scattered copper pouring areas at both ends of each branch in the shortest path in a nested list closest_index according to the traversal order, so that closest_index corresponds one-to-one with the order in closest_node_list.
[0152] Step 203: Obtain the minimum connected polygon of the dispersed copper pour area.
[0153] Based on step 202, this application obtains the shortest connection path of the dispersed copper pour area and the shortest connection point of adjacent dispersed copper pour areas on the shortest connection path. Building upon this, this application integrates the dispersed copper pour areas by drawing the minimum connection polygon between adjacent dispersed copper pour areas on the shortest connection path. To avoid introducing new endpoints that would complicate the graphics, this application draws the minimum connection polygon by connecting the nearest edges of existing dispersed copper pour polygons. For adjacent copper pour areas, identifying the edge where the shortest connection point is located yields the nearest edge between the two copper pour areas. Designing reasonable rules to sort and integrate the four endpoints of the nearest edge provides the minimum connection polygon. However, when the shortest connection point is on an endpoint of the polygon, the nearest edge between two adjacent areas cannot be directly obtained. Furthermore, at the bifurcation of the shortest connection path, three or more dispersed copper pour areas may intersect and be adjacent, further complicating the acquisition of the minimum connection polygon.
[0154] Considering the above complex situations, such as Figure 4As shown, this application designs a minimum connected polygon acquisition algorithm to integrate the shortest paths of scattered copper pour areas. S401, First, based on the closest_index and closest_node_list lists obtained in step 202 (this list is a custom list name in the algorithm, which can be understood as a list of closest sequence numbers and a list of coordinates), this application obtains the sequence numbers of two scattered copper pour areas on the same shortest path branch through each sublist in closest_index, and reads the corresponding scattered copper pour area from the shape using the sequence number. S402, Then, through the coordinates of the corresponding shortest connection point stored in each sublist in closest_node_list, the nearest edge is obtained from the corresponding copper pour area, that is: traversing the coordinates of the adjacent endpoints of the corresponding copper pour area, if the current shortest connection point satisfies the equation of the straight line calculated by the two adjacent endpoints, it means that the current shortest connection point is located on the edge formed by these two adjacent endpoints, and this edge is the nearest edge. If the current shortest connection point is exactly located at an endpoint, then the two edges on both sides of that endpoint are both taken as the nearest edges. S403. Store the coordinates of the nearest edge endpoints of two adjacent regions into a nested list `closest_line_list`. Each sublist in `closest_line_list` contains two second-level sublists, which store the coordinates of one or both nearest edge endpoints of a pair of adjacent copper pour regions, respectively. S404. Then, this application iterates through `closest_line_list`. If both adjacent copper pour regions in the current sublist of `closest_line_list` have only one nearest edge, these two nearest edges are directly used as the two edges in the minimum connecting polygon of the current adjacent copper pour regions. If there are cases where the nearest copper pour region has two nearest edges, to make the shape of the connecting polygon as regular as possible, this application defines the function `similar_segments_check` (used to obtain the two nearest edges with the closest slopes in the two first-level lists of the current sublist as the two edges in the minimum connecting polygon). This function obtains the two nearest edges with the closest slopes in the two first-level lists of the current sublist as the two edges in the minimum connecting polygon, and stores the coordinates of the two edges into a nested list `connect_list`. Each sublist in `connect_list` stores the coordinates of the two edges in sequence. S405 Next, this application iterates through the connect_list, processes the endpoint coordinates of the two edges in each sublist, and obtains the initial connection quadrilateral between adjacent copper pour areas. This application uses the two edges corresponding to each sublist in the connect_list as the two opposite edges of the initial connection quadrilateral.S406. Simultaneously, the `get_other_edges` function is defined to obtain the other two opposite edges of the initial connected quadrilateral. `get_other_edges` takes `connect_list` and `shape` as input parameters, iterates through the `connect_list` function, and recombines the coordinates of the four endpoints of each sublist in `connect_list` pairwise, setting filtering constraints: 1. The two new line segments generated after recombination do not intersect each other; 2. The new line segments do not intersect or coincide with any non-endpoint edges of the copper-paved areas in `shape`. The two new line segments that meet the above filtering constraints are the other two opposite edges of the initial connected quadrilateral. The endpoint coordinates of the two new opposite edges are stored sequentially in the nested list `new_connect_list`. Finally, this application performs intersection processing on all initial connected quadrilaterals to obtain the minimum connected polygon of adjacent copper-paved areas. S407. At the fork of the shortest connection path, there may be instances where scattered copper pour areas intersect and are adjacent to each other. That is, two or more copper pour areas may share an initial connection quadrilateral with the same copper pour area. This situation results in intersections of edges from different initial connection quadrilaterals, making it impossible to integrate the scattered copper pour areas into a single unit. Therefore, appropriate processing is required. This application iterates through both `connect_list` and `new_connect_list`. If intersections of edges from different initial connection quadrilaterals exist, edges will be duplicated in different sublists of `connect_list`. Simultaneously, edges in the corresponding sublist of `new_connect_list` may intersect at non-endpoints. Based on this, to avoid intersections, this application... The intersection points of non-endpoint intersecting lines in each sublist of st are calculated. For example, based on the coordinate information of two lines, the line segment equation is obtained, the equation is solved simultaneously, and the intersection point is obtained. Then, the calculated intersection point is used to replace the endpoints of the original line segment. After the replacement is completed, this application deduplicates and merges the sublists of connect_list that have duplicate edges, and merges the sublists of new_connect_list that have undergone intersection point replacement. The processed connect_list and new_connect_list are merged into a new nested list smaller_connect_list. Each sublist in smaller_connect_list stores the endpoint coordinates of each smallest connected polygon edge.
[0155] Step 204: Integrate the dispersed copper-plated areas.
[0156] Based on step 203, this application integrates the dispersed copper pour region endpoint coordinates by combining the endpoint coordinates of the dispersed copper pour region and the endpoint coordinates of the minimum connected polygon edges. First, this application processes the shape list, combining the sequentially arranged endpoint coordinate information in the shape sublists into the format of each edge endpoint. Then, each list is merged to generate a new nested list shape_edges_list. Each sublist in shape_edges_list stores the endpoint coordinates of an edge of a dispersed copper pour region. Simultaneously, the smallest_connect_list is processed in the same way to obtain a nested matrix connect_edges_list. Each sublist in connect_edges_list stores the endpoint of an edge of a minimum connected polygon. Next, this application deduplicatively merges connect_edges_list and shape_edges_list to obtain a new nested matrix new_shape_edges_list. new_shape_edges_list stores the endpoint coordinates of all edges after the current input copper pour region is integrated. Finally, this application... The `_shape_edges_list` is reordered and cleaned to obtain the endpoint coordinates of the integrated copper pour area in clockwise or counterclockwise order. Specifically, the two endpoints of the first sublist in `new_shape_edges_list` are stored in the nested list `new_shape_list`. The second endpoint coordinate in the first sublist of `new_shape_edges_list` is used as the traversal starting point. All sublists in `new_shape_edges_list` are traversed. When there is an endpoint coordinate in a sublist that is the same as the traversal starting point and the sublist is different from the first sublist, the other endpoint coordinate in the sublist is stored in `new_shape_list`. This point is then used as the new traversal point to continue the traversal process until the point obtained by the traversal is the same as the traversal starting point. At this time, `new_shape_list` stores the endpoint coordinates of the overall copper pour area obtained after integrating the scattered copper pour areas in clockwise or counterclockwise order.
[0157] Step 205: Obtain the narrowest width of the entire copper pour area.
[0158] Based on step 204, this application obtains the initial overall copper pour area based on the minimum connection path integration. In PCB design, the minimum width of the copper pour area needs to meet the minimum current throughput constraint and allow for a certain margin. The initial overall copper pour area is usually a highly irregular polygon, making it difficult to obtain its narrowest width using conventional geometric methods. To address this problem, such as... Figure 5As shown, this application designs an algorithm for obtaining the minimum width of an irregular polygon, which approximates the narrowest width by obtaining the shortest diagonal of the irregular polygon: S501, First, this application iterates and combines the nested list new_shape_list obtained in step 204 to obtain the endpoint coordinates of all non-adjacent endpoints of the initial overall copper pour area, and stores them sequentially in a nested list initial_diagonal_list. Each sublist of this list stores the endpoint coordinates of one non-adjacent endpoint of the initial overall copper pour area; S502, Then, this application processes the initial_diagonal_list... The application determines whether the line segments stored in each sublist of al_list are the diagonals of the initial overall copper pour area. As the diagonal of a polygon, in addition to meeting the condition of connecting two non-adjacent endpoints of the polygon, the entire line segment should also be entirely located inside the polygon. Therefore, in step S503, the application samples the line segments stored in the sublist, uniformly sampling 100 points from the start point to the end point of the line segment. In step S504, the application defines a zone_check function to determine whether these sampled points are located inside the polygon. The zone_check function uses the nested matrix new_shape_edges_ from step 204. The list and sampling point coordinates are the input parameters. Starting from the sampling point, a ray is drawn along the vector (1,0), i.e., horizontally to the right. When the ray does not coincide with the edge of the polygon, if the number of intersections between the ray and the edge of the initial overall copper pour area stored in new_shape_edges_list is odd, it proves that the sampling point is within the initial overall copper pour area; otherwise, the point is outside the initial overall copper pour area. If the ray coincides with an edge of the initial overall copper pour area, if the number of intersections between the ray and the edge is 0 or odd, the sampling point is inside the initial copper pour area; otherwise, the sampling point is outside the initial copper pour area. This application uses zone_ The `check` function checks each sublist in `initial_diagonal_list`. S505: When all sampling points on the line segment in the sublist are within the initial copper pour area, the current line segment is determined to be a valid diagonal. The length of this diagonal is calculated and stored in the list `diagonal_length_list`. S506: After the `initial_diagonal_list` is traversed, the minimum value of the elements in `diagonal_length_list` is the minimum value of the diagonal, which is approximately the minimum width of the initial overall copper pour area.
[0159] Step 206: Perform minimum current flow width constraint processing for the overall copper pour area.
[0160] The narrowest width of the integrated copper pour area needs to meet the minimum current flow width while allowing for a certain margin. This application uses twice the width_threshold obtained in step 201 (twice is an empirical value to ensure the current flow width is met during calculation without excessive margin) as a threshold and compares it with the minimum width of the initial overall copper pour area obtained in step 205. If the minimum width of the initial overall copper pour area is greater than twice the width_threshold, then the current overall copper pour area meets the minimum current flow width constraint and no processing is needed. If it is less than or equal to twice the width_threshold, then the current overall copper pour area needs to be widened to meet the constraint. If only the narrowest part of the copper pour area is stretched, it may cause deformation of the copper pour area or introduce new excessively narrow areas. Therefore, this application designs an irregular polygon expansion algorithm to achieve overall widening of the area without significantly altering its outline. The algorithm is specifically implemented as follows:
[0161] (1) This application defines the direction_check function to determine the rotation direction of the endpoints of the copper pour area. The direction_check function determines the endpoint direction by calculating the directed area of the current copper pour area. The method for calculating the directed area is given by expression 1:
[0162]
[0163] In expression 1, (x i ,y i ) and (x i+1 ,y i+1 ) represents the coordinates of adjacent endpoints in the polygon, which has n endpoints. S is the directed area of the polygon. When S>0, it means that the endpoints of the polygon rotate counterclockwise, and direction_check returns True. When S<0, it means that the endpoints of the polygon rotate clockwise, and direction_check returns False.
[0164] (2) Based on the initial copper pouring region endpoint matrix new_shape_list obtained in step 204, this application sequentially calculates the direction vector and normal direction of each edge of the non-repeating endpoints in the current copper pouring region polygon, and then moves the endpoint of each edge a certain distance along the normal direction. The distance moved is given by expression 2:
[0165] l mov =d step ·r tab (Expression 2)
[0166] In expression 2, l mov d represents the distance traveled.step For the expansion step size, the expansion step size in this application is 5mil, r tab r is the rotation direction indicator for the endpoint of the copper-paved area. tab The value of is given by expression 3:
[0167]
[0168] Expression 3 means that the positive and negative directions of the expansion need to be adjusted according to the rotation direction of the endpoints of the current overall copper-clad area.
[0169] (3) After expansion, a new list of endpoint coordinates for the copper pour area is obtained. Since the expansion changes the endpoint positions, the expanded graphic may have intersecting edges. This application handles the possible intersections as follows: First, this application handles the intersection of adjacent edges. It iterates through the new endpoint list of the copper pour area to perform intersection checks on adjacent edges. If there is an intersection point between adjacent edges, the intersection point is taken as the new endpoint, and the original endpoints other than the intersection point are removed. After the traversal process, there are no intersecting adjacent edges in the copper pour area. Then, this application handles the intersection of non-adjacent edges. It also uses a traversal loop to check all non-adjacent edges in the current copper pour area. An intersection check is performed. If an intersection exists, the index of the current edge endpoint in the endpoint list is recorded and stored in a nested list `cross_line_node_list`. After the loop completes, each sublist in `cross_line_node_list` stores the index of the intersecting edges of the copper pour area in the endpoint list. Each sublist is processed, and only the maximum and minimum index values are retained. Finally, this application uses the endpoint index recorded in each sublist of `cross_line_node_list` as a slice index to delete these slices from the copper pour area endpoints, resulting in a list of copper pour area endpoint coordinates where no edges intersect.
[0170] (4) After completing the expansion and intersection line processing, this application calculates the minimum width of the expanded overall copper pour area based on the minimum width calculation method in step 205. If the minimum width is greater than twice the width_threshold, the processing ends, and the endpoint coordinate list new_shape_list of the processed overall copper pour area satisfies the minimum current flow width constraint. If it does not satisfy the constraint, steps (2) and (3) above are repeated until the current flow width constraint is satisfied. After the expansion algorithm processing, the current overall copper pour area satisfies the minimum current flow width constraint.
[0171] Step 207. Perform edge optimization processing on the entire copper pour area. In PCB design, the copper pour area should meet the following shape constraints: 1. The slope of any side of the polygon in the copper pour area should be any one of 0, infinity, -1, or 1; 2. The included angle of all sides of the polygon in the copper pour area should be 135°. Based on this, this application designs a copper pour area edge optimization algorithm to process the outline of the entire copper pour area so that it meets the above two shape constraint rules. The processing flow of the copper pour area edge optimization algorithm designed in this application is as follows:
[0172] (1) Slope processing of copper pour area edges. When processing the slope of the copper pour area edges, to avoid changing the original outline of the copper pour area, this application calculates the slope of all edges of the current copper pour area. For edges whose slopes do not satisfy rule 1 above, this application moves two points on that edge to become new endpoints, transforming the original edge into three edges with slopes satisfying rule 1. If the coordinates of the two endpoints of the current edge are (x1, y1) and (x2, y2), the coordinates of the two points after the movement are given by expression 4:
[0173]
[0174] In expression 4 (x c1 ,y c1 ), (x c2 ,y c2 Let s be the coordinates of the new endpoints generated by the two points on the moving edge. l l is the slope of the current edge. s1 l s2 l s3 l s4 l represents the horizontal or vertical movement distance of the coordinate system. s1 l s2 l s3 l s4 The value of is given by expression 5.
[0175]
[0176] (2) Right angle chamfering. After the slope of the copper pour area is adjusted, new vertical and horizontal edges are introduced into the copper pour area, which may result in new 90° angles. This application calculates the angles between the two sides of all endpoints of the current copper pour area and chamfers the endpoints where the angles are right angles. The basic logic of chamfering is to move the current endpoints along the direction of the edge connected to the endpoints to move the chamfer depth distance, so that the original endpoints become two new endpoints. After chamfering, the original 90° angles become two 135° angles. The chamfer depth is 5mil.
[0177] (3) Removal of Abnormal Angle Endpoints. After completing the slope processing and chamfering, this application checks the included angles at all endpoints of all copper-poured areas. If the included angle of an endpoint is a multiple of 45° and not divisible by 90°, the endpoint is retained; otherwise, the endpoint is deleted. After edge optimization algorithm processing, the copper-poured areas conform to the above two shape constraint rules. The current overall copper-poured area endpoint coordinate list new_shape_list is the output after integrating and optimizing the scattered copper-poured areas.
[0178] The specific embodiment provided in this application is as follows:
[0179] According to step 201, this embodiment reads the endpoint coordinate data and minimum current width information of the distributed copper pour areas of the same layer and power supply network. For example... Figure 6 The diagram shown is a distribution map of the dispersed copper pour areas of a power network on the same layer in this embodiment. The power network has three dispersed copper pour areas on the current PCB layer. Figure 6 The minimum current-carrying width constraint for the dispersed copper pouring area of the same layer and power supply network shown is 10.56 mil.
[0180] According to step 202, this embodiment calculates the shortest connection path between the currently dispersed copper-paved areas. For example... Figure 7 As shown in step 202, this embodiment calculates the minimum circumcircle of each dispersed copper pouring area, obtains the center of the minimum circumcircle, uses the minimum circumcircle as the equivalent reference point of each dispersed copper pouring area, then calculates the minimum spanning tree of the equivalent reference point, and finally samples and obtains the shortest connection point of the adjacent copper pouring areas in each branch of the minimum spanning tree, thereby obtaining the complete shortest connection path corresponding to the current dispersed copper pouring area.
[0181] According to step 203, this embodiment obtains the minimum connected polygon of the dispersed copper pour area. For example... Figure 8 As shown in step 203, based on step 202, this embodiment obtains a list of closest edges (closest_line_list) for adjacent scattered copper pour areas on the minimum connection path. The similar_segments_check function is used to process the closest_line_list, filtering out sublists with multiple closest edges to obtain a connect_list. The get_other_edges function is then used to process each sublist in connect_list to obtain the initial connecting quadrilaterals for adjacent scattered copper pour areas. Finally, potentially intersecting initial connecting quadrilaterals are processed to obtain the complete minimum connection polygon between adjacent scattered copper pour areas. Figure 8 In the current embodiment, the initial connecting quadrilaterals between the dispersed copper-paved areas do not intersect, therefore the initial connecting quadrilaterals are the minimum connecting polygons.
[0182] According to step 204, this embodiment integrates the dispersed copper-plated areas. For example... Figure 9 As shown in step 204, based on step 203, this embodiment obtains all the edges of the smallest connected polygons and the scattered copper pour areas, removes duplicates and merges these edges, then selects the traversal starting point, and traverses all edges one by one after removing duplicates and merging them, performs endpoint cleaning and sorting, and obtains the initial overall copper pour area endpoint coordinate list new_shape_list sorted in clockwise or counterclockwise direction.
[0183] According to step 205, this embodiment obtains the narrowest width of the initial overall copper pour area. Following step 205, this embodiment obtains the initial_diagonal_list, a list of endpoints connecting all non-adjacent endpoints in the current overall copper pour area. For each connection in the initial_diagonal_list, a uniform sampling of 100 points is performed. The zone_check function is used to iterate through the sample points to determine whether the current connection is located inside the copper pour area, i.e., whether it is a valid diagonal. If it is a valid diagonal, its length is calculated and stored in the diagonal_length_list. This process is repeated until the initial_diagonal_list is traversed. The minimum value of the elements in diagonal_length_list is the minimum width of the current copper pour area. In this embodiment, the minimum width of the initial overall copper pour area is 64.78 mil.
[0184] According to step 206, this embodiment performs minimum current flow width constraint processing on the overall copper pour area. For example, based on step 205, the minimum width of the initial overall copper pour area in this embodiment is 64.78 mil, which is more than twice the minimum current flow width constraint of 10.56 mil in the current embodiment. Therefore, according to step 206, the initial copper pour area does not need to be expanded.
[0185] According to step 207, this embodiment performs edge optimization processing on the overall copper-clad area. For example... Figure 10 As shown in step 207, this embodiment is based on the copper pour area edge optimization algorithm. First, using expressions 4 and 5, new endpoints are inserted into the current overall copper pour area to adjust the edge slope. Then, chamfering is performed at the endpoints of right angles in the current overall copper pour area, with a chamfer depth of 5mil, so that a single right angle endpoint in the current overall copper pour area is converted into two 135° angle endpoints. Finally, according to the constraint rules, abnormal angle endpoints in the current copper pour area are identified and removed, thereby completing the edge contour optimization of the entire copper pour area.
[0186] Based on the aforementioned steps 201-207, this embodiment is... Figure 6The dispersed copper-plated area shown obtained as follows Figure 10 The image shows the overall copper plating area after integration and optimization, which basically meets the relevant constraints.
[0187] The specific embodiment two provided in this application is as follows:
[0188] According to step 201, this embodiment reads the endpoint coordinate data and minimum current width information of the distributed copper pour areas of the same layer and power supply network. For example... Figure 11 The diagram shown is a distribution map of the dispersed copper pour areas of a power network on the same layer in this embodiment. The power network has 8 dispersed copper pour areas on the current PCB layer. Figure 11 The minimum current-carrying width constraint for the dispersed copper pouring area of the same layer and power supply network shown is 57.21989 mil.
[0189] According to step 202, this embodiment calculates the shortest connection path between the currently dispersed copper-paved areas. For example... Figure 12 As shown in step 202, this embodiment calculates the minimum circumcircle of each dispersed copper pouring area, obtains the center of the minimum circumcircle, uses the minimum circumcircle as the equivalent reference point of each dispersed copper pouring area, then calculates the minimum spanning tree of the equivalent reference point, and finally samples and obtains the shortest connection point of the adjacent copper pouring areas in each branch of the minimum spanning tree, thereby obtaining the complete shortest connection path corresponding to the current dispersed copper pouring area.
[0190] According to step 203, this embodiment obtains the minimum connected polygon of the dispersed copper pour area. For example... Figure 13 As shown in step 203, based on step 202, this embodiment obtains the closest edge list (closest_line_list) of adjacent scattered copper pour areas on the minimum connection path. The similar_segments_check function is used to process the closest_line_list, filtering out sublists with multiple closest edges to obtain the connect_list. Then, the get_other_edges function is used to process each sublist in connect_list to obtain the initial connecting quadrilaterals of adjacent scattered copper pour areas. In this embodiment, the initial connecting quadrilaterals of scattered copper pour areas ③, ④, and ⑤ intersect. After processing their initial connecting quadrilaterals according to the method in step 203, the complete minimum connection polygon between adjacent scattered copper pour areas is obtained. For example... Figure 13 This is the minimum connected polygon in the current embodiment.
[0191] According to step 204, this embodiment integrates the dispersed copper-plated areas. For example... Figure 14As shown in step 204, based on step 203, this embodiment obtains all the edges of the smallest connected polygons and the scattered copper pour areas, removes duplicates and merges these edges, then selects the traversal starting point, and traverses all edges one by one after removing duplicates and merging them, performs endpoint cleaning and sorting, and obtains the initial overall copper pour area endpoint coordinate list new_shape_list sorted in clockwise or counterclockwise direction.
[0192] According to step 205, this embodiment obtains the narrowest width of the initial overall copper pour area. Following step 205, this embodiment obtains the initial_diagonal_list, a list of endpoints connecting all non-adjacent endpoints in the current overall copper pour area. For each connection in the initial_diagonal_list, a uniform sampling of 100 points is performed. The zone_check function is used to traverse the sample points to determine whether the current connection is located inside the copper pour area, i.e., whether it is a valid diagonal. If it is a valid diagonal, its length is calculated and stored in the diagonal_length_list. This process is repeated until the initial_diagonal_list is traversed. The minimum value of the elements in diagonal_length_list is the minimum width of the current copper pour area. In this embodiment, the minimum width of the initial overall copper pour area is 22.274 mil.
[0193] According to step 206, this embodiment performs minimum current flow width constraint processing on the overall copper pour area. For example... Figure 15 Based on step 205, the minimum width of the initial overall copper pour area in this embodiment is 22.274 mil, which is less than twice the minimum current flow width constraint of 57.21989 in the current embodiment. Therefore, graphic expansion processing is required. According to step 206, based on the irregular polygon expansion algorithm, firstly, this embodiment uses the direction_check function to determine the rotation direction of the endpoints of the current overall copper pour area. The rotation direction of the endpoints in the current embodiment is clockwise. Then, this embodiment repeatedly executes algorithm steps (2) and (3), using expressions 2 and 3 to perform edge expansion and intersection processing on the current overall copper pour area until algorithm step (4) is satisfied, that is, the minimum current flow width constraint of the current embodiment is satisfied. After the algorithm processing is completed, the minimum width of the overall copper pour area is 121.662 mil. The algorithm iterates for a total of 10 rounds. Figure 15 This is a comparison of the initial overall copper plating area in the current embodiment after it expands to meet the constraints.
[0194] According to step 207, this embodiment performs edge optimization processing on the overall copper-clad area. For example... Figure 16As shown in step 207, this embodiment is based on the copper pour area edge optimization algorithm. First, using expressions 4 and 5, new endpoints are inserted into the current overall copper pour area to adjust the edge slope. Then, chamfering is performed at the endpoints of right angles in the current overall copper pour area, with a chamfer depth of 5mil, so that a single right angle endpoint in the current overall copper pour area is converted into two 135° angle endpoints. Finally, according to the constraint rules, abnormal angle endpoints in the current copper pour area are identified and removed, thereby completing the edge contour optimization of the entire copper pour area.
[0195] Based on the aforementioned steps 201-207, this embodiment is... Figure 11 The dispersed copper-plated area shown obtained as follows Figure 16 The image shows the overall copper plating area after integration and optimization, which basically meets the relevant constraints.
[0196] This application achieves fully automated integration and optimization of dispersed copper pour areas on the same layer and with the same power supply in PCB design through a corresponding method. This saves manpower, improves design efficiency, and accelerates the PCB design process. The integration and optimization of dispersed copper pour areas is entirely algorithmic, eliminating reliance on engineer experience and improving the accuracy of copper pour area integration and optimization. This application is applicable to various types of dispersed copper pour areas and possesses good universality and robustness.
[0197] Based on the method for determining the copper pour area of the same layer and power network in a printed circuit board provided in the above embodiments, this application also provides a specific implementation of the apparatus for determining the copper pour area of the same layer and power network in a printed circuit board. Please refer to the following embodiments.
[0198] like Figure 17 As shown in the embodiment of this application, the copper pouring area determination device 1700 of the same layer and power supply network in the printed circuit board may include the following modules: a first acquisition module 1701, a first determination module 1702, a drawing module 1703, an integration module 1704, and an optimization module 1705.
[0199] The first acquisition module 1701 is used to acquire the endpoint coordinate data of multiple dispersed copper pouring areas of the same power network in the target layer of the printed circuit board.
[0200] The first determining module 1702 is used to determine the shortest connection path between two adjacent dispersed copper pouring areas in multiple dispersed copper pouring areas based on the endpoint coordinate data of each dispersed copper pouring area.
[0201] The drawing module 1703 is used to draw the minimum connection polygon of each pair of adjacent scattered copper pour areas based on the shortest connection path between each pair of adjacent scattered copper pour areas.
[0202] Integration module 1704 is used to integrate multiple scattered copper pour areas and the minimum connecting polygons of each adjacent scattered copper pour area to obtain the first overall copper pour area.
[0203] The optimization module 1705 is used to optimize the first overall copper pour area with the constraint that the narrowest width of the first overall copper pour area reaches the preset optimization target, so as to obtain the target overall copper pour area that achieves the preset optimization target.
[0204] In some embodiments, the first determining module 1702 described above may specifically include:
[0205] The first determining unit is used to determine the minimum circumcircle of each dispersed copper pouring area based on the endpoint coordinate data of each dispersed copper pouring area.
[0206] The second determining unit is used to determine the center of the smallest circumcircle of each dispersed copper pouring area as the reference point of each dispersed copper pouring area.
[0207] The generation unit is used to generate a minimum spanning tree for multiple dispersed copper pour areas based on the reference points of multiple dispersed copper pour areas. The minimum spanning tree includes multiple branches, and each branch corresponds to a set of reference points of two adjacent dispersed copper pour areas.
[0208] The construction unit is used to collect a preset number of points on the polygonal edges of the two adjacent scattered copper pour areas corresponding to each branch, and construct the first point set and the second point set of the two adjacent scattered copper pour areas. The first point set is one of the two adjacent scattered copper pour areas, and the second point set is the other of the two adjacent scattered copper pour areas.
[0209] The third determining unit is used to determine the shortest connection path between two adjacent dispersed copper-paved areas based on the first point set and the second point set.
[0210] In some embodiments, the shortest connection path may include the coordinates of the shortest connection points between two adjacent dispersed copper pour areas, and the drawing module 1703 may specifically include:
[0211] The fourth determining unit is used to determine the nearest edge between two adjacent dispersed copper pouring areas based on the coordinates of the shortest connection point in the shortest connection path between the two adjacent dispersed copper pouring areas. The nearest edge is the edge where the coordinates of the shortest connection point are located among the multiple edges of the dispersed copper pouring area.
[0212] The fifth determining unit is used to determine the target opposite edge of each pair of adjacent dispersed copper pouring areas based on the coordinates of the four endpoints of the nearest edge of each pair of adjacent dispersed copper pouring areas. The target opposite edge is the two edges that connect the two pairs of adjacent dispersed copper pouring areas based on the coordinates of the four endpoints of the nearest edge, and the line segments of the target opposite edge do not intersect each other and do not intersect with any non-endpoint of the multiple dispersed copper pouring areas.
[0213] The drawing unit is used to perform intersection processing on the nearest edge and the target opposite edge of each pair of adjacent scattered copper pour areas to draw the minimum connected polygon of each pair of adjacent scattered copper pour areas.
[0214] In some embodiments, the fourth determining unit described above may specifically include:
[0215] The first determining sub-unit is used to determine the endpoint coordinates of the two adjacent endpoints of the two adjacent dispersed copper pour areas;
[0216] The second determining sub-unit is used to determine the edge formed by two adjacent endpoints as the nearest edge of the dispersed copper pouring area when the coordinates of the shortest connection point of the dispersed copper pouring area are located on the edge formed by two adjacent endpoints.
[0217] The third determining sub-unit is used to determine the two edges on both sides of the endpoint as the initial nearest edges of the dispersed copper pouring region when the coordinates of the shortest connection point of the dispersed copper pouring region are located at the endpoint; and to determine the two initial nearest edges with the closest slopes among the initial nearest edges of the two adjacent dispersed copper pouring regions as the nearest edges of the two adjacent dispersed copper pouring regions.
[0218] In some embodiments, the above-mentioned drawing unit may specifically include:
[0219] Draw sub-units to intersect the nearest edge and the target opposite edge of each pair of adjacent scattered copper pour areas, and draw the initial connection polygons of each pair of adjacent scattered copper pour areas.
[0220] The first calculation subunit is used to calculate the coordinates of the intersection points of the non-endpoint intersection lines of the target opposite sides of the multiple initial connection polygons that intersect in the case where there are intersections among the multiple initial connection polygons of multiple dispersed copper pour areas.
[0221] The deduplication and merging sub-unit is used to deduplicate and merge multiple initial connected polygons that intersect, based on their nearest edges, and to obtain the minimum connected polygons for each pair of adjacent dispersed copper pour areas according to the coordinates of the intersection points.
[0222] In some embodiments, the device 1700 may further include:
[0223] The second acquisition module is used to acquire the coordinates of the endpoints of all non-adjacent endpoints in the first overall copper pour area;
[0224] The calculation module is used to calculate the diagonal values of all non-adjacent endpoints in the first overall copper pour area;
[0225] The second determining module is used to determine the minimum diagonal value among all the diagonal values of non-adjacent endpoints in the first overall copper pour area as the narrowest width of the first overall copper pour area.
[0226] In some embodiments, the optimization module 1705 may specifically include:
[0227] The widening processing unit is used to widen the first overall copper pour area when the narrowest width of the first overall copper pour area is less than or equal to a preset width threshold, so as to obtain a second overall copper pour area.
[0228] A calculation unit is used to calculate the narrowest width of the second overall copper-paved area;
[0229] The edge optimization unit is used to perform edge optimization processing on the second overall copper pour area when the narrowest width of the second overall copper pour area is greater than the width threshold, so as to obtain the target overall copper pour area.
[0230] In some embodiments, the above-mentioned widening processing unit may specifically include:
[0231] The identification subunit is used to identify the rotation direction of each endpoint in the first overall copper pour area, including clockwise and counterclockwise directions;
[0232] The moving subunit is used to move each endpoint of the first overall copper pour area along the normal direction, according to the rotation direction of each endpoint, by a preset moving distance in the positive or negative direction to obtain the second overall copper pour area. The clockwise direction is used to indicate the negative direction, and the counterclockwise direction is used to indicate the positive direction.
[0233] In some embodiments, the aforementioned edge optimization unit may specifically include:
[0234] The second calculation subunit is used to calculate the slope of all edges in the second overall copper pour area;
[0235] The adjustment sub-unit is used to adjust the endpoint coordinates of each side in the second overall copper pour area when the slope of each side in the second overall copper pour area does not meet the preset target slope, so as to obtain the third overall copper pour area, in which the slope of all sides in the third overall copper pour area meets the target slope.
[0236] The third calculation subunit is used to calculate the included angle between the two sides at all endpoints in the third overall copper pour area;
[0237] The chamfering subunit is used to chamfer the endpoints of each angle in the third overall copper pour area when the included angles in the third overall copper pour area do not conform to the preset target included angle, so as to obtain the target overall copper pour area. The included angles on both sides of all endpoints in the target overall copper pour area conform to the target included angle.
[0238] It should be clarified that this application is not limited to the specific configurations and processes described above and shown in the figures. For the sake of brevity, detailed descriptions of known methods are omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of this application is not limited to the specific steps described and shown. Those skilled in the art can make various changes, modifications, and additions, or change the order of steps, after understanding the spirit of this application.
[0239] The above description is merely a specific implementation of this application. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, modules, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here. It should be understood that the protection scope of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and these modifications or substitutions should all be covered within the protection scope of this application.
Claims
1. A method for determining the copper pouring area of a same layer and power supply network in a printed circuit board, characterized in that, include: Obtain the endpoint coordinate data of multiple dispersed copper-poured regions of the same power network in the target layer of the printed circuit board; Based on the endpoint coordinate data of each of the dispersed copper pour areas, determine the shortest connection path between any two adjacent dispersed copper pour areas in the plurality of dispersed copper pour areas; Based on the shortest connection path between each pair of adjacent dispersed copper pour areas, draw the minimum connection polygon between each pair of adjacent dispersed copper pour areas. The multiple dispersed copper pour areas and the minimum connecting polygons of each adjacent dispersed copper pour area are integrated to obtain the first overall copper pour area. With the narrowest width of the first overall copper pour area reaching a preset optimization target as a constraint, the first overall copper pour area is optimized to obtain a target overall copper pour area that achieves the preset optimization target.
2. The method according to claim 1, characterized in that, The step of determining the shortest connection path between any two adjacent dispersed copper pour areas based on the endpoint coordinate data of each of the dispersed copper pour areas includes: Based on the endpoint coordinate data of each of the dispersed copper pour areas, determine the minimum circumcircle of each of the dispersed copper pour areas; The center of the smallest circumcircle of each of the dispersed copper pouring regions is determined as the reference point of each of the dispersed copper pouring regions; Based on the reference points of the multiple dispersed copper pour areas, a minimum spanning tree of the multiple dispersed copper pour areas is generated. The minimum spanning tree includes multiple branches, and each branch corresponds to a set of reference points of two adjacent dispersed copper pour areas. On the polygonal edges of the two adjacent dispersed copper pour areas corresponding to each branch, a preset number of points are collected to construct a first point set and a second point set for the two adjacent dispersed copper pour areas. The first point set is one of the two adjacent dispersed copper pour areas, and the second point set is the other of the two adjacent dispersed copper pour areas. Based on the first point set and the second point set, the shortest connection path between each pair of adjacent dispersed copper pouring areas is determined.
3. The method according to claim 2, characterized in that, The shortest connection path includes the coordinates of the shortest connection points between any two adjacent dispersed copper pour areas. The step of drawing the minimum connection polygon between any two adjacent dispersed copper pour areas based on the shortest connection paths between these areas includes: Based on the coordinates of the shortest connection point in the shortest connection path between two adjacent dispersed copper pour areas, the nearest edge between two adjacent dispersed copper pour areas is determined. The nearest edge is the edge where the coordinates of the shortest connection point are located among the multiple edges of the dispersed copper pour area. Based on the coordinates of the four endpoints of the nearest edge of each pair of adjacent dispersed copper pour areas, the target opposite edge of each pair of adjacent dispersed copper pour areas is determined. The target opposite edge is the two edges that connect each pair of adjacent dispersed copper pour areas based on the coordinates of the four endpoints of the nearest edge, and the line segments of the target opposite edge do not intersect each other and do not intersect the multiple dispersed copper pour areas at non-endpoints. The nearest edge and the target edge of each pair of adjacent dispersed copper pour areas are intersected to draw the minimum connecting polygon of each pair of adjacent dispersed copper pour areas.
4. The method according to claim 3, characterized in that, The step of determining the nearest edge between two adjacent dispersed copper pour areas based on the coordinates of the shortest connection point in the shortest connection path between each pair of adjacent dispersed copper pour areas includes: Determine the endpoint coordinates of each pair of adjacent endpoints of the dispersed copper pouring regions; If the coordinates of the shortest connection point in the dispersed copper pour area are located on the edge formed by the two adjacent endpoints, the edge formed by the two adjacent endpoints is determined as the nearest edge of the dispersed copper pour area. When the shortest connection point of the dispersed copper pour area is located at the endpoint, the two sides on both sides of the endpoint are determined as the initial nearest edges of the dispersed copper pour area; among the initial nearest edges of each pair of adjacent dispersed copper pour areas, the two initial nearest edges with the closest slopes are determined as the nearest edges of each pair of adjacent dispersed copper pour areas.
5. The method according to claim 3, characterized in that, The step of intersecting the nearest edge and the target opposite edge of each pair of adjacent dispersed copper pour areas to draw the minimum connected polygon of each pair of adjacent dispersed copper pour areas includes: The nearest edge and the target opposite edge of each pair of adjacent dispersed copper pour areas are intersected to draw the initial connection polygon of each pair of adjacent dispersed copper pour areas. In the case where there is an intersection among the multiple initial connection polygons of the multiple dispersed copper pour areas, calculate the coordinates of the intersection points of the non-endpoint intersection lines of the target opposite sides of the multiple initial connection polygons that have an intersection; Multiple initial connected polygons that intersect are deduplicated and merged according to their nearest edges. Based on the coordinates of the intersection points, the minimum connected polygons of the two adjacent dispersed copper pour areas are obtained.
6. The method according to claim 1, characterized in that, The narrowest width of the first overall copper-clad area is calculated using the following steps: Obtain the endpoint coordinates of all non-adjacent endpoint connections within the first overall copper pour area; Calculate the diagonal values of all non-adjacent endpoints in the first overall copper pour area; Among the diagonal values of all non-adjacent endpoints in the first overall copper pour area, the smallest diagonal value is determined as the narrowest width of the first overall copper pour area.
7. The method according to claim 1, characterized in that, The optimization process for the first overall copper-clad area includes: If the narrowest width of the first overall copper pour area is less than or equal to a preset width threshold, the first overall copper pour area is widened to obtain a second overall copper pour area. Calculate the narrowest width of the second overall copper-clad area; If the narrowest width of the second overall copper pour area is greater than the width threshold, edge optimization processing is performed on the second overall copper pour area to obtain the target overall copper pour area.
8. The method according to claim 7, characterized in that, The process of widening the first overall copper-clad area to obtain the second overall copper-clad area includes: Identify the rotation direction of each endpoint in the first overall copper pour area, the rotation direction including clockwise and counterclockwise directions; The endpoints of the first overall copper pour area are moved along the normal direction according to the rotation direction of each endpoint, and a preset moving distance is made in the positive or negative direction to obtain the second overall copper pour area. The clockwise direction is used to indicate the negative direction, and the counterclockwise direction is used to indicate the positive direction.
9. The method according to claim 7, characterized in that, The edge optimization processing of the second overall copper-clad area includes: Calculate the slope of all edges in the second overall copper pour region; If the slope of each edge in the second overall copper pour area does not meet the preset target slope, the endpoint coordinates of each edge in the second overall copper pour area are adjusted to obtain a third overall copper pour area, wherein the slope of all edges in the third overall copper pour area meets the target slope. Calculate the included angle between the two sides at all endpoints in the third overall copper-poured area; If the included angles in the third overall copper pour area do not conform to the preset target included angles, the endpoints of the included angles in the third overall copper pour area are chamfered to obtain the target overall copper pour area, wherein the included angles on both sides of all endpoints in the target overall copper pour area conform to the target included angles.
10. A device for determining the copper pouring area of a printed circuit board with the same power supply network on the same layer, characterized in that, include: The first acquisition module is used to acquire the endpoint coordinate data of multiple dispersed copper pour areas of the same power network in the target layer of the printed circuit board. The first determining module is used to determine the shortest connection path between any two adjacent dispersed copper pour areas in the plurality of dispersed copper pour areas based on the endpoint coordinate data of each of the dispersed copper pour areas; The drawing module is used to draw the minimum connection polygon between two adjacent dispersed copper pour areas based on the shortest connection path between each pair of adjacent dispersed copper pour areas. An integration module is used to integrate the multiple dispersed copper pour areas and the minimum connecting polygons of each adjacent dispersed copper pour area to obtain a first overall copper pour area. The optimization module is used to optimize the first overall copper pour area by taking the narrowest width of the first overall copper pour area as a preset optimization target as a constraint, so as to obtain a target overall copper pour area that achieves the preset optimization target.