PCB-based copper skin decomposition method and device

By setting cutting lines in the CAM file to decompose complex polygons into simpler polygons, the problem of machines being unable to recognize complex polygons in existing technologies is solved, simplifying the PCB manufacturing process.

CN114912402BActive Publication Date: 2026-01-23SHENZHEN PARTNER INFORMATION TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210645259.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-08
Publication Date
2026-01-23
Estimated Expiration
2042-06-08

AI Technical Summary

Technical Problem

Existing technologies cannot identify and process complex polygonal copper foil, making machine recognition difficult in PCB manufacturing.

Method used

The method of decomposing complex polygons into simple polygons includes setting cutting lines through holes, decomposing copper sheets in CAM files into polygons without holes, and building a hash table to record the position data of cutting line segments.

Benefits of technology

This technology enables machines to recognize complex polygons, simplifies the PCB circuit board film production process, and improves production efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114912402B_ABST
    Figure CN114912402B_ABST
Patent Text Reader

Abstract

The application provides a PCB-based copper skin decomposition method and device, comprising: decomposing the in-hole copper skin in the CAM file into a pattern with only islands; traversing all polygons in the pattern to determine whether there is an in-hole, if yes, selecting a polygon with an in-hole and marking the polygon as a current polygon; setting a cutting line passing through the in-hole to decompose the current polygon into two new polygons; and after there is no in-hole in all polygons, inserting all polygons into the pattern. The application has the beneficial effect that: by setting a cutting line passing through the in-hole in the CAM file, decomposing the two-dimensional pattern in the CAM file into a plurality of polygons without in-holes, and then inserting the plurality of polygons without in-holes back into the CAM file, the machine can recognize the complex polygon, and the production of the PCB film is more convenient and smooth.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of printed circuit board manufacturing technology, and in particular to a method and apparatus for copper foil decomposition based on PCB. Background Technology

[0002] After CAM production, the copper sheet exists as a complex polygon (containing multiple islands and holes), and common machines on the market cannot directly recognize such complex polygons.

[0003] In fact, there is no difference between copper foil with complex polygons and copper foil with simple polygons in PCB applications; both are used for current conduction. The main difference lies in their geometric meaning, as follows:

[0004] 1. Complex polygons contain at least one internal opening;

[0005] 2. Simple polygons do not contain internal openings and are represented by only a continuous outline.

[0006] 3. The PCB manufacturing standards RS-274d, Excellon, and RS-274x cannot support polygons with internal holes.

[0007] A method is needed to enable machines to recognize complex polygons. Summary of the Invention

[0008] The technical problem to be solved by the present invention is to provide a PCB-based copper foil decomposition method and apparatus that can decompose complex polygons into simple polygons and enable machines to recognize complex polygons, in order to address the shortcomings of the prior art.

[0009] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a copper foil decomposition method based on PCB, comprising:

[0010] S1. Decompose the copper foil with internal holes in the CAM file into graphics containing only islands;

[0011] S2. Traverse all polygons in the graphic and determine whether there is an inner hole. If yes, proceed to step S3; otherwise, proceed to step S6.

[0012] S3. Select a polygon with an internal hole and mark it as the current polygon;

[0013] S4. Set a cutting line through the inner hole to decompose the current polygon into two new polygons;

[0014] S5. Return to step S2;

[0015] S6. Insert all polygons into the drawing.

[0016] Furthermore, in step S4, the step of setting the cutting line through the inner hole specifically includes:

[0017] S401. Mark the leftmost inner hole in the current polygon as the current hole;

[0018] S402. Draw the first ray of the current tunnel to the left side of the curve on the left edge of the current tunnel;

[0019] S403. Record the left intersection point of the first ray of the current hole and the outer contour of the current polygon, and the left cutting line segment between the left intersection point of the current hole and the outer contour of the current polygon.

[0020] S404. Draw the second ray of the current tunnel to the right side of the current tunnel, following the curve of the right edge of the current tunnel.

[0021] S405. Determine whether the second ray of the current hole passes through other holes. If yes, proceed to step S406; otherwise, proceed to step S410.

[0022] S406. Mark the other holes closest to the current hole as nearby holes;

[0023] S407. Record the intersection point of the second ray of the current tunnel and the curve of the left edge of the adjacent tunnel;

[0024] S408, Draw a cutting line segment to connect the current hole and the adjacent hole;

[0025] S409. Mark the adjacent hole as the current hole and return to step S404;

[0026] S410. Adjust the position of the curve of the second ray of the current hole on the right edge of the current hole, and determine whether the second ray of the current hole passes through other holes. If yes, return to step S406; otherwise, proceed to step S411.

[0027] S411. Record the right intersection point of the second ray of the current hole and the outer contour of the current polygon, and the right cutting line segment between the right intersection point of the current hole and the outer contour of the current polygon.

[0028] S412. Decompose the current polygon into two new polygons and return to step S2.

[0029] Furthermore, between steps S403 and S404, the following steps are also included:

[0030] S4031. Determine whether the intersection point of the first ray of the current hole and the left side of the outer contour of the current polygon is close to the endpoint of the left curve of the outer contour. If yes, proceed to step S4032; otherwise, proceed to step S404.

[0031] S4032. Adjust the exit point position of the first ray of the current hole according to the endpoint of the outer contour curve, so that the intersection point of the first ray of the current hole and the left side of the outer contour of the current polygon is close to the endpoint of the left side curve of the outer contour, and proceed to step S404.

[0032] Furthermore, between steps S407 and S408, the following steps are also included:

[0033] S4071. Determine whether the intersection point is close to the endpoint of the curve on the left edge of the adjacent hole. If yes, proceed to step S4072; otherwise, proceed to step S408.

[0034] S4072. Adjust the exit point position of the second ray of the current hole according to the endpoint of the curve of the left edge of the adjacent hole, so that the intersection point of the second ray of the current hole and the curve of the left edge of the adjacent hole is close to the endpoint of the curve of the left edge of the adjacent hole, and proceed to step S408.

