Geometric Union Calculation Method and Device for Printed Circuit Board

By designing the active edge contribution value and introducing rotation calculation steps, the scanning line algorithm is used to perform geometric interception calculation, which solves the problem of low efficiency in polygon vertex processing in the prior art, and improves the efficiency and accuracy of geometric union calculation of printed circuit boards.

CN119830845BActive Publication Date: 2025-05-30JULIN TECH (SHANGHAI) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510329154.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-05-30
Estimated Expiration
2045-03-20

AI Technical Summary

Technical Problem

In the prior art, geometric interleaving algorithms cannot effectively process the vertices of polygons, resulting in a decrease in the geometric union calculation efficiency of printed circuit boards.

Method used

By designing the contribution value of the active edge, we judge whether the vertex participates in union calculation, and introduces a rotation calculation step, and use the scanning line algorithm to perform geometric interception calculation.

Benefits of technology

The efficiency and accuracy of geometric union calculation of printed circuit boards is improved, unnecessary waste of computing resources is reduced, and O(n) time complexity calculation is realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119830845B_ABST
    Figure CN119830845B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for calculating the geometric union of a printed circuit board for EDA simulation. The method includes: obtaining the node information of a first polygon and a second polygon, where the two polygons respectively represent different regions of the printed circuit board; constructing a local minimum table and determining the contribution values of the nodes in the local minimum table; constructing a scan line table based on the first polygon and the second polygon, where the scan line table includes a plurality of scan regions; traversing each scan region of the scan line table until it is confirmed whether the nodes in all the scan regions of the scan line table participate in the calculation of the union; for each scan region, perform the following operations: determine whether the nodes in the scan region participate in the calculation of the union according to the contribution values and the relative positional relationship of the intersecting active edges in the scan region, where the active edges are the edges of the first polygon or the second polygon and at least part of them is in the scan region. In this way, the calculation efficiency of the geometric union of the printed circuit board is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of electronic design automation, and in particular to a method and device for calculating the geometric union of a printed circuit board. Background Art

[0002] In the field of electronic design automation (EDA), the pre-processing of printed circuit boards (PCBs) is an important part of the signal integrity and power integrity analysis of board-level circuit systems. Geometric intersection calculation has always been an important part of PCB pre-processing. The main challenge facing geometric intersection calculation is how to improve the calculation efficiency while ensuring the accuracy of the calculation results.

[0003] The geometric intersection algorithm in the prior art cannot effectively process the vertices of polygons. For example, when calculating the geometric union of two polygons, it is impossible to remove redundant vertices, resulting in a decrease in the overall calculation efficiency.

[0004] Therefore, how to improve the computational efficiency of the geometric union of printed circuit boards is a technical problem that needs to be solved urgently. Summary of the invention

[0005] The embodiment of the present application provides a method for calculating the geometric union of a printed circuit board, so as to improve the calculation efficiency of the geometric union of the printed circuit board.

[0006] In a first aspect, the present application discloses a method for calculating the geometric union of a printed circuit board for EDA simulation, the method comprising: obtaining node information of a first polygon and a second polygon, the first polygon being used to characterize a first area of ​​the printed circuit board, and the second polygon being used to characterize a second area of ​​the printed circuit board; constructing a local minimum table based on the first polygon and the second polygon, and determining the contribution value of the node in the local minimum table, the contribution value being used to determine whether the corresponding node participates in the calculation of the union; constructing a scan line table based on the first polygon and the second polygon, the scan line table comprising a plurality of scan areas, each scan area being determined by two adjacent scan lines, the scan line passing through the nodes of the first polygon or the second polygon and being parallel to the X-axis; traversing each scan area of ​​the scan line table until all nodes in all scan areas of the scan line table have been confirmed to participate in the calculation of the union; wherein, for any scan area, performing the following operations: in the scan area, determining whether the nodes in the scan area participate in the calculation of the union based on the contribution value and the relative position relationship of the intersecting active edges in the scan area, the active edge being the edge of the first polygon or the second polygon, and at least partially in the scan area.

[0007] Optionally, the first polygon and the second polygon are located in the same plane rectangular coordinate system, and the method further includes: determining whether there are special edges parallel to the X-axis in the first polygon and the second polygon; if so, rotating the polygon containing the special edge so that all edges of the first polygon and the second polygon are not parallel to the X-axis.

[0008] Optionally, both the first polygon and the second polygon are closed convex polygons, and there are no shared nodes or shared edges between the first polygon and the second polygon.

[0009] Optionally, the contribution value includes a first value and a second value, and the local minimum table includes a first node and a second node; determining the contribution value of the nodes in the local minimum table, where the contribution value is used to determine whether the corresponding node participates in the calculation of the union, including: when the contribution value of the first node is the first value, the first node participates in the calculation of the union; when the contribution value of the second node is the second value, the second node does not participate in the calculation of the union.

[0010] Optionally, the contribution value is of boolean type, the first value is true, and the second value is false.

