Method and device for calculating geometric union set of printed circuit board

By designing the active edge contribution value and introducing rotation calculation steps, the scanning line algorithm is used to perform geometric interleaving calculation, solving the problem of low efficiency in polygon vertex processing in the prior art, and achieving efficient and accurate geometric union calculation.

CN119830845AActive Publication Date: 2025-04-15JULIN TECH (SHANGHAI) CO LTD

Patent Information

Application Number
CN202510329154.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-20
Publication Date
2025-04-15
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 of geometric union calculation of printed circuit boards is improved, efficient geometric interpolation calculation is achieved, and the accuracy of calculation is ensured.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119830845A_ABST
    Figure CN119830845A_ABST
Patent Text Reader

Abstract

The invention discloses a geometric union calculation method and device for a printed circuit board, and the method and device are used for EDA simulation, and the method comprises the steps: obtaining the node information of a first polygon and a second polygon, the two polygons respectively representing different regions of the printed circuit board; constructing a local minimum table, and determining contribution values of nodes in the local minimum table; constructing a scanning line table based on the first polygon and the second polygon, wherein the scanning line table comprises a plurality of scanning areas; traversing each scanning area of the scanning line table until nodes in all the scanning areas of the scanning line table confirm whether to participate in union calculation or not; and for each scanning area, executing the following operations: determining whether nodes in the scanning area participate in union calculation or not according to the contribution value and a relative position relationship of intersected active edges in the scanning area, the active edges being edges of the first polygon or the second polygon, and at least part of the active edges being in the scanning area. Therefore, the calculation efficiency of the geometric union set 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 also includes: determining whether there are special edges in the first polygon and the second polygon that are parallel to the X-axis; if so, rotating the polygon containing the special edges 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; the contribution value of the node in the local minimum table is determined, and 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 a first value, the first node participates in the calculation of the union; when the contribution value of the second node is a 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 a true value, and the second value is a false value.

[0011] Optionally, the first node is a node of the first polygon, and the second node is a node of the second polygon; determine the contribution value of the node in the local minimum table, and 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 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.

[0012] Optionally, 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, including: initializing the contribution values ​​of the left-wing edges and the right-wing edges adjacent to the nodes in the local minimum table based on the contribution values ​​of the nodes in the local minimum table, so that the contribution values ​​of the left-wing edges and the right-wing edges are the same as the contribution values ​​of the nodes to which they correspond.

[0013] Optionally, determining whether a node in the scanning area participates 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 also includes: traversing all active edges in the scanning line area from left to right, if the current active edge and the adjacent active edge on the right have a non-vertex intersection in the scanning line area, then calculating the intersection coordinates and determining the type of the intersection; when the type of the intersection is a local minimum point, adding a node to be output from the intersection, and exchanging the positions of the two active edges in the active edge table, and inverting their respective contribution values, the active edge table including the active edges; when the type of the intersection is a local maximum point, merging the affiliated polygons of the intersecting active edges, and exchanging the positions of the two active edges in the active edge table, and inverting their respective contribution values; when the type of the intersection is a left center point, inserting the node to the left front end of the left active edge polygon, and exchanging the positions of the two active edges in the active edge table, and inverting their respective contribution values; when the type of the intersection is a right center point, inserting the node to the right front end of the right active edge polygon, and exchanging the positions of the two active edges in the active edge table, and inverting their respective contribution values.

[0014] Optionally, determining 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 also includes: traversing all active edge vertices that fall on the top of the scanning line area from left to right, and judging 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, and 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, and 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, and 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, and the active edge table includes the active edges.

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

[0016] In summary, the geometric union calculation method of the printed circuit board disclosed in the present application has at least the following beneficial effects: the scanning line algorithm is applied to the field of geometric intersection, and efficient geometric intersection calculation is realized; the method not only retains the high efficiency characteristics of the scanning line algorithm, but also can realize accurate calculation of geometric intersection. By newly designing the important variable of active edge contribution value, it can automatically judge whether the vertex should participate in the merging calculation based on the active edge contribution value, so that only the peripheral vertices after geometric merging are retained. At the same time, in view of the possible problem of parallel scanning line and active edge, the rotation calculation step is added to avoid the special situation that the active edge falls on the top line or bottom line of the scanning line. This method only needs to process O(n) order of magnitude active edges in the whole calculation process, and the calculation speed of active edges each time is O(1) order of magnitude, which greatly improves the calculation efficiency and avoids unnecessary waste of calculation resources. It can process common PCB layout models and provide efficient technical support for PCB board geometry pre-processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following is an exemplary introduction to the drawings used in the description of the embodiments. The drawings described below are only embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without creative work. The drawings are used to provide a further understanding of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation on the present application.