[0035] Furthermore, between steps S411 and S412, the following is also included:

[0036] S4111. Determine whether the intersection point of the second ray of the current hole and the right side of the outer contour of the current polygon is close to the endpoint of the right curve of the outer contour of the current polygon. If yes, proceed to step S4112; otherwise, proceed to step S412.

[0037] S4112. Draw a reverse ray to the left from the endpoint of the right curve of the current polygon's outer contour;

[0038] S4113. Determine whether the reverse ray passes through the undivided inner cavity. If yes, proceed to step S4114; otherwise, proceed to step S4117.

[0039] S4114. Mark the undivided inner cavity as the current cavity;

[0040] S4115. Draw a reverse ray from the curve of the left edge of the current hole to the left side of the current hole;

[0041] S4116. Determine whether the reverse ray of the current hole passes through the undivided inner hole. If yes, return to step S4114; otherwise, proceed to step S4117.

[0042] S4117. Record the left intersection point of the reverse ray of the current hole and the outer contour of the current polygon, and the left cutting line segment between the left intersection point of the current hole and the outer contour of the current polygon, and proceed to step S412.

[0043] Furthermore, step S412 also includes:

[0044] S4121. Starting from the right dividing line segment, construct the outer contour of the current polygon counterclockwise.

[0045] S4122, Traverse all the inner caves;

[0046] S4123. Determine whether the undivided inner hole belongs to the current polygon. If yes, proceed to step S4124; otherwise, return to step S4122.

[0047] S4124. Set this inner hole as the inner hole of the current polygon.

[0048] Furthermore, step S2 also includes creating hash tables for the outer contour of the graphic and for the inner holes in the graphic.

[0049] Furthermore, step S408 also includes marking the position data of the cutting line segments connecting the current hole and the adjacent holes in the hash table.

[0050] This invention also relates to a PCB-based copper foil decomposition device, comprising a conversion module, a traversal module, a judgment module, a marking module, a segmentation module, and an insertion module.

[0051] The conversion module is used to decompose the copper foil with internal holes in the CAM file into a graphic with only islands;

[0052] The traversal module is used to traverse all polygons in the graphic and find polygons with internal holes;

[0053] The judgment module is used to determine whether there is an internal hole in the polygon;

[0054] The marking module is used to select a polygon with an internal hole and mark that polygon as the current polygon;

[0055] The segmentation module is used to set the cutting line through the inner hole, decomposing the current polygon into two new polygons;

[0056] The insertion module is used to insert all polygons into the drawing.

[0057] Furthermore, the marking module is also used to establish hash tables for the outer contour of the graphic and for the inner holes in the graphic, as well as the position data of the cutting line segments connecting the current hole and the adjacent holes.

[0058] The beneficial effects of this invention are as follows: by setting cutting lines through the inner hole in the CAM file, the CAM file is decomposed into multiple polygons without inner holes, and then the multiple polygons without inner holes are inserted back into the original CAM file, which enables the machine to recognize complex polygons and makes the production of PCB circuit board films more convenient and smooth. Attached Figure Description

[0059] The specific process and structure of the present invention are described in detail below with reference to the accompanying drawings:

[0060] Figure 1 This is a schematic diagram of the overall process of the PCB-based copper foil decomposition method of the present invention;

[0061] Figure 2 This is a flowchart illustrating the step of setting the cutting line through the inner hole in the present invention.

[0062] Figure 3 This is a schematic diagram of the process for setting up a reverse ray according to the present invention;

[0063] Figure 4 This is a schematic diagram illustrating the process of constructing the outer contour according to the present invention;

[0064] Figure 5 This is a schematic diagram of the structure of the graphic of the present invention;

[0065] Figure 6 This is a schematic diagram of the graphic decomposition process of the present invention;

[0066] Figure 7 This is a schematic diagram of the decomposed structure of the graphic in this invention after being decomposed into multiple polygons;

[0067] 1-Graphic shape; 11-First polygon; 12-Second polygon; 121-Fourth polygon; 122-Fifth polygon; 13-Third polygon;

[0068] 21-First Inner Cave; 22-Second Inner Cave; 23-Third Inner Cave; 24-Fourth Inner Cave;

[0069] 31 - First ray of the current hole; 32 - Cutting segment; 33 - Ray;

[0070] 41 - Reverse ray; 42 - Reverse ray of the current hole. Detailed Implementation

[0071] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.

[0072] In the description of this invention, it should be understood that the terms "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," "outer," "clockwise," and "counterclockwise," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0073] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more features. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0074] In this invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," and "fixing," etc., should be interpreted broadly. For example, they can refer to a connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0075] In this invention, unless otherwise explicitly specified and limited, "above" or "below" the second feature can include direct contact between the first and second features, or contact between the first and second features through another feature between them. Furthermore, "above," "over," and "on top" of the second feature includes the first feature directly above or diagonally above the second feature, or simply indicates that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature includes the first feature directly below or diagonally below the second feature, or simply indicates that the first feature is at a lower horizontal level than the second feature.

[0076] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. The illustrative expressions of the above terms in this specification should not be construed as necessarily referring to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. In addition, those skilled in the art can combine and integrate the different embodiments or examples described in this specification.

[0077] Example 1

[0078] Please see Figures 1 to 4 A method for copper foil decomposition based on PCB, comprising:

[0079] S1. Decompose the copper surface with internal holes in the CAM file into copper surface graphics with only islands (hereinafter referred to as graphics);

[0080] The copper foil with internal holes in the CAM file is separated to form a graphic consisting only of islands. The graphic includes the outer contour of the graphic and the contour of all internal holes.

[0081] S2. Traverse all polygons in the graphic and determine whether there is an inner hole. If yes, proceed to step S3; otherwise, proceed to step S6.

[0082] The initial shape can be regarded as a polygon with several internal holes. The polygons formed by the segmented shape may have missing internal holes. It is necessary to traverse the segmented polygons to avoid missing internal holes.

