Inter-hole copper supplement algorithm based on dynamic programming convex decomposition algorithm
Through the dynamic programming convex decomposition algorithm, the accuracy and efficiency of hole gap editing in complex graphics are solved, and the accuracy and efficiency of copper filling between complex polygons are achieved.
Patent Information
- Application Number
- CN202510333012.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-20
- Publication Date
- 2025-06-10
AI Technical Summary
The prior art is difficult to accurately and efficiently edit copper surfaces of hole gaps in complex graphics, resulting in reduced accuracy and excessive time costs.
The copper filling algorithm between holes based on the dynamic programming convex decomposition algorithm is adopted. By calculating the distance between polygonal holes, concaveness detection and graphical decomposition, the central position and boundary position of the copper filling are determined, and appropriate expansion and shrinkage are carried out to merge the copper bridge to meet user requirements.
The accuracy of spacing copper filling between complex polygons is achieved, greatly improving the copper filling efficiency of complex shapes, and solving the problems of accuracy and time cost.
Smart Images

Figure CN120129155A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of PCB manufacturing industry, and particularly to an algorithm for copper filling between holes based on dynamic programming convex decomposition algorithm. Background Art
[0002] With the rapid development of the semiconductor industry, in the production of PCB boards, etc., in order to accurately edit the copper surface, the requirements for the hole gap are getting higher and higher. The previous copper surface editing methods are not accurate and intelligent enough, and various drawbacks are shown under the editing performance of complex graphics. The method of filling copper in the gap of complex graphics based on the convex decomposition method is more accurate and fast, and can meet the requirements under various complex graphics. The current copper surface editing methods generally adopt the following two alignments: (1) Adopt the method of manual editing. Generally, by simply judging the distance between two holes, the position of the copper bridge is drawn on the circuit board. Since the positions of the holes are not always in the horizontal and vertical directions, a large amount of time will inevitably be spent. Moreover, when the number of holes is too large and the hole shapes are too complex, the accuracy will be reduced and the time cost will be too high.
[0003] (2) Adopt the method of polygon expansion and contraction. Determine whether to intersect by judging the polygon expansion speed, so as to determine the position of copper filling. This method is feasible under the expansion and contraction of simple graphics, but the expansion and contraction of complex graphics is still a difficult problem so far. Therefore, this method is only suitable for simple polygons and cannot guarantee the accuracy and the requirements of users in complex situations. Summary of the Invention
[0004] The main technical problem to be solved by the present invention is to provide an algorithm for copper filling between holes based on dynamic programming convex decomposition algorithm, which can ensure accurate copper filling between the distances of complex polygons and greatly improve the copper filling efficiency of complex shapes.
[0005] To solve the above technical problem, a technical solution adopted by the present invention is: an algorithm for copper filling between holes based on dynamic programming convex decomposition algorithm, including the following steps: S1: Calculate the distance between every two polygon holes on the copper surface, and judge whether the copper bridge width meets the user requirements. If not, copper bridge filling is required; S2: Detect the convexity and concavity of the two holes that need copper bridge filling. If there is a concave polygon, use the dynamic programming convex decomposition algorithm to decompose the concave polygon into n convex polygons; S3: Judge the distance between the two convex polygons, and calculate the center point to confirm the center position of copper filling; S4: According to the center position of copper filling, determine the copper filling boundary positions of the two convex polygons, and perform appropriate expansion and contraction to ensure that the required copper bridge width is met; S5: Merge all the copper bridges generated by the two convex polygons.
[0006] In a preferred embodiment of the present invention, step S2 includes the step of performing concave decomposition on complex polygons: Determine whether the polygon is concave by calculating the vector cross product of each point and its two adjacent points. If the polygon has n points, there will be n results, which are recorded in list N. If all the results are positive, it is a clockwise convex polygon. If all the results are negative, it is a counterclockwise convex polygon. If there are positive and negative results, then the polygon is a concave polygon.
[0007] In a preferred embodiment of the present invention, the specific formula for the vector cross product is , where is the vector from the target point to the previous point at its location, is the vector from the target point to the next point at its location.
[0008] In a preferred embodiment of the present invention, step S2 further includes the step of detecting concave vertices: If the polygon is concave, there is at least one concave vertex. Find and record these concave vertices. If less than 1 / 3 of the results in list N are negative, determine that the points corresponding to these negative values are concave vertices. On the contrary, if less than 1 / 3 of the results in list N are positive, determine that the points corresponding to these positive values are concave vertices.
[0009] In a preferred embodiment of the present invention, step S2 further includes the steps of processing and splitting concave vertices: Use the dynamic programming algorithm to find a concave vertex, draw a splitting line with other concave vertices, and split the polygon into two sub-polygons. Then, recursively apply the same processing process to the two generated sub-polygons until all sub-polygons are convex.
[0010] In a preferred embodiment of the present invention, check all the convex polygons after splitting, and merge some small convex polygons into one polygon to reduce the number of splits and ensure that the merged polygon remains convex.
[0011] In a preferred embodiment of the present invention, in step S3, when it is determined that the minimum distance between two convex polygons is greater than the user-specified parameter, no copper bridge needs to be added, and continue to the next judgment.
[0012] In a preferred embodiment of the present invention, in S3, when it is determined that the maximum distance between two convex polygons is less than the user-specified parameter, the holes of the two polygons are decomposed. One polygon is decomposed into n convex polygons, and the second polygon is decomposed into m convex polygons. Then, copper bridges are added to the n*m convex polygons in sequence, and finally all the copper bridges are merged as the copper bridge between the two complex holes.
[0013] In a preferred embodiment of the present invention, the maximum number of times of adding copper bridges to the n convex polygons and m convex polygons is n*m times.
[0014] In a preferred embodiment of the present invention, in S3, when it is determined that the minimum distance between two convex polygons is greater than the user-specified parameter, the detailed positions and boundary intersection points of the polygons are accurately calculated and added to the copper bridge.
[0015] The beneficial effect of the present invention is that an inter-hole copper filling algorithm based on a dynamic programming convex decomposition algorithm proposed by the present invention can ensure accurate copper filling of the spacing between complex polygons, greatly improving the copper filling efficiency of complex shapes. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings, where: Figure 1 is a flowchart of an inter-hole copper filling algorithm based on a dynamic programming convex decomposition algorithm. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0017] The following will clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.
[0018] Please refer to Figure 1 , the embodiments of the present invention provide an inter-hole copper filling algorithm based on a dynamic programming convex decomposition algorithm to solve the problem of hole gap editing in actual production, including the following steps: S1: Calculate the distance between every two polygon holes on the copper surface, and determine whether the width of the copper bridge meets the user's requirements. If not, copper bridge filling is required; S2: Detect the convexity and concavity of the two holes that need copper bridges to be filled. If there are concave polygons, use the dynamic programming convex decomposition algorithm to decompose the concave polygons into n convex polygons. Specifically, it includes the following steps: (1) Concave decomposition of complex polygons: Determine whether the polygon is concave by calculating the cross product of the vectors of each point and its two adjacent points. Suppose the polygon has n points, then there will be n results, which are recorded in the list N. If all the results are positive, it is a clockwise convex polygon. If all the results are negative, it is a counterclockwise convex polygon. If the results are positive and negative, then the polygon is a concave polygon. Among them, the specific formula for the vector cross product is where is the vector from the target point to the previous point at its location, is the vector from the target point to the next point at its location.
[0019] (2) Concave vertex detection: If the polygon is concave, there is at least one concave vertex. Find and record these concave vertices. If less than 1 / 3 of the results in the list N are negative, determine that the points corresponding to these negative values are concave vertices. On the contrary, if less than 1 / 3 of the results in the list N are positive, determine that the points corresponding to these positive values are concave vertices.
[0020] (3) Concave vertex processing and segmentation: The dynamic programming algorithm will find a concave vertex and try to draw a dividing line with other vertices to divide the polygon into two sub-polygons.
[0021] The strategy for selecting the segmentation is to find an optimal dividing line, which can ensure that the two polygons after segmentation are as convex as possible. When looking for the dividing line, the algorithm will try to draw a straight line from the concave vertex to a non-adjacent vertex of the polygon, ensuring that this line does not intersect with other sides of the polygon, so that the polygon can be effectively divided into two smaller sub-polygons.
[0022] (4) Recursive segmentation: Once the dividing line is determined, the algorithm will recursively apply the same processing process to the two generated sub-polygons until all sub-polygons are convex.
[0023] (5) Merging and optimization: Finally, the algorithm will check whether some small convex polygons can be merged into one polygon to reduce the number of segments. The condition for merging is to ensure that the polygon after merging remains convex.
[0024] S3: Determine the distance between the two convex polygons, calculate the center point to confirm the center position of copper filling, determine the copper filling boundary positions of the two convex polygons according to the center position of copper filling, and perform appropriate expansion and contraction to ensure that the required copper bridge width is satisfied. It is divided into three cases to accurately calculate the copper bridge position.
[0025] When it is determined that the minimum distance between the two convex polygons is greater than the parameter given by the user, no copper bridge is required, and continue to the next judgment.
[0026] When it is determined that the maximum distance between the two convex polygons is less than the parameter given by the user, decompose the holes of the two polygons. One polygon is decomposed into n convex polygons, and the second polygon is decomposed into m convex polygons. Perform copper bridging on the n*m convex polygons in sequence. Finally, merge all the copper bridges as the copper bridge between the two complex holes. The maximum number of times of copper bridging for the n convex polygons and m convex polygons is n*m times.
[0027] When it is determined that the minimum distance between the two convex polygons is greater than the parameter given by the user, accurately calculate the detailed positions and boundary intersection points of the polygons and add them to the copper bridge.
[0028] S4: Perform a merging operation on all the copper bridges generated by the two convex polygons.
[0029] In summary, an inter-hole copper filling algorithm based on a dynamic programming convex decomposition algorithm proposed by the present invention can ensure accurate copper filling for the spacing between complex polygons, and greatly improve the copper filling efficiency for complex shapes.
[0030] The above are only the embodiments of the present invention, and do not limit the patent scope of the present invention accordingly. Any equivalent structure or equivalent process transformation made by using the content of the specification of the present invention, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of the present invention.
Claims
1. A hole copper filling algorithm based on dynamic programming convex decomposition algorithm, characterized in that: The following steps are involved: S1: Calculate the distance between every two polygonal holes on the copper surface to determine whether it meets the copper bridge width required by the user. If not, a copper bridge needs to be added; S2: Perform convexity detection on the two holes that need to be filled with copper bridges. If there is a concave polygon, use the dynamic programming convex decomposition algorithm to decompose the concave polygon into n convex polygons; S3: Determine the distance between the two convex polygons, and then calculate the center point to confirm the center position of the copper filling; S4: According to the center position of the copper filling, determine the copper filling boundary positions of the two convex polygons, and perform appropriate expansion and contraction to ensure that the required copper filling bridge width is met; S5: Merge all copper bridges generated by two convex polygons.
2. The hole copper filling algorithm based on dynamic programming convex decomposition algorithm according to claim 1 is characterized in that: S2 includes the steps of concave decomposition of complex polygons: To determine whether the polygon is concave, calculate the vector cross product of each point and its two adjacent points. If the polygon has n points, there are n results, which are recorded in list N; If all the results are positive, it is a clockwise convex polygon; If all the results are negative, it is a counterclockwise convex polygon; If the result is positive or negative, then the polygon is concave.
3. The hole copper filling algorithm based on dynamic programming convex decomposition algorithm according to claim 2 is characterized in that: The specific formula of the vector cross product is: ,in, is the vector from the target point to the previous point of the current position. It is the vector from the target point to the point after its current position.
4. The hole copper filling algorithm based on dynamic programming convex decomposition algorithm according to claim 3 is characterized in that: S2 also includes a concave vertex detection step: if the polygon is concave, there is at least one concave vertex. These concave vertices are found and recorded. If less than 1 / 3 of the results in the list N are negative, the points corresponding to these negative values are determined to be concave vertices. Conversely, if less than 1 / 3 of the results in the list N are positive, the points corresponding to these positive values are determined to be concave vertices.
5. The hole copper filling algorithm based on dynamic programming convex decomposition algorithm according to claim 1 is characterized in that: S2 also includes the steps of processing and splitting concave vertices: a concave vertex is found using a dynamic programming algorithm, and a dividing line is made with other concave vertices to split the polygon into two sub-polygons. The algorithm recursively applies the same processing to the two generated sub-polygons until all sub-polygons are convex.
6. The hole copper filling algorithm based on dynamic programming convex decomposition algorithm according to claim 5 is characterized in that: Check all the convex polygons after segmentation, merge some small convex polygons into one polygon to reduce the number of segmentations and ensure that the merged polygon still maintains convexity.
7. The hole copper filling algorithm based on dynamic programming convex decomposition algorithm according to claim 1 is characterized in that: In S3, when it is determined that the shortest distance between the two convex polygons is greater than the parameter given by the user, there is no need to fill the copper bridge, and the next judgment is continued.
8. The hole copper filling algorithm based on dynamic programming convex decomposition algorithm according to claim 1 is characterized in that: In S3, when it is determined that the maximum distance between two convex polygons is less than the user-given parameter, the holes of the two polygons are decomposed, one polygon is decomposed into n convex polygons, and the second polygon is decomposed into m convex polygons. The n*m convex polygons are filled with copper bridges in turn, and finally all the copper bridges are merged as copper bridges between the two complex holes.
9. The hole copper filling algorithm based on dynamic programming convex decomposition algorithm according to claim 8 is characterized in that: The number of times of copper bridge filling for n convex polygons and m convex polygons is at most n*m times.
10. The hole copper filling algorithm based on dynamic programming convex decomposition algorithm according to claim 1 is characterized in that: In S3, when it is determined that the closest distance between two convex polygons is greater than the user-given parameter, the detailed position and boundary intersection of the polygons are accurately calculated and added to the copper bridge.