[0018] Figure 1 A method for calculating the geometric union of a printed circuit board provided in some embodiments of the present application is shown.

[0019] Figure 2 A schematic diagram of a polygon before and after rotation provided in some embodiments of the present application is shown.

[0020] Figure 3 for Figure 2 Representation of the local minimum table of the shown polygon.

[0021] Figure 4 Two polygons provided in some embodiments of the present application are shown.

[0022] Figure 5 Shows Figure 4 Scan line area for the situation shown.

[0023] Figure 6 An example of active edge updating in the present application is shown.

[0024] Figure 7 There are 4 intersection types shown in this application.

[0025] Figure 8 Shows Figure 7 How to deal with the MX situation. DETAILED DESCRIPTION

[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the specific implementation methods of the present application will be described below with reference to the accompanying drawings. The accompanying drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other accompanying drawings and other embodiments can be obtained based on these accompanying drawings without creative work. Adjustments and improvements made without departing from the concept of the present application are all within the scope of protection of the present application.

[0027] In order to simplify the drawings, each of the drawings schematically shows only the parts related to the corresponding embodiments, and they do not represent the actual structure of the product. In addition, in order to simplify the drawings and facilitate understanding, only some structures or components are schematically depicted, and there may be more or fewer similar structures or components in reality.

[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. In particular, in signal integrity and power integrity analysis, geometric intersection calculation plays a vital role. Through geometric intersection calculation, designers can evaluate the relationship between multiple circuit areas, optimize 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 ensure the accuracy of the calculation results while improving the calculation efficiency has always been a challenge that needs to be solved.

[0029] In the prior art, there is a scan-line-based geometric clipping technology, which is a very efficient geometric processing method. The algorithm divides the computational domain into multiple scan lines for processing vertically, and performs clipping calculations on the active edges in each scan line. The core idea of ​​this algorithm is to generate an initial active edge table through a local minimum table to ensure 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 computational efficiency and achieve a time complexity of O(n), becoming an efficient solution for processing polygon intersection and union calculations. However, although the scan line-based technology has obvious advantages in computational 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 excessive complexity of the calculation results, which in turn affects the overall computational efficiency and design accuracy.

[0030] In order to solve the deficiencies in the above prior art, the present application discloses a method and device for calculating the geometric union of a printed circuit board. In general, the concept of the present application is to solve the vertex attribution judgment problem by innovatively designing the active edge contribution value, and introduce a rotation calculation step to eliminate the special case where the scan line is parallel to the polygon edge. The method applies the scan line-based geometric calculation technology to the geometric intersection calculation of the PCB, which not only retains the high calculation efficiency of the scan line algorithm, but also ensures the accuracy of the 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 A method for calculating the geometric union of a printed circuit board provided in some embodiments of the present application is shown. Figure 1 A geometric union calculation method for a printed circuit board is used for EDA simulation. The method includes: obtaining node information of a polygon, constructing a local minimum table and calculating a contribution value, constructing a scan line table, traversing the scan line table and judging whether the scan line table is empty. If the scan line table is not empty, determining whether the nodes in the scan 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 scan area. If the scan line table is empty, the process ends.

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

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

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

[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 may be set on the two-dimensional plane. The node information of the first polygon and the second polygon is the coordinates of each node of the 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 is a special edge 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.

[0038] Figure 2 Schematic diagram of a polygon before and after rotation provided in some embodiments of the present application is shown. Figure 2 , Figure 2 The left picture in the figure is a schematic diagram of the polygon before rotation. Figure 2 The right picture in the figure is a schematic diagram of the rotated polygon. Figure 2 It can be clearly seen that before the rotation, the LA side of the polygon is parallel to the X-axis, so the polygon can be rotated by, for example, center rotation so that all sides of the polygon are not parallel to the X-axis. The present 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 angle of polygon rotation is inevitable, because the sides of the polygon are limited, so the rotation angle only needs to avoid a limited number of coincidental angles (rotating the coincidental angle will cause a side to be parallel to the X-axis), and any angle outside the limited number of coincidental angles can be selected for rotation.

[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 2The rotated polygon shown has two root nodes, namely A and G. The method for determining the local minimum point can refer to the conventional technical means in the field, and this application will not go into details. The left-wing vertex list of root node A is L, K, and J, and the right-wing vertex list of root node A is B, C, D, and E; the left-wing vertex list of root node G is H, I, and J, and the right-wing vertex list of root node G is F and E. In the above LMT, it is necessary to determine the contribution value of the root node, that is, the contribution value of root node A and root node G. The contribution value is used to determine 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 a node in the local minimum table includes: when the contribution value of the first node is a first value, the first node participates in the calculation of the union; when the contribution value of the second node is a 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. Figure 4 , Figure 4 There are two polygons in . For the convenience of description, quadrilateral P1P2P3P4 is called the first polygon, and quadrilateral P5P6P7P8 is called the second polygon. Figure 4 The first polygon and the second polygon shown have two root nodes in the local minimum table, namely the root node P1 and the root node P5. The root node P1 is called the first node, and the 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 as the first value participates in the calculation of the union, and the node determined as the second value does not participate in the calculation of the union. The correspondence between the above nodes and 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 Boolean type, the first value is a true value, and the second value is a 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 integer (int) data, the first value is set to 1, and the second value is set to 0. That is, it is only necessary to distinguish the expression of the first value and the second value. In order to unify the description, the contribution value will be described as a Boolean type in the following text.

[0047] In some embodiments of the present application, determining the contribution value of a node in a local minimum table 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 a first value; when the second node is located inside the first polygon, the contribution value of the second node is a second value.

[0048] The reason why the contribution value attribute is set for nodes in this application is that in the prior art, when calculating the union of two polygons, the nodes inside the other polygon cannot be directly deleted during the calculation process. Instead, additional technical means are required to delete the redundant nodes after the calculation is completed, which leads to low calculation efficiency. Please continue to refer to Figure 4 , since this is a simple example, you can tell by eye that Figure 4 The geometric union of the first and second polygons in Figure 5 The area enclosed by nodes P1, P2, I2, P6, P7, P8, I1, and P4, where I1 is the intersection of edge P3P4 and edge P5P8, and I2 is the intersection of edge P2P3 and edge P5P6. Figure 5 The detailed explanation can refer to the subsequent embodiments). It can be seen that Figure 4 In the case of , nodes P3 and P5 are redundant nodes in the geometric union calculation, because the final geometric union has nothing to do with these two nodes. Among them, node P3 is the root node, so at this time its contribution value is directly set to FLASE so that it does not participate in the subsequent union calculation. Logically speaking, the reason why the node P5 of the second polygon has no effect on the final geometric union is because its position is inside the first polygon. Therefore, the ray method can be used to determine whether the root node is located inside another polygon to determine the contribution value of the root node. For example, in Figure 4 In the situation shown, because the first node is not located inside the second polygon, the contribution value of the first node is the first value; because the second node is located inside the first polygon, the contribution value of the second node is the second value. Among them, the basic principle of the ray method is to start from the target point, shoot a ray in any direction, and count the number of intersections between the ray and the polygon edge. If the number of intersections is an odd number, the target point is inside the polygon; if the number of intersections is an even number, the target point is outside the polygon. It should be noted that the method used in this application to determine whether the root node is located inside another polygon is not limited to the ray method mentioned above. For example, there may also be angle sum method, edge intersection method, etc.

[0049] After the local minimum table is constructed and the contribution value of the root node is determined, a scan beam table (SBT) is constructed based on the first polygon and the second polygon. The scan beam table includes several scan areas, 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 Scan line area for the situation shown. Figure 5 The shaded area in the scan line table, that is, the area between P1 and P5, is the first scan area in the scan line table. The range of this scan area is determined by the coordinate information of nodes P1 and P5. Figure 5 There are other areas, such as the area between P5 and P2, the area between P2 and P4, etc. Since there is an operation of traversing the scan line table in subsequent operations, after processing a scan area, the information corresponding to the area 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, each scan area of ​​the scan line table is traversed until all nodes in all scan areas of the scan line table have been confirmed whether to participate in the calculation of the union. For any scan area, the following operations are performed: in the scan area, whether the nodes in the scan area participate in the calculation of the union is determined according to the contribution value and the relative position relationship of the intersecting active edges in the scan area, and the active edge is the edge of the first polygon or the second polygon, and at least part of it is in the scan area.

[0052] In this way, the scan line algorithm is applied to the field of geometric intersection, and efficient geometric intersection calculation is achieved; this method not only retains the high efficiency characteristics of the scan line algorithm, but also can achieve accurate calculation of geometric intersection. By designing a new important variable, the active edge contribution value, it can automatically determine whether the vertex should participate in the merge calculation based on the active edge contribution value, so that only the peripheral vertices after the geometric merge are retained. This method only needs to process O(n) active edges in the entire calculation process, and the calculation speed of each active edge is 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. AET is a set of active edges participating in the calculation in the current scan line area. The active edges in each scan line are sorted according to the X coordinate value of the bottom node, and also have contribution value attributes and left wing edge and right wing edge attributes. The contribution value is initialized based on the LMT root node. Each active edge has a corresponding polygon.

[0054] In some embodiments of the present application, whether a node in a scanning area participates in the calculation of a union is determined based on the contribution value and the relative position relationship of the intersecting active edges in the scanning area, including: initializing the contribution values ​​of the left-wing edges and the right-wing edges adjacent to the nodes in the local minimum table based on the contribution values ​​of the nodes in the local minimum table, so that the contribution values ​​of the left-wing edges and the right-wing edges are the same as the contribution values ​​of the nodes to which they correspond.

[0055] Traverse all LMTs, find the LMT root node that falls inside and on the bottom edge of the current scan line area (excluding the top edge of the scan line area), create two adjacent active edges based on the LMT root node and the left and right wing edges and initialize them. Assign the LMT contribution value 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 An example of active edge update in this application is shown. 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, whether a node in the scanning area participates 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 also includes: traversing all active edges in the scanning line area from left to right, if the current active edge and the adjacent active edge on the right have a non-vertex intersection in the scanning line area, then calculating the intersection coordinates and determining the type of the intersection; when the type of the intersection is a local minimum point, adding a node to be output from the intersection, and exchanging the positions of the two active edges in the active edge table, and inverting their respective contribution values, the active edge table including the active edges; when the type of the intersection is a local maximum point, merging the affiliated polygons of the intersecting active edges, and exchanging the positions of the two active edges in the active edge table, and inverting their respective contribution values; when the type of the intersection is a left center point, inserting the node to the left front end of the left active edge polygon, and exchanging the positions of the two active edges in the active edge table, and inverting their respective contribution values; when the type of the intersection is a right center point, inserting the node to the right front end of the right active edge polygon, and exchanging the positions of the two active edges in the active edge table, and inverting their respective contribution values.

[0057] This embodiment shows how to process the intersection of adjacent active edges. All active edges in the current scan line region are traversed from left to right, and if the current active edge and the adjacent active edge on the right have non-vertex intersections in the scan line region, the intersection coordinates are calculated. Figure 7 4 types of intersections are shown in this application. Figure 7 , the upper left intersection type is the local minimum point, the upper right intersection type is the local maximum point, the lower left intersection type is the left middle point, and the lower right intersection type is the right middle point. The specific processing methods for these intersection types are as follows.

[0058] Local minimum point (MN), such as Figure 7 The area inside the intersecting polygon shown in the upper left is the shaded range. In this case, the intersection point is the local minimum point. In this case, it is necessary to add a new node to be output from the intersection point, swap the positions of the two active edges in the AET, and invert their respective contribution values.

[0059] Local maximum point (MX), such as Figure 7 The upper right intersection point is the local maximum point. In this case, the subordinate 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 reversed. Figure 8 Shows Figure 7 How to deal with the MX situation.

[0060] The left middle point (LI), such as Figure 7 The intersection shown in the lower left corner is the middle point on the left side. In this case, the node needs to be inserted into the left front end of the left active edge polygon, and the positions of the two active edges in the AET are swapped, and their respective contribution values ​​are reversed.

[0061] The right middle point (RI), such as Figure 7 The intersection shown in the lower right corner is the middle point on the right side. In this case, the node needs to be inserted into the front end of the right side of the active edge polygon on the right side, and the positions of the two active edges in the AET are swapped, and their respective contribution values ​​are reversed.

[0062] In some embodiments of the present application, whether a node in a scanning area participates in the calculation of a union is determined based on the contribution value and the relative position relationship of the intersecting active edges in the scanning area, and also includes: traversing all active edge vertices that fall on the top of the scanning line area from left to right, and judging 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, and 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 a right center point, if the contribution value of the active edge is the second value, the vertex is ignored, and 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 a local maximum point, if the contribution value of the active edge is the second value, the vertex is ignored, and 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, and the active edge table includes active edges.

[0063] This embodiment shows how to handle nodes that fall on the top of the scan line. Traverse all active edge vertices that fall 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 method for these vertex types is as follows.

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

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

[0066] MX, in this case, two active edges of the same input polygon intersect. According to the transformation rule of active edge contribution values, their contribution values ​​should remain 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 implementation method.

[0067] In this embodiment, the reason why there is no MN is that what is processed here is not the intersection point, but the node of the polygon itself, so the MN is not included. That is, the MN point is already included in the LMT and will be processed in the next scan.

[0068] In summary, for each scan area, the intersection of the active edges and the quadrilateral nodes falling on the top edge of the scan area will be processed separately. In this way, all vertices of two polygons can be processed according to their contribution values ​​and relative position relationships 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. The polygon obtained by merging at the last MX in the last scan line area is recorded. If the two polygons input at the program entry intersect, the polygon is output. If the intersection of the two input polygons in the two-dimensional space is empty, the original two input polygons are returned.

[0070] for Figure 5 The calculation process is detailed in the table below.

[0071]

[0072] The steps to construct the above table are as follows.

[0073] Event 1, processes the LMT root node P1, creates polygon Poly1 (P1:P1), and assigns Poly1 to the active edge.

[0074] Event 2, processing LMT root node P5, P5 contribution value is FALSE, no operation is performed, skipped.

[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, processing intersection I1, the two intersecting active edges are both left-wing edges, intersection I1 is judged as LI, the positions of the active edges in AET are exchanged, and the contribution values ​​are reversed. 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 Poly1 is assigned to 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 processes the node P3 that falls on the top of the scan line. This node is MX, but because its attached active edges are all FALSE (that is, edge P3P4 and edge P3P2 are both FALSE), it is skipped.

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

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

[0082] In this application, unless otherwise expressly 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 number of related objects.

[0083] The terms "or" and "and / or" in this application are used to describe the relationship between associated objects, which represents non-exclusive inclusion. For example, "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. For another example, "A, B and / or C", "A, B or C" and "A, B and C" may 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 this application is used to represent the "or" relationship between the associated objects before and after. In this application, "at least one of A or B" and "one or more of A and B" have the same meaning as the above "A or B", and "one or more of A, B and C" and "at least one of A, B or C" have the same meaning as the above "A, B or C". "One or more of A, B and C" has the same meaning as "A, B or C" above.

[0084] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can 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, and the second polygon is used to represent a second area of ​​the printed circuit board; Building a local minimum table based on the first polygon and the second polygon, and determining contribution values ​​of nodes in the local minimum table, wherein the contribution values ​​are used to determine whether corresponding nodes participate in the calculation of the 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: The first polygon and the second polygon are located in the same plane rectangular coordinate system, and the method further includes: Determine whether there is a special edge parallel to the X-axis in the first polygon and the second polygon; If so, the polygon including the special edge is rotated so that all edges of the first polygon and the second polygon are not parallel to the X-axis.

3. 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.

4. The method for calculating the geometric union of a printed circuit board according to claim 1, 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.

5. The method for calculating the geometric union of a printed circuit board according to claim 4, 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.

6. The method for calculating the geometric union of a printed circuit board according to claim 4 or 5, 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.

7. The method for calculating the geometric union of a printed circuit board according to claim 4, 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.

8. The method for calculating the geometric union of a printed circuit board according to claim 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 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.

9. The method for calculating the geometric union of a printed circuit board according to claim 7 or 8, 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.

10. 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-9.

Citation Information

Patent Citations

  • Large-scale graph simplification method for polygon with arcs

    CN118133759A

  • Printed circuit board copper coating method based on large-scale polygon Boolean operation solution

    CN119358504A

  • Direct opencl graphics rendering

    US20130328884A1

  • Method and apparatus for edge-endpoint-based VLSI design rule checking

    US6324673B1

Cited By

  • Graph processing method and device based on graph independence, medium and simulation method

    CN122471983A