[0083] S3. Select a polygon with an internal hole and mark it as the current polygon;

[0084] To facilitate polygon segmentation and avoid confusion, polygons with internal holes should be marked as the current polygons, and polygon segmentation should be performed on the currently marked polygons.

[0085] S4. Set a cutting line through the inner hole to decompose the current polygon into two new polygons;

[0086] With one endpoint of the polygon as the origin, the horizontal direction of the polygon is the X-axis, and the vertical direction of the polygon is the Y-axis. The X-axis is negative when it is along the left and positive when it is along the right. The Y-axis is negative when it is along the top and positive when it is along the bottom.

[0087] A cutting line is set along the X-axis of the polygon, passing through an inner hole, thus dividing the current polygon in two to form two new polygons without inner holes. The cutting line can pass through multiple inner holes along the X-axis.

[0088] S5. Return to step S2;

[0089] Since the polygon has more than one internal hole, it is necessary to re-evaluate whether there are any missed internal holes in the polygon.

[0090] S6. Insert all polygons into the drawing.

[0091] Once all the inner holes in the polygons have been cut out, all the segmented polygons can be inserted into the graphic for the machine to recognize and create film data.

[0092] As can be seen from the above description, the beneficial effects of the present invention are as follows: by setting cutting lines through the inner hole in the CAM file, the CAM file is decomposed into multiple polygons without inner holes, and then the multiple polygons without inner holes are inserted back into the original CAM file, which enables the machine to recognize complex polygons and makes the production of PCB circuit board film more convenient and smooth.

[0093] Example 2

[0094] Based on Example 1, step S4, specifically including the step of setting the cutting line through the inner hole, includes:

[0095] S401. Mark the leftmost inner hole in the current polygon as the current hole;

[0096] To facilitate the handling of internal openings and avoid confusion, the leftmost internal opening in the polygon is marked as the current opening, and all rays passing through the internal opening are processed for the current opening.

[0097] S402. Draw the first ray of the current tunnel to the left side of the curve on the left edge of the current tunnel;

[0098] To avoid cutting the current hole from the middle of the left edge curve, preferably, the convex point of the left edge curve of the current hole is used as the starting point of the ray. A first ray of the current hole is drawn from the convex point of the left edge curve of the current hole in the negative direction of the X-axis, wherein the first ray of the current hole is parallel to the X-axis.

[0099] S403. Record the left intersection point of the first ray of the current hole and the outer contour of the current polygon, and the left cutting line segment between the left intersection point of the current hole and the outer contour of the current polygon.

[0100] Since the selected inner hole is the leftmost inner hole, the first ray of the current hole will intersect with the left side of the outer contour of the current polygon. The ray segment between the intersection point of the first ray of the current hole and the left side of the outer contour of the current polygon and the convex point of the curve on the left edge of the current hole is the left cutting line segment. Record the position parameters of this intersection point and the left cutting line segment.

[0101] S404. Draw the second ray of the current tunnel to the right side of the current tunnel, following the curve of the right edge of the current tunnel.

[0102] To avoid cutting the current hole from the middle of the right edge curve, preferably, the convex point of the right edge curve of the current hole is used as the starting point of the ray. A second ray of the current hole is drawn from the convex point of the right edge curve of the current hole in the positive direction of the X-axis, wherein the second ray of the current hole is parallel to the X-axis.

[0103] S405. Determine whether the second ray of the current hole passes through other holes. If yes, proceed to step S406; otherwise, proceed to step S410.

[0104] S406. Mark the other holes closest to the current hole as nearby holes;

[0105] To facilitate the handling of internal caves and avoid confusion, other caves that are closest to the current cave and whose second ray passes through it are marked as neighboring caves.

[0106] S407. Record the intersection point of the second ray of the current tunnel and the curve of the left edge of the adjacent tunnel;

[0107] Record the position parameters of the intersection points.

[0108] S408, Draw a cutting line segment to connect the current hole and the adjacent hole;

[0109] Draw a cutting line segment along the second ray of the front tunnel to the current tunnel and the adjacent tunnel, and record the position parameters of the cutting line segment.

[0110] S409. Mark the adjacent hole as the current hole and return to step S404;

[0111] Change the selected target and use the newly found hole as the current hole for further processing.

[0112] S410. Adjust the position of the curve of the second ray of the current hole on the right edge of the current hole, and determine whether the second ray of the current hole passes through other holes. If yes, return to step S406; otherwise, proceed to step S411.

[0113] To avoid overlooking other inner caves to the right of the current cave, adjust the curve position of the second ray of the current cave at the right edge of the current cave, that is, move the exit point of the second ray of the current cave along the Y-axis direction to find whether there are other inner caves within the range to the right of the curve of the right edge of the current cave in the Y-axis direction.

[0114] S411. Record the right intersection point of the second ray of the current hole and the outer contour of the current polygon, and the right cutting line segment between the right intersection point of the current hole and the outer contour of the current polygon.

[0115] If no other inner cave is found when moving along the Y-axis direction of the curve on the right edge of the current cave to the exit point of the second ray of the current cave, it can be determined that there are no other inner caves on the right side of the curve on the right edge of the current cave within the Y-axis range. At this time, the second ray of the current cave will intersect with the right side of the outer contour of the current polygon. The ray segment between the intersection point of the second ray of the current cave and the right side of the outer contour of the current polygon and the curve on the right edge of the current cave is the right cutting line segment. Record the position parameters of this intersection point and the right cutting line segment.

[0116] S412. Decompose the current polygon into two new polygons and return to step S2.

[0117] Decompose the current polygon into two new polygons along the cutting line segment on the left, the cutting line between the inner holes, and the cutting line segment on the right. Then iterate through the two newly generated polygons, checking whether the two newly generated polygons still have inner holes. Continue until all polygons no longer have inner holes.

[0118] Example 3

[0119] Based on Example 2, between steps S403 and S404, the following is also included:

