Filling method for filling non-self-intersecting polygons in FPGA (Field Programmable Gate Array)

By obtaining the Y -coordinating value of the polygon vertex in FPGA, calculating the intersection, sorting point and edges, and combining filling, solving the existing FPGA filling algorithm of sorting complexity and large resource consumption when processing non -intersecting polygon, large resource consumption, large resource consumption. Realize fast and efficient polygon filling.

CN119376190APending Publication Date: 2025-01-28ADVANCED DIGITAL SCREEN SYST INC
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411235550.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-04
Publication Date
2025-01-28

Smart Images

  • Figure CN119376190A_ABST
    Figure CN119376190A_ABST
Patent Text Reader

Abstract

The invention discloses a method for filling a non-self-intersecting polygon in an FPGA (Field Programmable Gate Array) in the technical field of FPGA data processing, which comprises the following steps of: a coordinate acquisition step: acquiring Y coordinate values of each vertex of the polygon, obtaining a maximum value point Ymax, a minimum value point Ymin and non-extreme points of the Y coordinate values of each vertex, and numbering each side of the polygon; and an intersection point calculation step: obtaining X coordinate values of intersection points of straight lines of Y = Ymin and each edge of the polygon, and recording the number of the intersection points and the serial numbers of the edges where the intersection points are located. The filling method for filling the non-self-intersecting polygons in the FPGA is reasonable in structural design. A simplified sorting method is adopted according to the change condition of the number of the intersection points, the sorting operation amount of the intersection points in the filling process is greatly reduced, and the filling speed is greatly increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of FPGA data processing, and in particular to a filling method for filling non-self-intersecting polygons in FPGA. Background Art

[0002] Laser direct imaging (LDI), also known as laser direct writing, is a technology developed in recent years for the production of semiconductor devices. The traditional exposure process is to transfer the image to the substrate by irradiating the film with a mercury lamp, while LDI uses a laser scanning method to directly image the image on the substrate through a pattern generator. Compared with traditional exposure technology, the LDI exposure process does not require film, which effectively reduces costs, and has a simple process and high image accuracy. It can adapt to more sophisticated graphic exposure and is also conducive to improving production yield;

[0003] Usually, the graphic data of semiconductor device design is vector data, including data in formats such as GDS II, Gerber, and ODB++, while the data required by the graphic generator in laser direct writing is data in bitmap format. Therefore, the vector data needs to be rasterized and converted into bitmap data. The processing speed of rasterized data directly affects the production capacity of the lithography machine. In order to improve the production capacity of the lithography machine, it is necessary to increase the rasterization speed for sorting; and the sorted points are combined and filled. The traditional rasterization processing method is that the host in the LDI system parses the graphic data, converts the graphic data into a graphic coordinate point program that is convenient for the lower computer to process, and then transmits it to the field programmable gate array (FPGA) to process and restore it into the bitmap data to be exposed. Among them, the processing of FPGA mainly involves two steps: sorting and filling. Among these two steps, sorting consumes the most logical resources and time. The speed of sorting directly affects the filling speed of the vector diagram and the price of the FPGA used. For the filling of non-self-intersecting polygons, the greatest difficulty is the calculation and sorting of the intersection points of the scan line and the polygon. How to simplify the sorting process is the key to the filling method;

[0004] The current FPGA-based filling algorithm can only achieve the filling of triangles and quadrilaterals. For the filling of non-self-intersecting polygons, in order to simplify the difficulty of FPGA filling, most solutions choose to triangulate or right-angle trapezoid the polygons by computer, which greatly increases the difficulty and amount of calculation for computer processing. There is an advanced algorithm that can achieve the filling of convex polygons. However, in the actual environment, most polygons are non-self-intersecting concave polygons. Therefore, the development of an FPGA-based filling algorithm for non-self-intersecting arbitrary polygons can not only simplify the calculation processing, but also make full use of the calculation efficiency of FPGA, greatly improving production efficiency.

[0005] In order to solve the shortcomings of existing FPGA filling algorithms, such as complex sorting, high resource consumption and long sorting time, and the inability of existing FPGA-based filling algorithms to directly fill concave polygons, a method for quickly filling arbitrary non-self-intersecting polygons in FPGA is provided. To this end, we proposed a filling method for filling non-self-intersecting polygons in FPGA. Summary of the invention

[0006] The object of the present invention is to provide a filling method for filling non-self-intersecting polygons in FPGA to solve the problems raised in the above background technology.