[0011] Optionally, the first node is a node of the first polygon, and the second node is a node of the second polygon; determining the contribution value of the nodes in the local minimum table, where the contribution value is used to determine whether the corresponding node participates in the calculation of the union, including: using the ray method to determine whether the first node is inside the second polygon and whether the second node is inside the first polygon; when the first node is not inside the second polygon, the contribution value of the first node is the first value; when the second node is inside the first polygon, the contribution value of the second node is the second value.

[0012] Optionally, determining whether the nodes in the scan area participate in the calculation of the union according to the contribution value and the relative positional relationship of the intersecting active edges in the scan area, including: initializing the contribution values of the left wing edge and the right wing edge adjacent to the nodes in the local minimum table according to the contribution values of the nodes in the local minimum table, so that the contribution values of the left wing edge and the right wing edge are the same as the contribution values of the nodes they correspond to.

[0013] Optionally, determining whether the nodes in the scan area participate in the calculation of the union according to the contribution value and the relative positional relationship of the intersecting active edges in the scan area further includes: traversing all the active edges in the scan line area from left to right. If there is a non-vertex intersection between the current active edge and the adjacent active edge on the right in the scan line area, calculate the intersection coordinates and determine the type of the intersection point; when the type of the intersection point is a local minimum point, add a node to be output from the intersection point, swap the positions of the two active edges in the active edge table, and reverse their respective contribution values. The active edge table includes active edges; when the type of the intersection point is a local maximum point, merge the affiliated polygons of the intersecting active edges, swap the positions of the two active edges in the active edge table, and reverse their respective contribution values; when the type of the intersection point is a left center point, insert the node at the left front end of the left active edge polygon, swap the positions of the two active edges in the active edge table, and reverse their respective contribution values; when the type of the intersection point is a right center point, insert the node at the right front end of the right active edge polygon, swap the positions of the two active edges in the active edge table, and reverse their respective contribution values.

[0014] Optionally, determining whether the nodes in the scan area participate in the calculation of the union according to the contribution value and the relative positional relationship of the intersecting active edges in the scan area further includes: traversing all the active edge vertices falling on the top of the scan line area from left to right and determining the type of the vertex; when the type of the vertex is a left center point, if the contribution value of the active edge is the second value, ignore the vertex. If the contribution value of the active edge is the first value, add a new node and add it to the left end of the affiliated active edge polygon; when the type of the vertex is a right center point, if the contribution value of the active edge is the second value, ignore the vertex. If the contribution value of the active edge is the first value, add a new node and add it to the right end of the affiliated active edge polygon; when the type of the vertex is a local maximum point, if the contribution value of the active edge is the second value, ignore the vertex. If the contribution value of the active edge is the first value, merge the affiliated polygons of the intersecting active edges, swap the positions of the two active edges in the active edge table, and reverse their respective contribution values. The active edge table includes active edges.

[0015] In a second aspect, the present application discloses a geometric union calculation device for a printed circuit board, which is used for EDA simulation. The device includes: a memory, a processor, and a computer program stored on the memory. The processor executes the computer program to implement the steps of the geometric union calculation method for the printed circuit board disclosed in the above first aspect.

[0016] In summary, the geometric union calculation method for printed circuit boards disclosed in this application has at least the following beneficial effects: applying the scan line algorithm to the field of geometric intersection realizes efficient geometric intersection calculation; this method not only retains the high efficiency of the scan line algorithm but also can achieve accurate geometric intersection calculation. By newly designing an important variable, the contribution value of the active edge, it is possible to automatically determine whether a vertex should participate in the merging calculation based on the contribution value of the active edge, thereby only retaining the peripheral vertices after geometric merging. At the same time, aiming at the problem that the scan line may be parallel to the active edge, an additional rotation calculation step is added to avoid the occurrence of the special situation where the active edge falls within the top or bottom line of the scan line. This method only needs to process active edges of the order of O(n) during the entire calculation process, and the calculation speed for each active edge is of the order of O(1), greatly improving the calculation efficiency and avoiding unnecessary waste of computing resources. It can handle common PCB layout models and provide efficient technical support for the geometric preprocessing of PCB boards. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] To more clearly illustrate the technical solutions in the embodiments of this application, the following provides an exemplary introduction to the drawings used in the description of the embodiments. The drawings in the following description are only those of the embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on the provided drawings. The drawings are used to provide a further understanding of this application and constitute a part of the specification. They are used together with the embodiments of this application to explain this application and do not constitute a limitation to this application.

[0018] Figure 1 Shows a geometric union calculation method for a printed circuit board provided in some embodiments of this application.

[0019] Figure 2 Shows a schematic diagram of a polygon before and after rotation provided in some embodiments of this application.

[0020] Figure 3 For Figure 2 The representation of the local minimum table of the polygon shown.

[0021] Figure 4 Shows two polygons provided in some embodiments of this application.

[0022] Figure 5 Shows Figure 4 The scan line area of the situation shown.

[0023] Figure 6 Shows an example of the update of the active edge in this application.

[0024] Figure 7 Shows 4 types of intersection points in this application.

[0025] Figure 8 shows Figure 7 the processing method in the MX scenario. Detailed implementation manners