[0120] S4031. Determine whether the intersection point of the first ray of the current hole and the left side of the outer contour of the current polygon is close to the endpoint of the left curve of the outer contour. If yes, proceed to step S4032; otherwise, proceed to step S404.

[0121] To avoid cutting the inner hole from the middle of the curve and reduce the complexity of the polygon, a better segmentation effect can be achieved when the intersection point of the first ray of the current hole and the left side of the outer contour of the current polygon is close to the endpoint of the left side curve of the outer contour.

[0122] Suppose that the first ray of the current hole can move a distance A1 along the Y-axis on the curve of the left edge of the current hole. At this time, the distance along the Y-axis between the intersection point of the first ray of the current hole with the left side of the outer contour of the current polygon and the endpoint of the left curve of the outer contour is A2. When A1≥A2, it is determined that the intersection point of the first ray of the current hole with the left side of the outer contour of the current polygon is close to the endpoint of the left curve of the outer contour, and the exit point of the first ray of the current hole can be moved. When A1<A2, it is determined that the intersection point of the first ray of the current hole with the left side of the outer contour of the current polygon is not close to the endpoint of the left curve of the outer contour, and the exit point of the first ray of the current hole does not need to be moved.

[0123] S4032. Adjust the exit point position of the first ray of the current hole according to the endpoint of the outer contour curve, so that the intersection point of the first ray of the current hole and the left side of the outer contour of the current polygon is close to the endpoint of the left side curve of the outer contour, and proceed to step S404.

[0124] Adjust the position of the exit point of the first ray of the current hole on the curve of the left edge of the current hole along the Y-axis, so that the intersection point of the first ray of the current hole and the left side of the outer contour of the current polygon is close to the endpoint of the left side curve of the outer contour.

[0125] Example 4

[0126] Based on Example 3, between steps S407 and S408, the following is also included:

[0127] S4071. Determine whether the intersection point is close to the endpoint of the curve on the left edge of the adjacent hole. If yes, proceed to step S4072; otherwise, proceed to step S408.

[0128] To avoid cutting the inner hole from the middle of the curve and reduce the complexity of the polygon, a better segmentation effect can be achieved when the intersection point of the second ray of the front hole and the curve of the left edge of the adjacent hole is close to the endpoint of the curve of the left edge of the adjacent hole.

[0129] Assume that the second ray of the current hole can move a distance B1 along the Y-axis on the curve of the right edge of the current hole. At this time, the distance B between the intersection point of the second ray of the current hole with the curve of the left edge of the adjacent hole and the endpoint of the curve of the left edge of the adjacent hole along the Y-axis is: when B1≥B2, it is determined that the intersection point of the second ray of the current hole with the curve of the left edge of the adjacent hole is close to the endpoint of the curve of the left edge of the adjacent hole, and the exit point of the second ray of the current hole can be moved; when B1<B2, it is determined that the intersection point of the second ray of the current hole with the curve of the left edge of the adjacent hole is not close to the endpoint of the curve of the left edge of the adjacent hole, and the exit point of the second ray of the current hole does not need to be moved.

[0130] S4072. Adjust the exit point position of the second ray of the current hole according to the endpoint of the curve of the left edge of the adjacent hole, so that the intersection point of the second ray of the current hole and the curve of the left edge of the adjacent hole is close to the endpoint of the curve of the left edge of the adjacent hole, and proceed to step S408.

[0131] Adjust the position of the exit point of the second ray of the current hole on the curve of the right edge of the current hole along the Y-axis, so that the intersection point of the second ray of the current hole and the curve of the left edge of the adjacent hole is close to the endpoint of the curve of the left edge of the adjacent hole.

[0132] Example 5

[0133] Based on Example 4, between steps S411 and S412, the following is also included:

[0134] S4111. Determine whether the intersection point of the second ray of the current hole and the right side of the outer contour of the current polygon is close to the endpoint of the right curve of the outer contour of the current polygon. If yes, proceed to step S4112; otherwise, proceed to step S412.

[0135] To avoid cutting the inner hole from the middle of the curve, reduce the complexity of the polygon, and ensure segmentation efficiency, a better segmentation effect can be achieved when the intersection point of the second ray of the current hole and the right side of the outer contour of the current polygon is close to the endpoint of the right curve of the outer contour.

[0136] Assume that the second ray of the current hole can move a distance C1 along the Y-axis on the curve of the right edge of the current hole. At this time, the distance along the Y-axis between the intersection point of the second ray of the current hole with the right side of the outer contour of the current polygon and the endpoint of the right curve of the outer contour is C2. When C1≥C2, it is determined that the intersection point of the second ray of the current hole with the right side of the outer contour of the current polygon is close to the endpoint of the right curve of the outer contour, and the exit point of the second ray of the current hole can be moved. When C1<C2, it is determined that the intersection point of the second ray of the current hole with the right side of the outer contour of the current polygon is not close to the endpoint of the right curve of the outer contour, and the exit point of the second ray of the current hole does not need to be moved.

[0137] S4112. Draw a reverse ray to the left from the endpoint of the right curve of the current polygon's outer contour;

[0138] To prevent missing internal openings and to ensure segmentation efficiency, a reverse ray is drawn from the endpoint of the right curve of the current polygon's outer contour to the left.

[0139] S4113. Determine whether the reverse ray passes through the undivided inner cavity. If yes, proceed to step S4114; otherwise, proceed to step S4117.

[0140] S4114. Mark the undivided inner cavity as the current cavity;

[0141] To facilitate the handling of internal cavities and avoid confusion, the nearest undivided internal cavity traversed by the reverse ray is marked as the current cavity. A cutting line segment is then drawn along the reverse ray between the point of origin of the reverse ray and the curve of the right edge of the undivided internal cavity, and the positional parameters of this cutting line segment are recorded.

[0142] S4115. Draw a reverse ray from the curve of the left edge of the current hole to the left side of the current hole;

[0143] Continue to trace a ray in the opposite direction to the left of the current cave to search for other undivided inner caves.

