Polygon cutting method and circuit pattern parallel cutting method
By constructing the initial edge link list and intersection link list of polygons, combined with the method of alternating jumps to generate closed paths, the problems of low cutting efficiency of polygons and difficulty in adapting special shapes in the prior art are solved, and rapid cutting and efficient processing of polygons are achieved.
Patent Information
- Application Number
- CN202510343692.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-22
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2045-03-22
AI Technical Summary
In the existing polygon cutting technology, rectangular cutting consumes significant computing resources when processing complex polygons or massive data, resulting in a decrease in processing efficiency and the inability to effectively handle special or non-rectangular shapes, which has problems such as cutting size deviation and increase in post-processing steps.
Provide a polygon cutting method. By obtaining each vertex information of the polygon, building an initial edge link list, setting cutting lines, obtaining intersection information, updating edge link list, choosing intersection points according to intersection attributes, building intersection list, traversing edge link list and intersection link list, and generating closed paths through alternating jumps to cut multiple sub-polygons.
Fast cutting of polygons is achieved, cutting the original polygon into closed sub-polygons, improving the efficiency of polygon cutting and overcoming the limitations of rectangular cutting in complex polygon processing and special shape adaptation.
Smart Images

Figure CN119849419A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of polygon cutting, and in particular to a polygon cutting method and a circuit pattern parallel cutting method. Background Art
[0002] In the electronic files of printed circuit boards (PCBs), some graphics of the circuit diagram are usually represented in the form of a combination of positive and negative graphics, which is equivalent to subtracting the part that overlaps with the negative graphic from the positive graphic, and the remaining part is the shape required by the circuit diagram. Since in actual circuit diagram design, the required graphics are often irregular polygons, the shapes of the designed positive and negative films are also irregular polygons accordingly. Therefore, it is necessary to design a corresponding polygon clipping method to obtain the difference set of the positive and negative graphics to obtain the desired graphics.
[0003] Among the existing polygon cutting technologies, rectangular cutting is a commonly used method. However, rectangular cutting has some disadvantages in practical applications: First, traditional rectangular cutting requires cutting each cell one by one, which requires a large amount of repeated calculations. Especially when processing complex polygons or massive data, the consumption of computing resources increases significantly, resulting in a decrease in overall processing efficiency. Secondly, the mechanical division of rectangular grids may cut polygons or textures multiple times, resulting in the need to read and process the same element repeatedly, increasing the burden of geometry and texture processing. When the number of polygons is large, it is easy to cause cache overflow, further reducing performance. In addition, for special or non-rectangular shapes, rectangular cutting needs to rely on the optimization of the circumscribed rectangle, which may cause deviations in the actual cutting size or add additional post-processing steps (such as trimming), affecting accuracy and efficiency. Therefore, rectangular cutting is efficient and easy to use in simple scenes, but it has obvious limitations in complex polygon processing, resource optimization, and special-shaped adaptation. Summary of the invention
[0004] In order to solve the above problems, the present invention provides a polygon cutting method and a circuit pattern parallel cutting method, which can improve the efficiency of polygon cutting.
[0005] As one of the above-mentioned purposes of the invention, the present invention provides a polygon cutting method, the method comprising: Obtaining each vertex information of the polygon and constructing an initial edge list of the polygon, wherein the vertex information at least includes coordinate information of the vertex; Set a cutting line, obtain the intersection information of the cutting line and all the edges of the polygon, add the intersection information to the corresponding initial edge chain table to obtain an updated edge chain table, wherein the intersection information includes the entry and exit point attributes and coordinate information of each intersection; According to the entry and exit point attributes of each intersection, the intersection points are selected and discarded to construct a polygon intersection list; The update edge list and the intersection list are traversed, and a closed path is generated by alternately jumping to cut and obtain a plurality of sub-polygons.
[0006] In a possible implementation of the present application, obtaining each vertex information of a polygon and constructing an initial edge list of the polygon include: The information of each vertex of the outer contour of the polygon and the information of each vertex of the inner hole are obtained, and the first initial edge chain list and the second initial edge chain list of the polygon are respectively constructed.
[0007] In a possible implementation manner of the present application, the first initial edge linked list stores information of each vertex of the outer contour in a clockwise direction; and the second initial edge linked list stores information of each vertex of the inner hole in a counterclockwise direction.
[0008] In a possible implementation of the present application, obtaining the intersection information of the cutting line and all the edges of the polygon, and adding the intersection information to the corresponding initial edge chain table to obtain an updated edge chain table includes: Obtaining the intersection information of the cutting line and all the edges of the outer contour of the polygon, and adding the intersection information to the first initial edge chain list according to the coordinate order of each intersection point to obtain a first updated edge chain list; The intersection information of the cutting line and all the edges of the inner hole of the polygon is obtained, and the intersection information is added to the second initial edge chain list according to the coordinate order of each intersection to obtain the second updated edge chain list.
[0009] In a possible implementation of the present application, each intersection is selected based on the entry and exit point attributes of each intersection, including: When two adjacent sides of a polygon are on the same side of the cutting line, the common intersection points of the two adjacent sides and the cutting line are discarded; When two adjacent sides of a polygon are on different sides of a cutting line, the common intersection points of the two adjacent sides with the cutting line are retained.
[0010] In a possible implementation of the present application, each intersection is selected based on the entry and exit point attributes of each intersection, including: When one of the two adjacent sides of a polygon coincides with the cutting line, the intersection point of the non-coincident side and the cutting line is replaced by the intersection point of the coincident side and the cutting line; When a coincident edge has multiple intersections with a cutting line, the intersection of the non-coincident edge and the cutting line is replaced by the last traversed intersection of the coincident edge.
[0011] In a possible implementation manner of the present application, a bisecting cutting line is set, and the bisecting cutting line cuts the polygon into a first sub-polygon and a second sub-polygon having similar areas; For the first sub-polygon, all intersection points are sorted in ascending order of horizontal coordinates or vertical coordinates and added to the intersection point linked list; For the second sub-polygon, all intersections are added to the intersection list after being arranged in descending order of the horizontal coordinate or the vertical coordinate, and the entry and exit point attributes of all intersections in the second sub-polygon are opposite to the entry and exit point attributes of the corresponding intersections in the first sub-polygon.
[0012] In a possible implementation of the present application, traversing the update edge list and the intersection list, generating a closed path by alternately jumping to cut and obtain multiple sub-polygons, includes: Find the intersection of the entry (exit) point attributes in the update edge chain list, and when traversing downward to the intersection of the entry (exit) point attributes, jump to the intersection in the intersection chain list and traverse in sequence. When traversing to the next intersection of the entry (exit) point attributes, return to the corresponding update edge chain list and continue traversing until traversing to the intersection of the initial entry (exit) point attributes.
[0013] Another aspect of the present application provides a circuit pattern parallel cutting method, comprising: N cutting lines are set, where N is a natural number greater than 2, the first cutting line and the Nth cutting line are respectively located at two ends of the circuit pattern, and every two adjacent cutting lines are set as a group of cutting lines to obtain N-1 groups of cutting lines; Acquire an initial circuit pattern, and cut the initial circuit pattern in sequence using two cutting lines in each group of cutting lines, so as to simultaneously obtain a sub-circuit pattern between the two cutting lines in each group of cutting lines; Each cutting line uses the polygonal cutting method described in any one of the above technical solutions to cut the circuit pattern.
[0014] Another aspect of the present application provides a circuit pattern parallel cutting method, comprising: Acquire an initial circuit pattern, and cut the initial circuit pattern into a first strip and a second strip using a first cutting line; M cutting lines are set for the first stripe to cut the first stripe into M+1 first sub-strips, and N cutting lines are set for the second stripe to cut the second stripe into N+1 second sub-strips, where the values of M and N may be the same or different; Each cutting line uses the polygonal cutting method described in any one of the above technical solutions to cut the circuit pattern.
[0015] The polygon cutting method of the present application can realize fast cutting of polygons and cut the original polygon into multiple closed sub-polygons. The polygon cutting method of the present application can realize fast cutting of polygons, and the polygon cutting method of the present application is combined with parallel cutting, which overcomes the problem that rectangular cutting cannot be combined with parallel cutting, and improves the processing efficiency of polygonal graphics. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1is a flow chart of a polygon cutting method shown in an exemplary embodiment of the present invention; Figure 2 is a polygonal schematic diagram showing an exemplary embodiment of the present invention; Figure 3 yes Figure 2 Schematic diagram of the intersection of the polygon and the cutting line; Figure 4 It is a schematic diagram of the intersection of two adjacent sides of the polygon on the same side of the cutting line; Figure 5 It is a schematic diagram of the intersection of two adjacent sides of the polygon on different sides of the cutting line; Figure 6 A schematic diagram of the intersection point where one of the two adjacent sides of the polygon coincides with the cutting line; Figure 7 A schematic diagram of cutting a front polygon and cutting into a closed first sub-polygon and a second sub-polygon; Figure 8 A flow chart of a circuit pattern parallel cutting method shown in an exemplary embodiment of the present invention; Fig. 9 A schematic diagram of cutting an initial circuit pattern by a first set of cutting lines; Fig.10 A schematic diagram of cutting the initial circuit pattern for the second set of cutting lines; Fig.11 is a schematic diagram of a circuit diagram after parallel cutting shown in an exemplary embodiment of the present invention; Fig.12 A flow chart of a circuit pattern parallel cutting method shown in another exemplary embodiment of the present invention; Fig.13 FIG. 4 is a schematic diagram of a circuit diagram after parallel cutting, showing another exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0017] In order to facilitate the understanding of the present invention, the present invention will be described more comprehensively below in conjunction with the specific embodiments. Preferred embodiments of the present invention are provided in the specific embodiments. However, the present invention can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present invention more thorough and comprehensive.
[0018] The words "optionally" and the like in the present invention refer to embodiments of the present invention that can provide certain beneficial effects in certain circumstances. However, other embodiments may also be optional under the same circumstances or other circumstances. In addition, the statement of one or more optional embodiments does not imply that other embodiments are not available, nor is it intended to exclude other embodiments from the scope of the present invention.
[0019] Figure 1 1 is a flowchart of a polygon cutting method according to an exemplary embodiment. The method can be applied to an electronic device or a polygon processing device connected to or located inside the electronic device. The following describes the method by taking the method applied to the electronic device as an example. Figure 1 As shown, the polygon cutting method comprises the following steps: S10, obtaining each vertex information of the polygon and constructing an initial edge list of the polygon, wherein the vertex information at least includes coordinate information of the vertex; The vertices of the polygon are the inflection points of the polygon. There can be multiple initial edge lists of the polygon.
[0020] In a specific embodiment, the polygon includes an outer contour and an inner hole. As a possible implementation method, the electronic device traverses the outer contour and the inner hole of the polygon to be processed to obtain vertex information of each vertex of the polygon to be processed. Step S10 specifically includes: The information of each vertex of the outer contour of the polygon and the information of each vertex of the inner hole are obtained, and the first initial edge chain list and the second initial edge chain list of the polygon are respectively constructed.
[0021] The following is a specific example to illustrate the method of constructing an edge link list. Figure 2 is a polygonal schematic diagram of a specific embodiment, such as Figure 2 As shown, the polygon includes an outer contour ABCD and an inner hole EFG. Each vertex information of the outer contour of the polygon is obtained, and the coordinate information of the four vertices of the outer contour is obtained: A (4, 2), B (4, 10), C (12, 10), D (12, 2). Each vertex information of the inner hole of the polygon is obtained, and the coordinate information of the three points of the inner hole is obtained: E (6, 4), F (10, 4), G (8, 8). After obtaining each vertex information of the outer contour and the inner hole, the corresponding initial edge chain lists are constructed respectively. The initial edge chain list stores each vertex information in sequence. In this embodiment, the initial edge chain list ELL includes two edge chain lists: a first initial edge chain list el1 and a second initial edge chain list el2. The first initial edge chain list stores each vertex information of the outer contour in a clockwise direction; the second initial edge chain list stores each vertex information of the inner hole in a counterclockwise direction. Among them, the first initial edge chain table el1: A->B->C->D, el1 contains the coordinate information of four points: A(4,2), B(4,10), C(12,10), D(12,2). The second initial edge chain table el2: E->F->G, el2 contains the coordinate information of three points: E (6,4), F(10,4), G(8,8).
[0022] S20, setting a cutting line, obtaining intersection information of the cutting line and all edges of the polygon, adding the intersection information to the corresponding initial edge chain table to obtain an updated edge chain table, wherein the intersection information includes entry and exit point attributes and coordinate information of each intersection; In some embodiments, the cutting line may be a line parallel to the x-axis in the coordinate system, or a line parallel to the y-axis in the coordinate system. The number of cutting lines may be one or more, which is adjusted according to the needs.
[0023] As a possible implementation method, the electronic device traverses all intersections of the cutting line with the outer contour and inner hole of the polygon to be processed to obtain the coordinate information of each intersection of the polygon to be processed. The entry and exit point attributes of each intersection point refer to whether each intersection point is an exit point or an entry point. Figure 2 It can be seen that each edge of the polygon has directionality, so each intersection point is determined to be an exit point or an entry point according to a pre-set rule. For example, the intersection point of the edge from left to right and the cutting line is set as the entry point, and the intersection point of the edge from right to left and the cutting line is set as the exit point. It can be understood that the setting of the entry and exit point determination rules is not limited to this.
[0024] In a specific embodiment, after setting the cutting line, step S20 includes: Obtaining the intersection information of the cutting line and all the edges of the outer contour of the polygon, and adding the intersection information to the first initial edge chain list according to the coordinate order of each intersection point to obtain a first updated edge chain list; The intersection information of the cutting line and all the edges of the inner hole of the polygon is obtained, and the intersection information is added to the second initial edge chain list according to the coordinate order of each intersection to obtain the second updated edge chain list.
[0025] like Figure 3 As shown, in one embodiment, the number of cutting lines is one, and the cutting line is a bisecting cutting line, which can be understood as cutting the polygon into a first sub-polygon and a second sub-polygon with similar areas. Specifically, the bisecting cutting line is selected as a line parallel to the y-axis in the coordinate system, and the horizontal coordinate x of the cutting line is 8. The edges intersecting with the cutting line in the outer contour of the polygon include: BC and DA, and there is an intersection point I1 between the vertex B and the vertex C of the outer contour of the polygon, and there is an intersection point I4 between the vertex D and the vertex A of the outer contour of the polygon, and the coordinate information of the intersection points are: I1 (8, 10) and I4 (8, 2), respectively. The edges intersecting with the cutting line in the inner hole of the polygon include: EF, FG and GE, and there is an intersection point I3 between the vertex E and the vertex F of the inner hole of the polygon, and there is a common intersection point I2 between the vertex F and the vertex G of the inner hole of the polygon, and between the vertex G and the vertex E of the inner hole of the polygon, and the coordinate information of the intersection points are: I3 (8, 4) and I2 (8, 8).
[0026] In this embodiment, the intersection of the edge from left to right and the cutting line is set as the entry point, and the intersection of the edge from right to left and the cutting line is set as the exit point. The entry and exit point attributes of the intersection of the polygon outer contour are determined by the defined rules, I1 is the entry point, I4 is the exit point, and according to the coordinate sequence of each intersection, the entry and exit point attributes and coordinate information of the intersections I1 and I4 are added to the first initial edge chain table to obtain the first updated edge chain table E11: A->B-> I1 (in)->C->D-> I4 (out).
[0027] Furthermore, at the intersection points of the inner hole of the polygon, the coordinate information of the intersection points are: I3 is the entry point, and I2 is the exit point. According to the coordinate order of each intersection point, the entry and exit point attributes and coordinate information of the intersection points I3 and I2 are added to the second initial edge link list to obtain the second updated edge link list El2: E->I3(in)->F-> I2(out) / G.
[0028] S30. Select and discard intersection points according to the entry and exit point attributes of each intersection point, and construct a polygon intersection list.
[0029] It should be noted that, for an intersection point that intersects the cutting line once, the intersection point has only one entry and exit point attribute, and the intersection point is retained and added to the intersection point linked list.
[0030] When two adjacent sides of a polygon have a common intersection with the cutting line, the method of selecting each intersection according to the entry and exit point attributes of each intersection in step S30 includes: When two adjacent sides of a polygon are on the same side of the cutting line, the common intersection points of the two adjacent sides with the cutting line are discarded.
[0031] When two adjacent sides of a polygon are on different sides of a cutting line, the common intersection points of the two adjacent sides with the cutting line are retained.
[0032] The following example illustrates the selection method. Figure 4 As shown in Figure a, the two adjacent sides l1 and l2 of the polygon are on the same side of the cutting line, pt2 is the common intersection of side l1 and side l2, when pt2 is the intersection of side l1 and cutting line y, the intersection attribute is an exit point, when pt2 is the intersection of side l2 and cutting line y, the intersection entry and exit point attributes are entry points, pt2 is an endpoint, which is both an exit point and an entry point, then the intersection is discarded and not added to the intersection linked list. Figure 4 As shown in Figure b, the intersection point pt2 of edge l1 and cutting line y is the entry point attribute, and the intersection point pt2 of edge l2 and cutting line y is the exit point attribute. If pt2 is both the exit point and the entry point, the intersection point will be discarded and not added to the intersection list.
[0033] like Figure 5As shown in Figure a, the two adjacent sides l1 and l2 of the polygon are located on different sides of the cutting line. Pt2 is the common intersection of the sides l1 and l2. When Pt2 is the intersection of the side l1 and the cutting line y, the entry and exit point attributes of the intersection are entry points. When Pt2 is the intersection of the side l2 and the cutting line y, the entry and exit point attributes of the intersection are entry points. Pt2 is both an endpoint and has entry point attributes as an intersection twice. Therefore, only the entry point attribute is retained once and it is added to the intersection list. Figure 5 As shown in Figure b, when pt2 is the intersection point of edge l1 and cutting line y, the entry and exit point attributes of the intersection point are exit points. When pt2 is the intersection point of edge l2 and cutting line y, the entry and exit point attributes of the intersection point are exit points. Pt2 is both an endpoint and has exit point attributes as an intersection point twice. Therefore, only retain the exit point attribute once and add it to the intersection list.
[0034] Furthermore, in step S30, selecting and rejecting intersections according to the entry and exit point attributes of each intersection also includes the following method: When one of the two adjacent sides of a polygon coincides with a cutting line, the intersection point of the non-coincident side and the cutting line is replaced by the intersection point of the coincident side and the cutting line.
[0035] It should be noted that the coincident edge and the cutting line may have one intersection point or multiple intersection points. When the coincident edge and the cutting line have multiple intersection points, the intersection point between the non-coincident edge and the cutting line is replaced by the last intersection point when the coincident edge is traversed.
[0036] like Figure 6 As shown, for two adjacent sides l1 and l2 of the polygon, the intersection point of the cutting line y and the side l1 is pt2, and the cutting line y passes through the side l2 of the polygon, and the intersection point of the cutting line y and the side l2 is pt2, pt 3、 pt 4、 pt5, pt5 replaces pt2 to enter the intersection list, and the entry and exit point attributes remain unchanged.
[0037] In step S30, after each intersection point is selected, each intersection point is sorted in the intersection point linked list in ascending or descending order according to the coordinate information.
[0038] S40, traversing the updated edge list and the intersection list, generating a closed path by alternately jumping to cut and obtain a plurality of sub-polygons.
[0039] In some embodiments, the intersection of the entry (exit) point attributes is found in the update edge linked list, and when the intersection of the entry (exit) point attributes is traversed downward in sequence, the link is jumped to the intersection in the intersection linked list and traversed in sequence. When the next intersection of the entry (exit) point attributes is traversed, the link is returned to the corresponding update edge linked list and the traversal is continued until the initial intersection of the entry (exit) point attributes is traversed.
[0040] by Figure 3Taking the figure shown in the figure as an example, steps S30-S40 are specifically described. The bisecting cutting line cuts the polygon into a first sub-polygon and a second sub-polygon with similar areas. Specifically, the first sub-polygon is Figure 3 The first sub-polygon is the sub-polygon on the right in the figure, and the second sub-polygon is the sub-polygon on the left in the figure.
[0041] The first updated edge list of the first sub-polygon is El1: A->B-> I1(in)->C->D-> I4(out), and the second updated edge list of the first sub-polygon is El2: E-> I3(in)-> F-> I2(out) / G. For the first sub-polygon, all intersections are sorted in ascending order of the horizontal coordinate or the vertical coordinate and enter the intersection list. In this embodiment, the horizontal coordinates of all intersections are the same, and the intersection list of the first sub-polygon is sorted in ascending order of the vertical coordinate: I4(out)-> I3(in)-> I2(out)-> I1(in). In this embodiment, traversal starts from the intersection of the in-point attribute, but it can be understood that in other embodiments, traversal can be started from the intersection of the out-point attribute. Find the intersection of the entry point attributes in the first update edge list, that is, start from I1 and traverse downward in the first update edge list, and get I1 (in) -> C -> D -> I4 (out), I4 is the out point, jump to the direct intersection list to continue traversing, and get I4 (out) -> I3 (in), I3 is the entry point, jump to the second update edge list to continue traversing, and get I3 (in) -> F -> I2 (out), I2 is the out point, jump to the intersection list to continue traversing, and get I2 (out) -> I1 (in). At this time, traverse to the initial entry point I1, and the traversal ends. The first sub-polygon is: I1 -> C -> D -> I4 -> I3 -> F -> I2 -> I1, and the closed first sub-polygon is obtained.
[0042] For the second sub-polygon, all intersections are sorted in descending order of horizontal or vertical coordinates and then enter the intersection list, and the entry and exit point attributes of all intersections in the second sub-polygon are opposite to those of the corresponding intersections in the first sub-polygon. Figure 3For example, the first updated edge list El1 of the second sub-polygon is: A->B-> I1(out)->C->D-> I4(in), and the second updated edge list El2 of the second sub-polygon is: E-> I3(out)->F-> I2(in) / G. For the second sub-polygon, all intersections are sorted in ascending order of the horizontal coordinate or the vertical coordinate and enter the intersection list. In this embodiment, the horizontal coordinates of all intersections are the same, and all intersections of the second sub-polygon are sorted in descending order of the vertical coordinate and enter the intersection list: I1(out)-> I2(in)-> I3(out)->I4(in). Find the intersection of the entry point attributes in the first update edge list, that is, start from I4 and traverse downward in the first update edge list, I4 (in) -> A -> B -> I1 (out), I1 is the out point, jump to the intersection list to continue traversing, and get I1 (out) -> I2 (in), I2 is the entry point, jump to the second update edge list to continue traversing, and get I2 (in) -> E > I3 (out), I3 is the out point, jump to the intersection list to continue traversing, and get I3 (out) -> I4 (in). At this time, traverse to the initial entry point I4, and the traversal of the second sub-polygon ends. The second sub-polygon is: I4-> A -> B -> I1-> I2-> E > I3-> I4, and a closed second sub-polygon is obtained.
[0043] The polygon cutting method of the present application is implemented by executing steps S10-S40, such as Figure 7 As shown, it is possible to quickly cut polygons, cutting the original polygon into closed first sub-polygons and second sub-polygons, thereby improving the processing efficiency of polygonal graphics. In addition, the polygon cutting method of the present application is applicable to complex polygon situations, thereby solving the problems of slow rectangular cutting efficiency and inability to process complex polygons in the prior art.
[0044] The present invention further provides a circuit pattern parallel cutting method, wherein the circuit pattern may be a graphic image file stored in an electronic file of a printed circuit board (PCB), such as Figure 8 As shown, in a specific embodiment, the circuit pattern parallel cutting method specifically includes the following steps: S100, setting N cutting lines, where N is a natural number greater than 2, and the first cutting line and the Nth cutting line are respectively located at two ends of the circuit pattern, and setting every two adjacent cutting lines as a group of cutting lines to obtain N-1 groups of cutting lines; In a specific embodiment, Fig.11As shown, the circuit diagram is represented by ABCD, and N=10 is set, that is, ten cutting lines are set, the first cutting line coincides with the AB side, the tenth cutting line coincides with the CD side, and every two adjacent cutting lines are set as a group of cutting lines, and a total of nine groups of cutting lines are obtained. The first group of cutting lines includes the first cutting line 1 and the second cutting line 2, the second group of cutting lines includes the second cutting line 2 and the third cutting line 3, the third group of cutting lines includes the third cutting line 3 and the fourth cutting line 4, and so on. The ninth group of cutting lines includes the ninth cutting line 9 and the tenth cutting line 10.
[0045] S200, obtaining an initial circuit pattern, and cutting the initial circuit pattern in sequence by two cutting lines in each group of cutting lines, so as to simultaneously obtain a sub-circuit pattern between the two cutting lines in each group of cutting lines.
[0046] In a specific embodiment, two cutting lines in each group of cutting lines cut the initial circuit pattern in sequence, specifically comprising the following steps: like Fig. 9 As shown, the first cutting line 1 in the first group of cutting lines is used to cut the initial circuit pattern ABCD. Since the first cutting line 1 coincides with the AB edge, the circuit pattern obtained after cutting is still ABCD. Then the second cutting line 2 in the first group of cutting lines is used to cut the circuit pattern ABCD cut by the first cutting line again, thereby obtaining the sub-circuit pattern ABMN between the first cutting line 1 and the second cutting line 2, which will be simplified as p1 later. While the first group of cutting lines is cutting, as shown in FIG. Fig.10 As shown, the second cutting line 2 in the second group of cutting lines cuts the initial circuit pattern ABCD, and then the third cutting line 3 in the second group of cutting lines cuts the circuit pattern NMCD cut by the second cutting line 2 again, obtaining the sub-strip NMOP between the second cutting line 2 and the third cutting line 3, which will be simplified as p2 later. It can be understood that while the first group of cutting lines and the second group of cutting lines cut the initial circuit pattern, the third group of cutting lines to the N-1th group of cutting lines also cut the initial circuit pattern in the above manner. This allows the initial circuit pattern to be cut into nine sub-circuit patterns at the same time, as shown in FIG. Fig.11 As shown, i.e., p1, p2, p3, p4, p5, p6, p7, p8, and p9, parallel cutting of the circuit pattern is realized.
[0047] In step S200, each cutting line uses the polygonal cutting method described above to cut the circuit graphic. The present application uses the polygonal cutting method to achieve fast polygon cutting, and cuts the circuit graphic in parallel through multiple groups of cutting lines to obtain N-1 sub-circuit graphics at the same time, thereby achieving the purpose of accelerating the cutting of the circuit graphic.
[0048] In another embodiment of the present invention, Fig.12 As shown, the circuit pattern parallel cutting method comprises the following steps: S100', obtaining an initial circuit pattern, and cutting the initial circuit pattern into a first strip and a second strip using a first cutting line; S200', set M cutting lines for the first stripe to cut the first stripe into M+1 first sub-strips, and set N cutting lines for the second stripe to cut the second stripe into N+1 second sub-strips, where the values of M and N may be the same or different.
[0049] In the above steps, each cutting line uses the polygon cutting method described above to cut the graphics. The present application uses the polygon cutting method to achieve fast polygon cutting, and cuts the circuit graphics in parallel through multiple groups of cutting lines to obtain N sub-circuit graphics at the same time, thereby achieving the purpose of accelerating the cutting of circuit graphics.
[0050] In a specific implementation of the present invention, Fig.13 As shown, an initial circuit pattern ABCD is obtained, and the initial circuit pattern is cut into a first strip d1 and a second strip d2 using a first cutting line 1. In this embodiment, M and N are both set to 3, and three cutting lines (2, 3, 4) are set for the first strip to cut the first strip d1 into four first sub-strips. Meanwhile, three cutting lines (5, 6, 7) are set for the second strip to cut the second strip d2 into four second sub-strips, thereby accelerating the cutting speed of the initial circuit pattern.
[0051] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical solution concept of the present invention within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A polygon cutting method, characterized in that: The method comprises: Obtaining each vertex information of the polygon and constructing an initial edge list of the polygon, wherein the vertex information at least includes coordinate information of the vertex; Set a cutting line, obtain the intersection information of the cutting line and all the edges of the polygon, add the intersection information to the corresponding initial edge chain table to obtain an updated edge chain table, wherein the intersection information includes the entry and exit point attributes and coordinate information of each intersection; According to the entry and exit point attributes of each intersection, the intersection points are selected and discarded to construct a polygon intersection list; The update edge list and the intersection list are traversed, and a closed path is generated by alternately jumping to cut and obtain a plurality of sub-polygons.
2. The polygon cutting method according to claim 1, characterized in that: Get the information of each vertex of the polygon and build the initial edge list of the polygon, including: The information of each vertex of the outer contour of the polygon and the information of each vertex of the inner hole are obtained, and the first initial edge chain list and the second initial edge chain list of the polygon are respectively constructed.
3. The polygon cutting method according to claim 2, characterized in that: The first initial edge chain list stores information about each vertex of the outer contour in a clockwise direction; the second initial edge chain list stores information about each vertex of the inner hole in a counterclockwise direction.
4. The polygon cutting method according to claim 2, characterized in that: Get the intersection information of the cutting line and all the edges of the polygon, and add the intersection information to the corresponding initial edge list to obtain the updated edge list, including: Obtaining the intersection information of the cutting line and all the edges of the outer contour of the polygon, and adding the intersection information to the first initial edge chain list according to the coordinate order of each intersection point to obtain a first updated edge chain list; The intersection information of the cutting line and all the edges of the inner hole of the polygon is obtained, and the intersection information is added to the second initial edge chain list according to the coordinate order of each intersection to obtain the second updated edge chain list.
5. The polygon cutting method according to claim 1, characterized in that: The intersections are selected based on the entry and exit attributes of each intersection, including: When two adjacent sides of a polygon are on the same side of the cutting line, the common intersection points of the two adjacent sides and the cutting line are discarded; When two adjacent sides of a polygon are on different sides of a cutting line, the common intersection points of the two adjacent sides with the cutting line are retained.
6. The polygon cutting method according to claim 1, characterized in that: Each intersection is selected based on its entry and exit attributes, including: When one of the two adjacent sides of a polygon coincides with the cutting line, the intersection point of the non-coincident side and the cutting line is replaced by the intersection point of the coincident side and the cutting line; When a coincident edge has multiple intersections with a cutting line, the intersection of the non-coincident edge and the cutting line is replaced by the last traversed intersection of the coincident edge.
7. The polygon cutting method according to claim 1, characterized in that: Set a bisecting cutting line, which cuts the polygon into a first sub-polygon and a second sub-polygon with similar areas; For the first sub-polygon, all intersection points are sorted in ascending order of horizontal coordinates or vertical coordinates and added to the intersection point linked list; For the second sub-polygon, all intersections are added to the intersection list after being arranged in descending order of the horizontal coordinate or the vertical coordinate, and the entry and exit point attributes of all intersections in the second sub-polygon are opposite to the entry and exit point attributes of the corresponding intersections in the first sub-polygon.
8. The polygon cutting method according to claim 1, characterized in that: Traversing the update edge list and the intersection list, generating a closed path by alternately jumping to cut and obtain multiple sub-polygons, including: Find the intersection of the entry (exit) point attributes in the update edge chain list, and when traversing downward to the intersection of the entry (exit) point attributes, jump to the intersection in the intersection chain list and traverse in sequence. When traversing to the next intersection of the entry (exit) point attributes, return to the corresponding update edge chain list and continue traversing until traversing to the intersection of the initial entry (exit) point attributes.
9. A circuit pattern parallel cutting method, characterized in that: include: N cutting lines are set, where N is a natural number greater than 2, the first cutting line and the Nth cutting line are respectively located at two ends of the circuit pattern, and every two adjacent cutting lines are set as a group of cutting lines to obtain N-1 groups of cutting lines; Acquire an initial circuit pattern, and cut the initial circuit pattern in sequence using two cutting lines in each group of cutting lines, so as to simultaneously obtain a sub-circuit pattern between the two cutting lines in each group of cutting lines; Each cutting line cuts the circuit pattern using the polygonal cutting method described in any one of claims 1 to 8.
10. A circuit pattern parallel cutting method, characterized in that: include: Acquire an initial circuit pattern, and cut the initial circuit pattern into a first strip and a second strip using a first cutting line; M cutting lines are set for the first stripe to cut the first stripe into M+1 first sub-strips, and N cutting lines are set for the second stripe to cut the second stripe into N+1 second sub-strips, where the values of M and N may be the same or different; Each cutting line cuts the circuit pattern using the polygonal cutting method described in any one of claims 1 to 8.
Citation Information
Patent Citations
Polygon clipping method based on intersection point sorting
CN102360507A
Image processing method and device
CN105513008A