[0026] To more clearly illustrate the technical solutions in the embodiments of the present application, the following will describe the specific implementation manners of the present application with reference to the accompanying drawings. The accompanying drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained according to these drawings, and other embodiments can also be obtained. Adjustments and improvements made without departing from the concept of the present application all fall within the protection scope of the present application.

[0027] To make the drawings concise, each drawing only schematically shows the parts related to the corresponding embodiment, and they do not represent their actual structures as products. In addition, to make the drawings concise and easy to understand, only some structures or components are schematically drawn, and there may actually be more or fewer similar structures or components.

[0028] In the field of electronic design automation, the pre - processing of printed circuit boards is a key link to ensure that the circuit system design meets the performance requirements. Especially in signal integrity and power integrity analysis, geometric intersection calculation plays a crucial role. Through geometric intersection calculation, designers can evaluate the mutual relationships of multiple circuit regions, optimize the circuit layout, avoid conflicts and overlaps in the design, and thus improve the functionality and reliability of the circuit board. However, in this process, how to improve the calculation efficiency while ensuring the accuracy of the calculation results has always been an urgent challenge to be solved.

[0029] In the prior art, there is a geometric clipping technology based on scan lines, which is a very efficient geometric processing method. This algorithm processes the calculation domain by longitudinally dividing it into multiple scan lines, and performs clipping calculations on the active edges within each scan line. The core idea of this algorithm is to generate an initial active edge table through a local minimum table, ensuring that the calculation process of each scan line only needs to extend naturally along the active edge table. In this way, the scan line algorithm can significantly improve the calculation efficiency and achieve a time complexity of O(n), becoming an efficient solution in the calculation of polygon intersections and unions. However, although the scan - line - based technology has obvious advantages in calculation efficiency, it still faces challenges in processing polygon vertices. For example, when calculating the geometric union of two polygons, the prior art cannot effectively remove redundant vertices, resulting in a too high complexity of the calculation results, which in turn affects the overall calculation efficiency and the accuracy of the design.

[0030] To address the deficiencies in the above prior art, the present application discloses a method and device for calculating the geometric union of printed circuit boards. Generally speaking, the concept of the present application lies in: by innovatively designing the contribution value of active edges, the problem of vertex attribution judgment is solved, and a rotation calculation step is introduced to eliminate the special case where the scan line is parallel to the polygon edge. This method applies the geometric calculation technology based on scan lines to the geometric intersection calculation of PCBs, retaining both the high calculation efficiency of the scan line algorithm and ensuring the accuracy of geometric intersection calculation, thereby optimizing the polygon merging process and improving the calculation efficiency and accuracy.

[0031] The following is a description with reference to the accompanying drawings.

[0032] Figure 1 Figure 1 shows a method for calculating the geometric union of a printed circuit board provided in some embodiments of the present application. Please refer to Figure 1 , a method for calculating the geometric union of a printed circuit board for EDA simulation, the method comprising: obtaining node information of polygons, constructing a local minimum table and calculating contribution values, constructing a scan line table, traversing the scan line table and determining whether the scan line table is empty. If the scan line table is not empty, determine whether the nodes in the scan area participate in the calculation of the union according to the contribution values and the relative positional relationship of the intersecting active edges in the scan area. If the scan line table is empty, end the process.

[0033] The ultimate goal of the method provided by the present application is to calculate the geometric union of two regions in a printed circuit board. In EDA simulation, polygons can be used to represent regions on the printed circuit board. For example, in this embodiment, the first polygon is used to represent the first region of the printed circuit board, and the second polygon is used to represent the second region of the printed circuit board.

[0034] In the scenarios of printed circuit board design and EDA simulation, the union of two polygons usually represents different physical or design regions. Depending on the application, these polygons can have different meanings. For example, the two polygons can respectively represent the signal layer region and the power layer region on the PCB. In practical applications, the regions of the signal layer and the power layer sometimes need to be merged or processed to ensure that the power and signal distributions on the circuit board do not interfere with each other. By calculating their geometric union, the relationship analysis between these layers can be achieved, such as ensuring the integrity of the power region during design. Another example is that one polygon represents the occupied region of a component (i.e., the actual space where the component is located), and the other represents the boundary region of the component. By calculating the union of these two regions, the intersection or overlap between the component and other circuit regions can be calculated, and then layout optimization can be carried out to avoid interference or unreasonable layout between components.

[0035] In practical applications, the first region and the second region may also have other meanings. The above examples are only for reference to illustrate the value of the calculation method provided by this application in practical applications: by obtaining the union of two polygons, it can help designers effectively analyze the interaction relationships of each region in EDA simulation and optimize aspects such as the layout, heat dissipation, and electrical performance of the circuit board; it does not limit the specific meanings represented by the above first region and second region.

[0036] In EDA simulation, the first polygon and the second polygon are on the same two-dimensional plane. For ease of operation and understanding, a standard plane rectangular coordinate system can be set on this two-dimensional plane. The node information of the first polygon and the second polygon is the coordinates of each node of these two polygons on the plane rectangular coordinate system.