[0144] S4116. Determine whether the reverse ray of the current hole passes through the undivided inner hole. If yes, return to step S4114; otherwise, proceed to step S4117.

[0145] S4117. Record the left-side cutting line segment between the intersection point of the current hole's reverse ray and the left side of the current polygon's outer contour, and the intersection point of the current hole and the left side of the current polygon's outer contour. Proceed to step S412.

[0146] If no other undivided inner holes can be found to the left of the curve on the left edge of the current hole, it can be determined that there are no other undivided inner holes to the left of the left edge of the current hole. At this time, the reverse ray of the current hole will intersect with the left side of the outer contour of the current polygon. The ray segment between the intersection point of the reverse ray of the current hole and the left side of the outer contour of the current polygon and the curve on the left edge of the current hole is the left cutting line segment. Record the position parameters of this intersection point and the left cutting line segment.

[0147] Similarly, the reverse ray from the current hole may also pass through the cut inner hole. In this case, the curve of the right edge of the cut inner hole can be regarded as the left side of the outer contour of a polygon. The ray segment between the reverse ray from the current hole and the curve of the right edge of the cut inner hole is the left cutting segment.

[0148] Example 6

[0149] Based on Example 5, step S412 further includes:

[0150] S4121. Starting from the right dividing line segment, construct the outer contour of the current polygon counterclockwise.

[0151] Starting from the right dividing line segment, construct the outer contour of the current polygon counterclockwise, that is, start constructing a new polygon from the left dividing line, the dividing line segment between the inner hole, and above the right dividing line.

[0152] S4122, Traverse all the inner caves;

[0153] Traverse all inner caves and find undivided inner caves.

[0154] S4123. Determine whether the undivided inner hole belongs to the current polygon. If yes, proceed to step S4124; otherwise, return to step S4122.

[0155] Determine whether the undivided inner hole belongs to the current polygon based on the location information of the undivided inner hole and the outer contour data of the current polygon.

[0156] S4124. Set this inner hole as the inner hole of the current polygon.

[0157] If the undivided inner hole belongs to the current polygon, then the inner hole is set as an inner hole of the current polygon, awaiting the next segmentation process.

[0158] Example 7

[0159] Based on Example 6, step S2 further includes establishing hash tables for the outer contour of the graphic and the inner holes in the graphic.

[0160] In this embodiment, to facilitate the management and recording of the position data of the outer contour and the inner holes of the graphic, it is necessary to establish a hash table for the outer contour of the graphic and for the inner holes in the graphic. The hash table includes the position data of the outer contour and the position data of the inner holes.

[0161] Example 8

[0162] Based on embodiment 7, step S408 further includes marking the position data of the cutting line segments connecting the current hole and the adjacent holes in the hash table.

[0163] In this embodiment, in order to construct the outer contour of the current polygon, it is necessary to record the position data of the cutting line segments connecting the inner holes.

[0164] Similarly, the position data of the left and right cutting line segments that intersect with the current polygon's outer contour also need to be recorded in the hash table.

[0165] Example 9

[0166] This invention also relates to a PCB-based copper foil decomposition device, comprising a conversion module, a traversal module, a judgment module, a marking module, a segmentation module, and an insertion module.

[0167] The conversion module is used to decompose the copper foil with internal holes in the CAM file into copper surface graphics with only islands (hereinafter referred to as graphics);

[0168] The conversion module separates the copper foil with internal holes from the CAM file, forming a graphic containing only islands. The graphic includes the outer contour of the graphic and the contours of all internal holes.

[0169] The traversal module is used to traverse all polygons in the graphic and find polygons with internal holes;

[0170] The initial shape can be regarded as a polygon with several internal holes. The polygons formed by the segmented shape may have missing internal holes. The traversal module needs to traverse the segmented polygons to avoid missing internal holes.

[0171] The judgment module is used to determine whether there is an internal hole in the polygon;

[0172] The judgment module can compare the location data of the inner hole with the outer contour data of the polygon to determine whether there is an inner hole in the polygon.

[0173] The marking module is used to select a polygon with an internal hole and mark that polygon as the current polygon;

[0174] To facilitate polygon segmentation and avoid confusion, polygons with internal holes should be marked as the current polygons, and polygon segmentation should be performed on the currently marked polygons.

[0175] The segmentation module is used to set the cutting line through the inner hole, decomposing the current polygon into two new polygons;

[0176] With one endpoint of the polygon as the origin, the horizontal direction of the polygon is the X-axis, and the vertical direction of the polygon is the Y-axis. The X-axis is negative when it is along the left and positive when it is along the right. The Y-axis is negative when it is along the top and positive when it is along the bottom.

[0177] A cutting line is set along the X-axis of the polygon, passing through an inner hole, thus dividing the current polygon in two to form two new polygons without inner holes. The cutting line can pass through multiple inner holes along the X-axis.

[0178] Specifically, the segmentation module decomposes the current polygon into two new polygons along the left cutting line segment, the cutting line between the inner holes, and the right cutting line segment. The traversal module then traverses the two newly generated polygons, checking whether the two newly generated polygons still have inner holes. This continues until all polygons no longer have inner holes.

[0179] The insertion module is used to insert all polygons into the drawing.

[0180] Once all the inner holes in the polygons have been cut out, all the segmented polygons can be inserted into the graphic for the machine to recognize and create film data.

[0181] The marking module includes a recording unit, which is used to establish a hash table for the outer contour of the graphic and the inner holes in the graphic, as well as the position data of the cutting line segments connecting the current hole and the adjacent holes.

[0182] To facilitate the management and recording of the location data of the outer contour and inner holes of a graphic, the recording unit of the marking module needs to establish hash tables for the outer contour and inner holes of the graphic. The hash tables include the location data of the outer contour and the location data of the inner holes.

[0183] In order to construct the outer contour of the current polygon, the recording unit of the marking module needs to record the position data of the cutting line segments connecting the inner holes.

[0184] Similarly, the position data of the left and right cutting line segments that intersect with the current polygon's outer contour also need to be recorded in the hash table by the recording unit of the marking module.