[0007] To achieve the above object, the present invention provides the following technical solution: a filling method for filling non-self-intersecting polygons in FPGA, comprising the following steps:

[0008] The coordinate acquisition step is to obtain the Y coordinate value of each vertex of the polygon, obtain the maximum value point Ymax, the minimum value point Ymin and the non-extreme value point of the Y coordinate value of each vertex, and number each side of the polygon;

[0009] The intersection calculation step is to obtain the X coordinate values ​​of the intersections of the straight line Y=Ymin and each edge of the polygon and record the number of intersections and the number of the edge where the intersection is located;

[0010] The intersection point sorting and edge sorting steps are to sort the X coordinate values ​​of the intersection points, and then sort the intersection points in the order of X values ​​from small to large, and sort the edges where the intersection points are located according to the order of intersection sorting, and record the order of the edge numbers after edge sorting;

[0011] In the step of combination filling, the sorted intersections are grouped into two groups, starting from the intersection with the smallest x value. Each intersection is not repeated in the group. The intersections in the same group are filled, and the remaining positions are not filled.

[0012] Conditional judgment step, let Y=Y+1, and judge whether Y is greater than Ymax;

[0013] If Y>Ymax, the filling process ends;

[0014] If Y is not greater than Ymax, return and execute the intersection calculation step, and then perform extreme point judgment. If there is no non-extreme point vertex in the intersection or there is a non-extreme point vertex in the intersection but the two edges of the vertex are on the same side of the current Y line, then execute the intersection sorting and edge sorting steps and subsequent steps until Y>Ymax ends the filling process;

[0015] If there is a non-extreme point vertex in the intersection and the two edges of the vertex are on both sides of the current Y line, the intersections are merged and the edges are replaced, and then the intersection sorting and edge sorting steps and subsequent steps are executed until the filling process ends when Y>Ymax.

[0016] Preferably, when Y>Ymin and Y≤Ymax, there is a simplification algorithm in the intersection ordering and edge ordering steps, and the simplification algorithm first compares the number of intersections between the current Y straight line and the polygon with the number of intersections recorded last time, and then executes a corresponding simplification algorithm according to the change in the number of intersections;

[0017] When the number of intersections is the same as the number of intersections recorded last time, and the last recorded intersection does not have an extreme point vertex, the order of the edges corresponding to the intersections is the order of this intersection sorting;

[0018] When the number of intersections is the same as the number of intersections recorded last time, and there is an extreme point vertex in the intersection recorded last time, the two edges of the extreme point vertex are sorted according to the sorting order of the corresponding intersections, and then the results of the sorting of the two edges are used as the whole to participate in the edge sorting;

[0019] When the number of intersections is greater than the number of intersections recorded last time, the intersections are sorted, and the result of the intersection sorting is used as the sorting result of the edges where the intersections are located, and the sorting result of the edges where the intersections are located is used as the overall edge sorting;

[0020] When the number of intersections is less than the number of intersections recorded last time, the edges corresponding to the reduced intersections are deleted from the edge sorting sequence, and the remaining edge sorting sequence remains unchanged. The result of the edge sorting is the sorting order of the corresponding intersections.

[0021] Preferably, when the number of intersections is the same as the number of intersections recorded last time, and there is an extreme point vertex in the intersection recorded last time, if the sorting result of the two edges of the extreme point vertex remains consistent with the sorting order of these two edges in the edge sorting result recorded last time, then there is no need to sort the edges, and the edge sorting result recorded last time is the edge sorting result this time.

[0022] Preferably, the method for merging intersections is: merging two intersections corresponding to vertices of non-extreme value points into one, and then sorting the intersections.

[0023] Preferably, the edge replacement method is: use the edge on the unfilled side of the current Y straight line among the two edges owned by the vertex of the non-extreme point to replace the edge on the filled side of the current Y straight line to participate in edge sorting.

[0024] Preferably, the filling method is applicable to non-self-intersecting polygons with any number of sides.

[0025] Compared with the prior art, the beneficial effects of the present invention are as follows: the filling method for filling non-self-intersecting polygons in FPGA has a simple filling process and a fast filling speed compared with the existing algorithm. In particular, the sorting processing algorithm in the filling method of the present invention adopts a simplified sorting method depending on the change in the number of intersections, which greatly reduces the amount of sorting operations of the intersections in the filling process and greatly improves the filling speed. In addition, the method of the present invention is not only suitable for filling in FPGA, but also suitable for filling in CPU, which can effectively reduce the time cost of CPU. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 A flow chart of a filling method for filling non-self-intersecting polygons in an FPGA according to the present invention;