[0037] In some embodiments of this application, please continue to refer to Figure 1 , the calculation method further includes: determining whether there are special sides parallel to the X-axis in the first polygon and the second polygon; if so, rotating the polygon containing the special side so that all sides of the first polygon and the second polygon are not parallel to the X-axis.

[0038] Figure 2 shows a schematic diagram of a polygon before and after rotation provided in some embodiments of this application. Please refer to Figure 2 , Figure 2 The left figure in Figure 2 is a schematic diagram of the polygon before rotation, Figure 2 The right figure in

[0039] is a schematic diagram of the polygon after rotation. It can be clearly seen from Figure 2 that before rotation, the LA side of the polygon is parallel to the X-axis. Therefore, the polygon can be rotated, for example, by central rotation, so that all sides of the polygon are not parallel to the X-axis. This application does not limit the specific angle of polygon rotation. For those skilled in the art, it can be understood that the existence of the rotation angle of the polygon is inevitable because the sides of the polygon are limited. Therefore, the rotation angle only needs to avoid a finite number of coincidence angles (rotating at these coincidence angles will cause a certain side to be parallel to the X-axis), and any angle can be selected for rotation outside the finite number of coincidence angles.

[0039] The reason why the polygon needs to be rotated so that each side of the polygon is not parallel to the X-axis is because the subsequent calculation logic calculates the intersection of the active sides in each scan line area, and each scan line in the scan line area is set parallel to the X-axis. Therefore, if a side of the polygon is parallel to the X-axis, it will lead to an increase in the complexity of subsequent calculations. For example, additional processing is required outside the overall algorithm framework, which destroys the consistency of the algorithm, which is not conducive to improving the calculation efficiency of the geometric union of the printed circuit board. In order to solve this problem, this embodiment eliminates the special case where the scan line is parallel to the polygon side by rotating the polygon in advance before calculation.

[0040] In some embodiments of the present application, the first polygon and the second polygon are both closed convex polygons, and there are no shared nodes or shared edges between the first polygon and the second polygon. That is, in order to maintain the consistency of the algorithm, the polygons in the present application are preferably closed convex polygons in a two-dimensional plane, and self-intersecting polygons are not supported, and it is assumed that there are no shared nodes or shared edges between different polygons.

[0041] It should be noted that Figure 2 The polygon in is not a convex polygon by definition and will not participate in subsequent calculations as a polygon for calculating the union. Its role is only to illustrate some concepts mentioned in this application (such as polygon rotation and the construction of a local minimum table).

[0042] After obtaining the node information of the first polygon and the second polygon, a local min table (LMT) is constructed based on the node information and the contribution value is calculated. If the polygon has not been rotated, the node information used to construct the LMT is the original node information of the polygon; if the polygon has been rotated, the node information used to construct the LMT is the node information of the rotated polygon. The LMT is used as the starting point for subsequent scan line calculations and is used to generate polygons to be merged.

[0043] Figure 3 for Figure 2 The local minimum table representation of the polygon shown. Please refer to Figure 3 Each LMT geometry consists of three parts: the root node, the left-wing vertex list, and the right-wing vertex list. The root node is the local minimum point. Figure 2In the rotated polygon shown, there are two root nodes, namely A and G. The method for judging local minimum points can refer to the conventional technical means in the art, and the present application will not elaborate on this. The left-wing vertex linked list of root node A is L, K, J, and the right-wing vertex linked list of root node A is B, C, D, E; the left-wing vertex linked list of root node G is H, I, J, and the right-wing vertex linked list of root node G is F, E. In the above LMT, it is necessary to determine the contribution value of the root node, that is, the contribution values of root node A and root node G. The contribution value is used to judge whether the corresponding node participates in the calculation of the union.

[0044] In some embodiments of the present application, the contribution value includes a first value and a second value, and the local minimum table includes a first node and a second node; determining the contribution value of the node in the local minimum table includes: when the contribution value of the first node is the first value, the first node participates in the calculation of the union; when the contribution value of the second node is the second value, the second node does not participate in the calculation of the union.

[0045] Figure 4 Two polygons provided in some embodiments of the present application are shown. Please refer to Figure 4 , Figure 4 There are two polygons in it. For the sake of convenience of description, the quadrilateral P1P2P3P4 is called the first polygon, and the quadrilateral P5P6P7P8 is called the second polygon. For Figure 4 the first polygon and the second polygon shown, there are two root nodes in the local minimum table, that is, root node P1 and root node P5. Root node P1 is called the first node, and root node P5 is called the second node. The contribution value includes two different expressions, namely the first value and the second value. The node determined to be the first value participates in the calculation of the union, and the node determined to be the second value does not participate in the calculation of the union. The corresponding relationship between the above nodes and the polygons is: the first node is the node of the first polygon, and the second node is the node of the second polygon.