[0185] Furthermore, the marking module is also used to mark the leftmost inner hole in the current polygon as the current hole;

[0186] To facilitate the handling of internal openings and avoid confusion, the marking module marks the leftmost internal opening in the polygon as the current opening, and all rays passing through the internal opening are processed for the current opening.

[0187] The segmentation module is also used to draw the first ray of the current hole to the left side of the current hole on the curve of the left edge of the current hole;

[0188] To avoid cutting the current hole from the middle of the left edge curve, preferably, the segmentation module uses the convex point of the left edge curve of the current hole as the starting point of the ray. A first ray of the current hole is drawn from the convex point of the left edge curve of the current hole in the negative X-axis direction, wherein the first ray of the current hole is parallel to the X-axis.

[0189] The recording unit of the marking module is also used to record the left intersection point of the first ray of the current hole and the outer contour of the current polygon, as well as the left cutting line segment between the left intersection point of the current hole and the outer contour of the current polygon.

[0190] Since the marking module selects the leftmost inner hole, the first ray of the current hole will intersect with the left side of the outer contour of the current polygon. The ray segment between the intersection point of the first ray of the current hole and the left side of the outer contour of the current polygon and the convex point of the curve on the left edge of the current hole is the left cutting line segment. The recording unit records the position parameters of this intersection point and the left cutting line segment.

[0191] The segmentation module is also used to draw a second ray of the current hole to the right side of the current hole using the curve of the right edge of the current hole;

[0192] To avoid cutting the current hole from the middle of the right edge curve, preferably, the segmentation module uses the convex point of the right edge curve of the current hole as the starting point of the ray. A second ray of the current hole is drawn from the convex point of the right edge curve of the current hole in the positive direction of the X-axis, wherein the second ray of the current hole is parallel to the X-axis.

[0193] The judgment module is also used to determine whether the second ray of the current hole passes through other holes;

[0194] The marking module is also used to mark other holes closest to the current hole as neighboring holes;

[0195] To facilitate the handling of internal holes and avoid confusion, the marking module marks the other holes closest to the current hole that the second ray passes through as neighboring holes.

[0196] The recording unit of the marking module is also used to record the intersection point of the second ray of the current hole and the curve of the left edge of the adjacent hole, and to record the position parameters of the intersection point.

[0197] The segmentation module is also used to cut line segments to connect the current hole with adjacent holes;

[0198] The segmentation module draws cutting lines along the second ray of the front tunnel to the current tunnel and adjacent tunnels, and the recording unit records the position parameters of the cutting lines.

[0199] After the cutting line segment connects the current hole and the adjacent hole, the marking module is also used to mark the adjacent hole as the current hole; change the selected target, and use the newly found other hole as the current hole for subsequent processing.

[0200] The segmentation module is also used to adjust the position of the curve of the second ray of the current hole on the right edge of the current hole; then the judgment module determines whether the second ray of the current hole passes through other holes;

[0201] To avoid missing other inner caves to the right of the current cave, the segmentation module adjusts the curve position of the second ray of the current cave at the right edge of the current cave, that is, moves the exit point of the second ray of the current cave along the Y-axis to find whether there are other inner caves within the range to the right of the curve of the right edge of the current cave in the Y-axis direction.

[0202] The recording unit is also used to record the right intersection point of the second ray of the current hole and the outer contour of the current polygon, as well as the right cutting line segment between the right intersection point of the current hole and the outer contour of the current polygon.

[0203] If no other inner cave is found when moving along the Y-axis direction of the curve on the right edge of the current cave to the exit point of the second ray of the current cave, the recording unit can determine that there are no other inner caves on the right side of the curve on the right edge of the current cave within the Y-axis range. At this time, the second ray of the current cave will intersect with the right side of the outer contour of the current polygon. The ray segment between the intersection point of the second ray of the current cave and the right side of the outer contour of the current polygon and the curve on the right edge of the current cave is the right cutting line segment. The recording unit records the position parameters of this intersection point and the right cutting line segment.

[0204] Furthermore, the judgment module is also used to determine whether the intersection point of the first ray of the current hole and the left side of the outer contour of the current polygon is close to the endpoint of the left curve of the outer contour.

[0205] To avoid cutting the inner hole from the middle of the curve and reduce the complexity of the polygon, a better segmentation effect can be achieved when the intersection point of the first ray of the current hole and the left side of the outer contour of the current polygon is close to the endpoint of the left side curve of the outer contour.

[0206] The segmentation module is also used to adjust the exit point position of the first ray of the current hole according to the endpoint of the outer contour curve, so that the intersection point of the first ray of the current hole and the left side of the outer contour of the current polygon is close to the endpoint of the left side curve of the outer contour.

[0207] The segmentation module adjusts the position of the exit point of the first ray of the current hole on the curve of the left edge of the current hole along the Y-axis, so that the intersection point of the first ray of the current hole and the left side of the outer contour of the current polygon is close to the endpoint of the left side curve of the outer contour.

[0208] Furthermore, the judgment module is also used to determine whether the intersection point is close to the endpoint of the curve on the left edge of the adjacent hole;

[0209] To avoid cutting the inner hole from the middle of the curve and reduce the complexity of the polygon, a better segmentation effect can be achieved when the intersection point of the second ray of the front hole and the curve of the left edge of the adjacent hole is close to the endpoint of the curve of the left edge of the adjacent hole.

[0210] The segmentation module is also used to adjust the exit point position of the second ray of the current hole according to the endpoint of the curve of the left edge of the adjacent hole, so that the intersection point of the second ray of the current hole and the curve of the left edge of the adjacent hole is close to the endpoint of the curve of the left edge of the adjacent hole.

[0211] The segmentation module adjusts the position of the exit point of the second ray of the current hole on the curve of the right edge of the current hole along the Y-axis, so that the intersection point of the second ray of the current hole and the curve of the left edge of the adjacent hole is close to the endpoint of the curve of the left edge of the adjacent hole.