[0027] Figure 2 A schematic diagram of the intersections of a number of Y straight lines and a polygon in the filling process of Example 1 of the present invention;

[0028] Figure 3 This is a combined filling schematic diagram of the filling process of Example 1 of the present invention. DETAILED DESCRIPTION

[0029] The present invention provides a technical solution: a filling method for filling non-self-intersecting polygons in FPGA, as shown in the attached Figure 1 As shown, the filling method of the present invention comprises the following steps:

[0030] (1) Coordinate acquisition step: obtain the Y coordinate value of each vertex of the polygon, obtain the maximum value point Ymax, minimum value point Ymin and non-extreme value point of the Y coordinate value of each vertex, and number each side of the polygon;

[0031] (2) Intersection calculation step: obtain the X coordinate values ​​of the intersections of the straight line Y=Ymin and each edge of the polygon and record the number of intersections and the number of the edge where the intersection is located;

[0032] (3) Intersection point sorting and edge sorting steps: Sort the X coordinate values ​​of the intersection points, and then sort the intersection points in the order of X values ​​from small to large, and sort the edges where the intersection points are located according to the order of intersection sorting, and record the order of the edge numbers after edge sorting;

[0033] (4) Combination filling step: starting from the intersection with the smallest x value, the sorted intersections are grouped into two groups. Each intersection is not repeated in the group. The space between two intersections in the same group is filled, and the remaining positions are not filled.

[0034] (5) Conditional judgment step: Let Y = Y + 1, and judge whether Y is greater than Ymax. If Y>Ymax, the filling process ends. If Y is not greater than Ymax, return and execute the intersection calculation step, and then perform extreme point judgment. If there is no non-extreme point vertex in the intersection or there is a non-extreme point vertex in the intersection but the two edges owned by the vertex are on the same side of the current Y line, then execute the intersection sorting and edge sorting steps and subsequent steps until the filling process ends when Y>Ymax. If there is a non-extreme point vertex in the intersection and the two edges owned by the vertex are on both sides of the current Y line, then merge the intersections and replace the edges, and then execute the intersection sorting and edge sorting steps and subsequent steps until the filling process ends when Y>Ymax.

[0035] Embodiment 1:

[0036] The present invention provides a technical solution: a filling method for filling non-self-intersecting polygons in FPGA, Figure 2 (a) is the polygon ABCDEFG to be filled in this embodiment, and the filling method process of this polygon is as follows:

[0037] (1) Coordinate acquisition: Get the maximum, minimum, and non-extreme value points of the Y coordinate values ​​of each vertex of polygon ABCDEFG. As shown in (a), point A is the minimum value point, that is, Y min =Y A ; Point F is the maximum point, that is, Y max =Y F , points B, C, D, E, and G are non-extreme points, and the sides of the polygon ABCDEFG are numbered as AB, BC, CD, DE, EF, FG, and GA;

[0038] (2) Intersection calculation, calculate Y = Y min =Y A The intersection of the straight line and the polygon ABCDEFG is as follows Figure 2 As shown in (b), the intersection points are X AG and X AB , the number of intersection points is 2, and the sides where the intersection points are located are AG and AB;

[0039] (3) Intersection sorting and edge sorting X AG and X AB The size of the value, so the intersection points are sorted in any order, comparing X AG =X AB That is, the order of edges is AG, AB, BC, CD, DE, EF, FG or AB, AG, BC, CD, DE, EF, FG;

[0040] (4) Combination filling: After sorting, the intersection points are grouped into two groups starting from the intersection point with the smallest X value. Each intersection point is not repeated in the group. The intersections in the same group are filled, and the remaining positions are not filled. Figure 3 As shown in (a), filling is performed between and;

[0041] (5) Perform conditional judgment and let Y = Y min +1, like Figure 2 (c) Return to the intersection calculation step and calculate the intersection of line Y1 and polygon ABCDEFG. The intersection points are X AG and X AB , the number of intersections is 2, and the edges where the intersections are located are AG and AB. There are no non-extreme points in the intersections, so the intersections and edges are sorted directly;