[0046] In some embodiments of the present application, the contribution value is of the boolean type, the first value is the true value, and the second value is the false value. Exemplarily, the contribution value of the first node is TRUE, and the contribution value of the second node is FLASE; that is, the contribution value of P1 is TRUE, and the contribution value of P5 is FALSE. It should be noted that the data type of the contribution value is not limited to the boolean type. For example, the contribution value can also be an integer (int) data, the first value is set to 1, and the second value is set to 0. That is, only the expressions of the first value and the second value need to be distinguished. For the sake of unified description, the contribution value will be described in the boolean type in the following text.

[0047] In some embodiments of the present application, determining the contribution value of a node in the local minimum table includes: using the ray method to determine whether the first node is inside the second polygon and whether the second node is inside the first polygon; when the first node is not inside the second polygon, the contribution value of the first node is the first value; when the second node is inside the first polygon, the contribution value of the second node is the second value.

[0048] The reason for additionally setting the attribute of the contribution value for the node in the present application is that in the prior art, when calculating the union of two polygons, the nodes located inside another polygon cannot be directly deleted during the calculation process, but additional technical means are required to delete the redundant nodes after the calculation is completed, which results in low calculation efficiency. Please continue to refer to Figure 4 , since this is a relatively simple example, it can be judged by the naked eye that Figure 4 the geometric union of the first polygon and the second polygon in Figure 5 the area enclosed by the nodes P1, P2, I2, P6, P7, P8, I1, and P4 in Figure 5 (where I1 is the intersection point of the side P3P4 and the side P5P8, and I2 is the intersection point of the side P2P3 and the side P5P6. For a detailed explanation of Figure 4 , reference can be made to the subsequent embodiments). It can be seen that in the case of Figure 4 , the nodes P3 and P5 are redundant nodes in the geometric union calculation because the finally determined geometric union has nothing to do with these two nodes. Among them, the node P3 is the root node, so at this time, its contribution value is directly set to FALSE so that it does not participate in the subsequent union calculation. Logically speaking, the reason why the node P5 of the second polygon does not affect the finally determined geometric union is that its position is inside the first polygon. Therefore, the ray method can be used to determine whether the root node is inside another polygon to determine the contribution value of the root node. Exemplarily, in the case shown in

[0049] After the local minimum table is constructed and the contribution value of the root node therein is determined, a scan beam table (SBT) is constructed based on the first polygon and the second polygon. The scan beam table includes a number of scan regions, each of which is determined by two adjacent scan lines. The scan lines pass through the nodes of the first polygon or the second polygon and are parallel to the X-axis.

[0050] Figure 5 shows Figure 4 the scan line region of the shown situation. Figure 5 The shaded part in, that is, the region between P1 and P5 is the first scan region in the scan line table. The range of this scan region is determined by the coordinate information of node P1 and node P5. In the scan line table, in addition to Figure 5 the region shown by the shaded part in, there are other regions, such as the region between P5 and P2, the region between P2 and P4, etc. Since there is an operation of traversing the scan line table in subsequent operations, after processing a scan region, the information corresponding to this region can be deleted from the scan line table, so as to judge whether the traversal operation is completed according to whether the scan line table is empty.

[0051] After the scan line table is constructed, traverse each scan region of the scan line table until it is confirmed whether the nodes in all scan regions of the scan line table participate in the calculation of the union. Among them, for any scan region, the following operations are performed: in the scan region, determine whether the nodes in this scan region participate in the calculation of the union according to the contribution value and the relative position relationship of the intersecting active edges in the scan region. The active edge is an edge of the first polygon or the second polygon and at least part of it is in the scan region.

[0052] In this way, applying the scan line algorithm to the field of geometric intersection realizes efficient geometric intersection calculation; this method not only retains the high-efficiency characteristics of the scan line algorithm, but also can achieve accurate calculation of geometric intersection. By newly designing the important variable of the contribution value of the active edge, it can be automatically judged whether a vertex should participate in the merging calculation based on the contribution value of the active edge, so as to only retain the peripheral vertices after geometric merging. This method only needs to process active edges of the order of O(n) in the whole calculation process, and the calculation speed of each active edge is of the order of O(1), which greatly improves the calculation efficiency and avoids unnecessary waste of computing resources.

[0053] In some embodiments of the present application, after the scan line table is constructed, an active edge table (AET) can be constructed. The AET is a set of active edges participating in the calculation within the current scan line area. The active edges within each scan line are sorted according to the X coordinate value of the bottom node. At the same time, they also have contribution value attributes and left and right wing edge attributes. The contribution value is initialized according to the LMT root node. Each active edge has a corresponding polygon.

[0054] In some embodiments of the present application, determining whether a node in the scan area participates in the union calculation according to the contribution value and the relative position relationship of the intersecting active edges in the scan area includes: initializing the contribution values of the left and right wing edges adjacent to the nodes in the local minimum table according to the contribution values of the nodes in the local minimum table, so that the contribution values of the left and right wing edges are the same as the contribution values of the nodes they correspond to.