[0212] Furthermore, the judgment module is also used to determine whether the intersection point of the second ray of the current hole and the right side of the outer contour of the current polygon is close to the endpoint of the right curve of the outer contour of the current polygon.

[0213] To avoid cutting the inner hole from the middle of the curve and reduce the complexity of the polygon, a better segmentation effect can be achieved when the intersection point of the second ray of the current hole and the right side of the outer contour of the current polygon is close to the endpoint of the right side curve of the outer contour.

[0214] The segmentation module is also used to draw a reverse ray to the left from the endpoint of the right curve of the outer contour of the current polygon; in order to prevent missing inner holes and to ensure segmentation efficiency, the segmentation module draws a reverse ray to the left from the endpoint of the right curve of the outer contour of the current polygon.

[0215] The judgment module is also used to determine whether the reverse ray passes through an undivided inner cavity;

[0216] The marking module is also used to mark the undivided inner cavity as the current cavity;

[0217] To facilitate the handling of internal openings and avoid confusion, the marking module marks the nearest undivided internal opening traversed by the reverse ray as the current opening. The segmentation module draws a cutting line segment along the reverse ray between the intersection point of the reverse ray emission point and the curve of the right edge of the undivided internal opening, and records the position parameters of the cutting line segment through the recording unit.

[0218] The segmentation module is also used to draw a reverse ray from the curve of the left edge of the current hole to the left side of the current hole; and to continue drawing a reverse ray from the left side of the current hole to find other unsegmented inner holes.

[0219] The judgment module is also used to determine whether the current hole reverse ray passes through an undivided inner hole;

[0220] The recording unit of the marking module is also used to record the left intersection point of the current hole's reverse ray and the outer contour of the current polygon, as well as the left cutting line segment between the left intersection point of the current hole and the outer contour of the current polygon.

[0221] If no other undivided inner holes can be found to the left of the curve on the left edge of the current hole, it can be determined that there are no other undivided inner holes to the left of the left edge of the current hole. At this time, the reverse ray of the current hole will intersect with the left side of the outer contour of the current polygon. The ray segment between the intersection point of the reverse ray of the current hole and the left side of the outer contour of the current polygon and the curve on the left edge of the current hole is the left cutting line segment. The recording unit records the position parameters of this intersection point and the left cutting line segment.

[0222] Similarly, the reverse ray from the current hole may also pass through the cut inner hole. In this case, the curve of the right edge of the cut inner hole can be regarded as the left side of the outer contour of a polygon. The ray segment between the reverse ray from the current hole and the curve of the right edge of the cut inner hole is the left cutting segment.

[0223] Furthermore, it also includes a construction module, which constructs the outer contour of the current polygon counterclockwise, starting from the right-side dividing line segment;

[0224] The building module starts from the right dividing line segment and constructs the outer contour of the current polygon counterclockwise, that is, it starts to construct a new polygon from the left dividing line, the dividing line segment between the inner hole and above the right dividing line.

[0225] The traversal module traverses all inner holes and searches for undivided inner holes.

[0226] The judgment module is also used to determine whether the undivided inner hole belongs to the current polygon; the judgment module determines whether the undivided inner hole belongs to the current polygon based on the position information of the undivided inner hole and the outer contour data information of the current polygon.

[0227] The marking module is also used to set the inner hole as the inner hole of the current polygon;

[0228] The marking module sets the unsegmented inner hole as an inner hole of the current polygon if it belongs to the current polygon, and waits for the next segmentation process.

[0229] Implementation Example

[0230] Please see Figures 5 to 7 The copper foil with internal holes in the CAM file is decomposed into a copper surface pattern containing only islands (hereinafter referred to as Pattern 1). Pattern 1 contains four internal holes: the first internal hole 21, the second internal hole 22, the third internal hole 23, and the fourth internal hole 24. Pattern 1 is defined as the current polygon. The leftmost first internal hole 21 in the current polygon is selected as the current hole. A first ray 31 of the current hole is drawn from the curve of the left edge of the current hole to the left side of the current hole. The first ray 31 of the current hole intersects the left side of the outer contour of the current polygon. Then, a second ray of the current hole is drawn from the curve of the right edge of the current hole to the right side of the current hole. The second ray of the current hole will pass through the second inner hole 22. At this time, the second inner hole 22 is defined as the adjacent hole. A cutting line segment 32 is drawn to connect the current hole and the adjacent hole. The adjacent hole is then marked as the current hole. The second ray of the current hole is drawn to the right side of the current hole along the curve of the right edge of the current hole. At this time, the second ray of the current hole is the ray 33 on the right side of the second inner hole 22. Since the ray 33 does not pass through other inner holes, and adjusting the position of the curve of the second ray of the current hole on the right edge of the current hole will not pass through other inner holes, but will intersect with the right side of the outer contour of the current polygon, the figure 1 of the current polygon can be decomposed.

[0231] Since the second ray of the current inner hole cannot approach the endpoint of the second inner hole 22 when the first inner hole 21 is defined as the current inner hole, when the second inner hole 22 is defined as the current inner hole, a reverse ray 41 is drawn at the endpoint of the curve on the left side of the second inner hole 22. This reverse ray 41 passes through the third inner hole 23, and there are no other inner holes on the left side of the third inner hole 23. Therefore, the reverse ray 42 of the current inner hole on the left side of the third inner hole 23 intersects with the left side of the outer contour of the current polygon. Thus, the graphic 1 of the current polygon can be decomposed into the first polygon 11, the second polygon 12 and the third polygon 13.

[0232] Finally, returning to the traversal process, it is found that the fourth inner hole 24 belongs to the second polygon 12, and the fourth inner hole 24 is located at the leftmost position of the second polygon 12. Therefore, the second polygon 12 is taken as the current polygon, and the fourth inner hole 24 is defined as the current hole. After the segmentation process, the second polygon 12 can be decomposed again to obtain the fourth polygon 121 and the fifth polygon 122.