[0042] (6) Intersection point sorting and edge sorting (simplified calculation of Y1 to satisfy Y1>Y min And Y1<Y max Therefore, a simplified algorithm of intersection sorting and edge sorting can be used. By comparing the number of intersections between the current Y line and the polygon with the number of intersections recorded last time, the number of intersections remains unchanged, and the vertex of the extreme point exists in the intersection recorded last time;

[0043] Choose option 2, and sort the two sides AG and AB of the vertex of the previous extreme point from small to large according to the X coordinate value of the straight line and the intersection point.

[0044] First, two X AG and X AB Sort, X AG <X AB , then the sorting order of AG and AB is AG, AB;

[0045] If the result of the last edge sorting is AB, AG, BC, CD, DE, EF, FG, then the sorting order of AG and AB this time is inconsistent with the sorting order of AG and AB in the last recorded edge sorting result. Therefore, the sorting order of AG and AB in the last recorded edge sorting result is swapped to obtain the edge sorting result this time, i.e., AG, AB, BC, CD, DE, EF, FG. The result of the edge sorting is taken as the result of the intersection sorting, i.e., X AG , X AB ;

[0046] (7) Combination filling. Figure 3 As shown in (b), for X AG and X AB Fill in between;

[0047] (8) Make a conditional judgment Y=Y1+1 to determine whether the new straight line Y is consistent with Y max As long as Y < Ymax Then, return to the intersection calculation step, and then loop through steps (6) and (7) until the filling process ends.

[0048] The following further elaborates on some special Y-line positions during the filling process;

[0049] When Y = Y2, as shown in Figure 2 (d), there are 4 Ys, and the number of lines with Y < Y2 intersecting the polygon is two, and the number of lines with Y < Y2 intersecting the polygon is two. Calculate the intersections of the Y2 line with the polygon ABCDEFG. The intersections are X AG 、X AB 、X BC 、X CD . The corresponding sides where the intersections are located are X BC 、X CD Sort the X values in ascending order: X AG < X AB < X BC < X CD . The sorted order of the corresponding sides is AG, AB, BC, CD. Take them as a whole to participate in the edge sorting. The edge sorting result is AG, AB, BC, CD, DE, EF, FG;

[0050] During combined filling, do not fill between X AG and X AB and between X BC and X BC . The filling schematic diagram is as shown in Figure 3 (c);

[0051] As shown in Figure 2 (e), when Y = Y3, among the intersections of the Y3 line with the polygon ABCDEFG, there appears a non-extreme point vertex G, and the two sides AG and GF owned by this vertex G are on both sides of the current Y line. Therefore, perform intersection merging and edge replacement;

[0052] The method of intersection merging is: merge the two intersections X AG and X GF corresponding to the non-extreme point vertex G into X G , and then perform intersection sorting. The result of the intersection sorting X BC 、X EF 、X ED 、X CD is X G 、X AB ;

[0053] The edge replacement method is: use the two edges AG and GF of the vertex G of the non-extreme point on the unfilled side of the current Y line to replace the edge AG on the filled side of the current Y line to participate in edge sorting. The result of edge sorting is GF, AB, BC, EF, ED, CD;

[0054] When filling the combination, X AG / X GF and X AB and X EF Between and X ED and X CD Fill in between, X AB and X BC Between and X EF and X ED There is no filling between them. The filling diagram is as follows Figure 3 (d)

[0055] When Y=Y4, Figure 2 As shown in (f), the number of intersections between the line Y and the polygon ABCDEFG is reduced to 4, which are X GF , X EF , X ED , X CD , the edges corresponding to the reduced intersections are AB and BC. AB and BC are deleted from the edge sorting sequence GF, AB, BC, EF, ED, CD recorded last time. The result of this edge sorting is GF, EF, ED, and CD. The sorting order of the corresponding intersections is X GF , X EF , X ED , X CD ;

[0056] When filling the combination, X GF and X EF Between and X ED and X CD Fill in between and between the side X ED No filling, filling diagram as follows Figure 3 (e)

[0057] At that time, if Figure 2 As shown in (g), the number of intersections between the line Y and the polygon ABCDEFG is reduced to 2. At this time, the four intersections are X GF , X EF The edges corresponding to the reduced intersections are ED and CD. ED and CD are deleted from the last recorded edge sorting sequence GF, EF, ED and CD. The result of this edge sorting is GF, EF. The sorting order of the corresponding intersections is X. GF , X EF ;

[0058] When filling the combination, X GF and X EF Between, fill in Y=Y max The filling process is similar to that of Y=Y5, such as Figure 2 (h) and Figure 3 (g) as shown, Y = Y max After the filling is completed, the conditional judgment is performed, and Y=Y max +1, the new Y is greater than Y max , the filling process ends.

Claims

1. A method for filling non-self-intersecting polygons in an FPGA, characterized in that: The steps include: The coordinate acquisition step is to obtain the Y coordinate value of each vertex of the polygon, obtain the maximum value point Ymax, the minimum value point Ymin and the non-extreme value point of the Y coordinate value of each vertex, and number each side of the polygon; The intersection calculation step is to obtain the X coordinate values ​​of the intersections of the straight line Y=Ymin and each edge of the polygon and record the number of intersections and the number of the edge where the intersection is located; The intersection point sorting and edge sorting steps are to sort the X coordinate values ​​of the intersection points, and then sort the intersection points in the order of X values ​​from small to large, and sort the edges where the intersection points are located according to the order of intersection sorting, and record the order of the edge numbers after edge sorting; In the step of combination filling, the sorted intersections are grouped into two groups, starting from the intersection with the smallest x value. Each intersection is not repeated in the group. The intersections in the same group are filled, and the remaining positions are not filled. Conditional judgment step, let Y=Y+1, and judge whether Y is greater than Ymax; If Y>Ymax, the filling process ends; If Y is not greater than Ymax, return and execute the intersection calculation step, and then perform extreme point judgment. If there is no non-extreme point vertex in the intersection or there is a non-extreme point vertex in the intersection but the two edges of the vertex are on the same side of the current Y line, then execute the intersection sorting and edge sorting steps and subsequent steps until Y>Ymax ends the filling process; If there is a non-extreme point vertex in the intersection and the two edges of the vertex are on both sides of the current Y line, the intersections are merged and the edges are replaced, and then the intersection sorting and edge sorting steps and subsequent steps are executed until the filling process ends when Y>Ymax.

2. A method for filling non-self-intersecting polygons in FPGA according to claim 1, characterized in that: When Y>Ymin and Y≤Ymax, there is a simplified algorithm for the intersection sorting and edge sorting steps. The simplified algorithm first compares the number of intersections between the current Y line and the polygon with the number of intersections recorded last time, and then executes the corresponding simplified algorithm according to the change in the number of intersections; When the number of intersections is the same as the number of intersections recorded last time, and the last recorded intersection does not have any extreme point vertices, the order of the edges corresponding to the intersections is the order of this intersection sorting; When the number of intersections is the same as the number of intersections recorded last time, and there is an extreme point vertex in the intersection recorded last time, the two edges of the extreme point vertex are sorted according to the sorting order of the corresponding intersections, and then the results of the sorting of the two edges are used as the whole to participate in the edge sorting; When the number of intersections is greater than the number of intersections recorded last time, the intersections are sorted, and the result of the intersection sorting is used as the sorting result of the edges where the intersections are located, and the sorting result of the edges where the intersections are located is used as the overall edge sorting; When the number of intersections is less than the number of intersections recorded last time, the edges corresponding to the reduced intersections are deleted from the edge sorting sequence, and the remaining edge sorting sequence remains unchanged. The result of the edge sorting is the sorting order of the corresponding intersections.

3. A method for filling non-self-intersecting polygons in FPGA according to claim 2, characterized in that: When the number of intersections is the same as the number of intersections recorded last time, and there is an extreme point vertex in the intersection recorded last time, if the sorting result of the two edges of the extreme point vertex remains consistent with the sorting order of these two edges in the edge sorting result recorded last time, there is no need to sort the edges, and the edge sorting result recorded last time is the edge sorting result this time.

4. A method for filling non-self-intersecting polygons in FPGA according to claim 1, characterized in that: The method for merging intersection points is: merging two intersection points corresponding to vertices of non-extreme value points into one, and then sorting the intersection points.

5. The method for filling non-self-intersecting polygons in FPGA according to claim 1, characterized in that: The edge replacement method is: use the edge on the unfilled side of the current Y straight line among the two edges owned by the vertex of the non-extreme point to replace the edge on the filled side of the current Y straight line to participate in edge sorting.

6. A method for filling non-self-intersecting polygons in FPGA according to claim 1, characterized in that: The filling method is applicable to non-self-intersecting polygons with any number of sides.