[0055] Traverse all LMTs, find the LMT root nodes that fall inside and on the bottom edge of the current scan line area (excluding those that fall on the top edge of the scan line area), and create two adjacent active edges and initialize them according to the LMT root node and the left and right wing edges. Assign the contribution value of the LMT to the active edge. If the contribution value is FALSE, the polygon attached to the active edge is set to a null pointer. If it is TRUE, the polygon is composed of the LMT root node and the left and right wing active edges. Figure 6 Shows an example when the active edge of the present application is updated. Please refer to Figure 6 , from Figure 6 As can be seen from the left figure, the polygon does not have to be closed during the calculation process.

[0056] In some embodiments of the present application, determining whether a node in the scan area participates in the union calculation according to the contribution value and the relative position relationship of the intersecting active edges in the scan area further includes: traversing all active edges in the scan line area from left to right. If there is a non-vertex intersection between the current active edge and the adjacent active edge on the right in the scan line area, calculate the intersection coordinates and determine the type of the intersection point; when the type of the intersection point is a local minimum point, add a new node to be output at the intersection point, swap the positions of the two active edges in the active edge table, and reverse their respective contribution values. The active edge table includes active edges; when the type of the intersection point is a local maximum point, merge the polygons attached to the intersecting active edges, swap the positions of the two active edges in the active edge table, and reverse their respective contribution values; when the type of the intersection point is a left center point, insert the node at the left front end of the left active edge polygon, swap the positions of the two active edges in the active edge table, and reverse their respective contribution values; when the type of the intersection point is a right center point, insert the node at the right front end of the right active edge polygon, swap the positions of the two active edges in the active edge table, and reverse their respective contribution values.

[0057] This embodiment shows how to handle the intersections of adjacent active edges. Traverse all the active edges in this scan line region from left to right. If there is a non-vertex intersection between the current active edge and the adjacent active edge on the right within the scan line region, calculate the intersection coordinates. Figure 7 Four types of intersection points in this application are shown. Please refer to Figure 7 , the intersection type in the upper left is a local minimum point, the intersection type in the upper right is a local maximum point, the intersection type in the lower left is a left intermediate point, and the intersection type in the lower right is a right intermediate point. The specific processing methods for these intersection types are as follows.

[0058] Local minimum point (MN), such as Figure 7 As shown in the upper left, the area inside the polygon after intersection is the shaded range. In this case, the intersection point is a local minimum point. In this case, a new node to be output needs to be added at the intersection point, and the positions of the two active edges in the AET are exchanged, and their respective contribution values are inverted.

[0059] Local maximum point (MX), such as Figure 7 The intersection point in the upper right is a local maximum point. In this case, the subsidiary polygons of the multi-intersecting active edges need to be merged, and the positions of the two active edges in the AET are exchanged, and their respective contribution values are inverted. Figure 8 Shows Figure 7 The processing method in the MX case in

[0060] Left intermediate point (LI), such as Figure 7 As shown in the lower left, the intersection point is a left intermediate point. In this case, the node needs to be inserted at the left front end of the left active edge polygon, and the positions of the two active edges in the AET are exchanged, and their respective contribution values are inverted.

[0061] Right intermediate point (RI), such as Figure 7 As shown in the lower right, the intersection point is a right intermediate point. In this case, the node needs to be inserted at the right front end of the right active edge polygon, and the positions of the two active edges in the AET are exchanged, and their respective contribution values are inverted.

[0062] In some embodiments of the present application, determining whether a node in the scan area participates in the calculation of the union according to the contribution value and the relative position relationship of the intersecting active edges in the scan area further includes: traversing all active edge vertices falling on the top of the scan line area from left to right, and determining the type of the vertex; when the type of the vertex is the left center point, if the contribution value of the active edge is the second value, the vertex is ignored, if the contribution value of the active edge is the first value, a new node is added and added to the left end of the active edge polygon to which it belongs; when the type of the vertex is the right center point, if the contribution value of the active edge is the second value, the vertex is ignored, if the contribution value of the active edge is the first value, a new node is added and added to the right end of the active edge polygon to which it belongs; when the type of the vertex is the local maximum point, if the contribution value of the active edge is the second value, the vertex is ignored, if the contribution value of the active edge is the first value, the affiliated polygons of the intersecting active edges are merged, the positions of the two active edges in the active edge table are exchanged, and their respective contribution values are reversed, and the active edge table includes active edges.

[0063] This embodiment shows how to process the nodes falling on the top of the scan line. Traverse all active edge vertices falling on the top of the current scan line area from left to right (the LMT root node will be covered by the next scan in this case), and determine the vertex type. The specific processing methods for these vertex types are as follows.

[0064] LI, if the contribution value of the active edge is FALSE, no processing is performed (the node is inside the polygon), otherwise a new node is added and added to the left end of the active edge polygon to which it belongs.

[0065] RI, if the contribution value of the active edge is FALSE, no processing is performed (the node is inside the polygon), otherwise a new node is added and added to the right end of the active edge polygon to which it belongs.

[0066] MX, in this case, two active edges of the same input polygon intersect. According to the transformation rule of the active edge contribution value, their contribution values should be kept consistent. If it is FALSE, no processing is performed (the intersection point is inside the polygon), otherwise the processing method is the same as the processing method of MX in the above embodiment.