[0233] After further traversal, it can be found that none of the polygons have internal holes. At this point, all polygons can be inserted into the graphic, allowing the machine to recognize complex polygons.

[0234] The above description is merely an embodiment of the present invention and does not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for copper foil decomposition based on PCB, characterized in that, include: S1. Decompose the copper foil with internal holes in the CAM file into graphics containing only islands; S2. Traverse all polygons in the graphic and determine whether there is an inner hole. If yes, proceed to step S3; otherwise, proceed to step S6. S3. Select a polygon with an internal hole and mark it as the current polygon; S4. Set a cutting line through the inner hole to decompose the current polygon into two new polygons; S5. Return to step S2; S6. Insert all polygons into the graphic; In step S4, the step of setting the cutting line through the inner hole specifically includes: S401, marking the leftmost inner hole in the current polygon as the current hole; S402. Draw the first ray of the current tunnel to the left side of the curve on the left edge of the current tunnel; S403. Record the left intersection point of the first ray of the current hole and the outer contour of the current polygon, and the left cutting line segment between the left intersection point of the current hole and the outer contour of the current polygon. S404. Draw the second ray of the current tunnel to the right side of the current tunnel, following the curve of the right edge of the current tunnel. S405. Determine whether the second ray of the current hole passes through other holes. If yes, proceed to step S406; otherwise, proceed to step S410. S406. Mark the other holes closest to the current hole as nearby holes; S407. Record the intersection point of the second ray of the current tunnel and the curve of the left edge of the adjacent tunnel; S408, Draw a cutting line segment to connect the current hole and the adjacent hole; S409. Mark the adjacent hole as the current hole and return to step S404; S410. Adjust the position of the curve of the second ray of the current hole on the right edge of the current hole, and determine whether the second ray of the current hole passes through other holes. If yes, return to step S406; otherwise, proceed to step S411. S411. Record the right intersection point of the second ray of the current hole and the outer contour of the current polygon, and the right cutting line segment between the right intersection point of the current hole and the outer contour of the current polygon. S412. Decompose the current polygon into two new polygons and return to step S2. Between steps S403 and S404, the following is also included: S4031. Determine whether the intersection point of the first ray of the current hole and the left side of the outer contour of the current polygon is close to the endpoint of the left curve of the outer contour. If yes, proceed to step S4032; otherwise, proceed to step S404. S4032. Adjust the exit point position of the first ray of the current hole according to the endpoint of the outer contour curve, so that the intersection point of the first ray of the current hole and the left side of the outer contour of the current polygon is close to the endpoint of the left side curve of the outer contour, and proceed to step S404. Between steps S407 and S408, the following is also included: S4071. Determine whether the intersection point is close to the endpoint of the curve on the left edge of the adjacent hole. If yes, proceed to step S4072; otherwise, proceed to step S408. S4072. Adjust the exit point position of the second ray of the current hole according to the endpoint of the curve of the left edge of the adjacent hole, so that the intersection point of the second ray of the current hole and the curve of the left edge of the adjacent hole is close to the endpoint of the curve of the left edge of the adjacent hole, and proceed to step S408.

2. The PCB-based copper foil decomposition method as described in claim 1, characterized in that: Between steps S411 and S412, the following is also included: S4111. Determine whether the intersection point of the second ray of the current hole and the right side of the outer contour of the current polygon is close to the endpoint of the right curve of the outer contour of the current polygon. If yes, proceed to step S4112; otherwise, proceed to step S412. S4112. Draw a reverse ray to the left from the endpoint of the right curve of the current polygon's outer contour; S4113. Determine whether the reverse ray passes through the undivided inner cavity. If yes, proceed to step S4114; otherwise, proceed to step S4117. S4114. Mark the undivided inner cavity as the current cavity; S4115. Draw a reverse ray from the curve of the left edge of the current hole to the left side of the current hole; S4116. Determine whether the reverse ray of the current hole passes through the undivided inner hole. If yes, return to step S4114; otherwise, proceed to step S4117. S4117. Record the left intersection point of the reverse ray of the current hole and the outer contour of the current polygon, and the left cutting line segment between the left intersection point of the current hole and the outer contour of the current polygon, and proceed to step S412.

3. The PCB-based copper foil decomposition method as described in claim 2, characterized in that: Step S412 also includes: S4121. Starting from the right dividing line segment, construct the outer contour of the current polygon counterclockwise. S4122, Traverse all the inner caves; S4123. Determine whether the undivided inner hole belongs to the current polygon. If yes, proceed to step S4124; otherwise, return to step S4122. S4124. Set this inner hole as the inner hole of the current polygon.

4. The PCB-based copper foil decomposition method as described in claim 3, characterized in that: Step S2 also includes creating hash tables for the outer contour of the graphic and for the inner holes in the graphic.

5. The PCB-based copper foil decomposition method as described in claim 4, characterized in that: Step S408 also includes marking the position data of the cutting line segments connecting the current hole and the adjacent holes in the hash table.

6. A copper foil decomposition device based on PCB, characterized in that: The copper foil decomposition device for implementing the PCB-based method according to any one of claims 1-5 includes a conversion module, a traversal module, a judgment module, a marking module, a segmentation module, and an insertion module. The conversion module is used to decompose the copper foil with internal holes in the CAM file into a graphic with only islands; The traversal module is used to traverse all polygons in the graphic and find polygons with internal holes; The judgment module is used to determine whether there is an internal hole in the polygon; The marking module is used to select a polygon with an internal hole and mark that polygon as the current polygon; The segmentation module is used to set the cutting line through the inner hole, decomposing the current polygon into two new polygons; The insertion module is used to insert all polygons into the drawing.

7. The PCB-based copper foil decomposition device as described in claim 6, characterized in that: The marking module is also used to establish hash tables for the outer contour of the graphic and for the inner holes in the graphic, as well as the position data of the cutting line segments connecting the current hole and the adjacent holes.

Citation Information

Patent Citations

  • Automatic fragmentation contour intelligent scanning method for laser marking path

    CN113865507A