[0067] In this embodiment, the case of MN does not exist because what is processed here is not the intersection point, but the node of the polygon itself, so the case of MN is not included. That is, the points of MN are already included in the LMT and will be processed during the next scan.

[0068] In summary, for each scan area, the intersection points of the active edges therein and the quadrilateral nodes falling on the top edge of the scan area are processed separately. In this way, all vertices of the two polygons can be processed according to the contribution value and the relative position relationship to determine whether they participate in the union calculation.

[0069] In some embodiments of the present application, the geometric union calculation method of the printed circuit board further includes post-processing the calculation results. Record the polygon obtained by merging at the last MX in the last scan line region. If there is an intersection between the two polygons input at the program entry, output the polygon. If the intersection of the two input polygons in the two-dimensional space is empty, return the original two input polygons.

[0070] For Figure 5 the situation shown, the following details its calculation process through a table.

[0071]

[0072] The construction steps of the above table are as follows.

[0073] Event 1, process the LMT root node P1, and create a polygon Poly1 (P1:P1), and assign Poly1 to the active edge.

[0074] Event 2, process the LMT root node P5, the contribution value of P5 is FALSE, no operation is performed, skip.

[0075] Event 3 and Event 4, process P2 and P4 respectively, and create nodes and add them to Poly1 (P4,P1,P2).

[0076] Event 5, process the intersection point I1, both intersecting active edges are left-wing edges, the intersection point I1 is judged as LI, exchange the positions of the active edges in the AET, and reverse the contribution value. The contribution value of the active edge entering the polygon becomes FALSE, and the contribution value of the active edge leaving the polygon becomes TRUE. Poly1 is updated to (I1,P4,P1,P2), and at the same time, Poly1 is assigned the left active edge.

[0077] Event 6 is the same as Event 5, and Poly1 is updated to (I1,P4,P1,P2,I2).

[0078] Event 7 and Event 8 are the same as Event 3 and Event 4, and Poly1 is updated to (P8,I1,P4,P1,P2,I2,P6).

[0079] Event 9, process the node P3 that falls on the top of the scan line. This node is MX, but since its attached active edges are all FALSE (that is, both the edge P3P4 and the edge P3P2 are FALSE), it is skipped.

[0080] Event 10, process the node P7 that falls on the top of the scan line. This node is MX, and its contribution value is TRUE, so create a node and add it to Poly1. The finally updated Poly1 is (P7,P8,I1,P4,P1,P2,I2,P6).

[0081] Based on a similar technical concept, the present application discloses a geometric union calculation device for a printed circuit board for EDA simulation. The device includes: a memory, a processor, and a computer program stored on the memory. The processor executes the computer program to implement the steps of the geometric union calculation method for the printed circuit board disclosed in the above embodiments.

[0082] In the present application, unless otherwise clearly specified and limited, ordinal numbers, such as "first", "second", etc., are only used to distinguish and describe related objects, and cannot be understood as indicating or implying the relative importance or order between related objects. In addition, ordinal numbers do not represent the quantity of related objects.

[0083] The term "or" and "and / or" in the present application are used to describe the relationship between related objects, which means non-exclusive inclusion. For example, both "A and / or B" and "A or B" may include: "A alone", "B alone", or "A and B", where "A" and "B" may include a single object or multiple objects. Again, "A, B, and / or C", "A, B, or C", and "A, B, and C" may all include: "A alone", "B alone", "C alone", "A and B", "A and C", "B and C", or "A, B, and C", where "A", "B", and "C" may include a single object or multiple objects. In addition, " / " in the present application is used to represent the "or" relationship between the front and rear related objects. The meanings of "at least one of A or B" and "one or more of A and B" in the present application are the same as the meaning of "A or B" above, and the meanings of "one or more of A, B, and C" and "at least one of A, B, or C" are the same as the meaning of "A, B, or C" above. The meaning of "one or more of A, B, and C" is the same as the meaning of "A, B, or C" above.

[0084] In the above embodiments, the descriptions of each embodiment have their own emphases. For parts that are not described or recorded in detail in a certain embodiment, reference may be made to the relevant descriptions of other embodiments. In addition, the above embodiments can be freely combined as needed.

Claims

1. A method for calculating the geometric union of a printed circuit board, characterized in that: For EDA simulation, the method comprises: Acquire node information of a first polygon and a second polygon, wherein the first polygon is used to represent a first area of ​​the printed circuit board, the second polygon is used to represent a second area of ​​the printed circuit board, and the first polygon and the second polygon are located in the same plane rectangular coordinate system; Determine whether there is a special edge parallel to the X-axis in the first polygon and the second polygon; if so, rotate the polygon containing the special edge so that all edges of the first polygon and the second polygon are not parallel to the X-axis; Building a local minimum table based on the first polygon and the second polygon, and determining a contribution value of a root node in the local minimum table, wherein the contribution value is used to determine whether a corresponding node participates in the calculation of a union; Constructing a scan line table based on the first polygon and the second polygon, the scan line table including a plurality of scan areas, each of the scan areas being determined by two adjacent scan lines, the scan lines passing through nodes of the first polygon or the second polygon and being parallel to the X-axis; Traversing each scanning area of ​​the scanning line table until all nodes in all scanning areas of the scanning line table have confirmed whether to participate in the calculation of the union; For any of the scanning areas, the following operations are performed: In the scanning area, whether the nodes in the scanning area participate in the calculation of the union is determined based on the contribution value and the relative position relationship of the intersecting active edges in the scanning area, and the active edges are edges of the first polygon or the second polygon, and are at least partially in the scanning area.

2. The method for calculating the geometric union of a printed circuit board according to claim 1, characterized in that: Both the first polygon and the second polygon are closed convex polygons, and there are no shared nodes or shared edges between the first polygon and the second polygon.

3. The method for calculating the geometric union of a printed circuit board according to claim 2, characterized in that: The contribution value includes a first value and a second value, and the local minimum table includes a first node and a second node; The step of determining the contribution value of the node in the local minimum table, wherein the contribution value is used to determine whether the corresponding node participates in the calculation of the union, includes: When the contribution value of the first node is the first value, the first node participates in the calculation of the union; When the contribution value of the second node is the second value, the second node does not participate in the calculation of the union.

4. The method for calculating the geometric union of a printed circuit board according to claim 3, characterized in that: The contribution value is of Boolean type, the first value is a true value, and the second value is a false value.

5. The method for calculating the geometric union of a printed circuit board according to claim 3 or 4, characterized in that: The first node is a node of the first polygon, and the second node is a node of the second polygon; The step of determining the contribution value of the node in the local minimum table, wherein the contribution value is used to determine whether the corresponding node participates in the calculation of the union, includes: Using a ray method to determine whether the first node is located inside the second polygon and whether the second node is located inside the first polygon; When the first node is not located inside the second polygon, the contribution value of the first node is the first value; When the second node is located inside the first polygon, the contribution value of the second node is the second value.

6. The method for calculating the geometric union of a printed circuit board according to claim 3, characterized in that: The step of determining whether a node in the scanning area participates in the calculation of a union according to the contribution value and the relative position relationship of the intersecting active edges in the scanning area includes: According to the contribution value of the node in the local minimum table, the contribution values ​​of the left wing edge and the right wing edge adjacent to the node in the local minimum table are initialized so that the contribution values ​​of the left wing edge and the right wing edge are the same as the contribution values ​​of the nodes corresponding to them.

7. The method for calculating the geometric union of a printed circuit board according to claim 6, characterized in that: The determining whether the nodes in the scanning area participate in the calculation of the union according to the contribution value and the relative position relationship of the intersecting active edges in the scanning area further includes: Traverse all active edges in the scan line area from left to right. If the current active edge intersects with the adjacent active edge on the right in the scan line area without a vertex, calculate the intersection coordinates and determine the type of the intersection. When the type of the intersection is a local minimum point, a node to be output is added from the intersection, and the positions of two active edges in the active edge table are exchanged, and their respective contribution values ​​are reversed, and the active edge table includes the active edges; When the type of the intersection point is a local maximum point, the subordinate polygons of the intersecting active edges are merged, and the positions of the two active edges in the active edge table are exchanged, and their respective contribution values ​​are inverted; When the type of the intersection point is a left center point, insert the node to the left front end of the left active edge polygon, swap the positions of the two active edges in the active edge table, and invert their respective contribution values; When the type of the intersection point is a right center point, the node is inserted into the right front end of the right active edge polygon, and the positions of the two active edges in the active edge table are exchanged, and their respective contribution values ​​are reversed.

8. The method for calculating the geometric union of a printed circuit board according to claim 6 or 7, characterized in that: The determining whether the nodes in the scanning area participate in the calculation of the union according to the contribution value and the relative position relationship of the intersecting active edges in the scanning area further includes: Traverse all active edge vertices that fall on the top of the scan line area from left to right, and determine the type of the vertex; When the type of the vertex is a left center point, if the contribution value of the active edge is the second value, the vertex is ignored; if the contribution value of the active edge is the first value, a new node is added and added to the left end of the active edge polygon; When the type of the vertex is a right center point, if the contribution value of the active edge is the second value, the vertex is ignored; if the contribution value of the active edge is the first value, a new node is added and added to the right end of the active edge polygon; When the type of the vertex is a local maximum point, if the contribution value of the active edge is the second value, the vertex is ignored; if the contribution value of the active edge is the first value, the affiliated polygons of the intersecting active edges are merged, and the positions of the two active edges in the active edge table are exchanged, and their respective contribution values ​​are reversed. The active edge table includes the active edge.

9. A device for calculating the geometric union of a printed circuit board, characterized in that: Used for EDA simulation, the device comprises: a memory, a processor and a computer program stored in the memory, and the processor executes the computer program to implement the steps of the method for calculating the geometric union of a printed circuit board as described in any one of claims 1-8.

Citation Information

Patent Citations

  • Large-scale graph simplification method for polygon with arcs

    CN118133759A