Aperture shape recognition method based on gerber file and related device

CN117392394BActive Publication Date: 2026-09-29SHENZHEN PARTNER INFORMATION TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311580131.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-24
Publication Date
2026-09-29
Estimated Expiration
2043-11-24

AI Technical Summary

Technical Problem

[0003]在现有的生产过程中,主要靠人工来将填实的多边形转换成对应形状的Pad,效率和准确率都比较低

Benefits of technology

[0009]本发明的有益技术效果在于:上述的基于Gerber文件的光圈形状识别方法、装置,可以自动识别Gerber图形中填实的多边形的几何形状,并在图形误差范围内创建对应形状的Pad,以便后续正常优化Pad的孔环,与依靠人工来将填实的多边形转换成对应形状的Pad相比,大大提高了效率和准确率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117392394B_ABST
    Figure CN117392394B_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on Gerber file's diaphragm shape identification method and related equipment.The based on Gerber file's diaphragm shape identification method includes the following steps: selecting the polygon to be converted in Gerber graphics, and setting shape error Tol, and setting the minimum size and maximum size of conversion;Traversal polygon sub-edge, calculate the circumscribed rectangle rect of polygon, and calculate the horizontal width w and vertical height h of circumscribed rectangle rect;Whether horizontal width w and vertical height h are all in the minimum size to maximum size range, if yes, then next step is carried out, if no, then the diaphragm shape identification method is ended;Shape identification is carried out to polygon, and the corresponding shape diaphragm is generated based on shape identification result;Based on the generated diaphragm, the Pad of corresponding shape is created.The application can greatly improve the efficiency and accuracy of converting filled polygon to Pad of corresponding shape.
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 related equipment for aperture shape recognition based on Gerber files. Background Technology

[0002] Before producing film, PCB factories need to optimize and edit Gerber files, checking if the hole rings of pads on the circuits are large enough. Pads that are not large enough need to be enlarged to meet production requirements. DRC is then used to check if the spacing between circuits, between circuits and pads, and between pads meets manufacturing requirements. When the distance between circuits and pads is insufficient, the pads need to be cut to meet the required distance. File optimization requires identifying which shapes are pads. However, when exporting Gerber from PCB design software, some pad outlines (closed polygons) are filled with elements. When importing Gerber, these pad elements are no longer visible; their positions have been replaced by polygons (a completely filled closed area). In this case, the polygon needs to be converted into a pad of the corresponding shape for subsequent optimization of the pad hole rings.

[0003] In the current production process, the filling of polygons is mainly done manually to convert them into corresponding Pad shapes, which is both inefficient and inaccurate. Summary of the Invention

[0004] The technical problem to be solved by the present invention is to provide a method and related equipment for aperture shape recognition based on Gerber files, which can greatly improve the efficiency and accuracy of converting filled polygons into corresponding Pad shapes.

[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: A method for aperture shape recognition based on Gerber files includes the following steps: selecting the polygon to be converted in the Gerber image, setting the shape error Tol, and setting the minimum and maximum conversion dimensions; traversing the sub-edges of the polygon, calculating the circumscribed rectangle rect, and calculating the horizontal width w and vertical height h of the circumscribed rectangle rect; determining whether the horizontal width w and vertical height h are both within the range of the minimum to maximum dimensions; if so, proceeding to the next step; otherwise, ending the aperture shape recognition method; performing shape recognition on the polygon, and generating an aperture of the corresponding shape based on the shape recognition result; and creating a Pad of the corresponding shape based on the generated aperture.

[0006] An aperture shape recognition device based on Gerber files includes: a graphic selection module for selecting the polygon to be converted from the Gerber graphic, setting the shape error Tol, and setting the minimum and maximum conversion dimensions; a graphic calculation module for traversing the sub-sides of the polygon, calculating the circumscribed rectangle rect, and calculating the horizontal width w and vertical height h of the circumscribed rectangle rect; a size verification module for determining whether the horizontal width w and vertical height h are both within the range of the minimum to maximum dimensions; if so, performing polygon shape recognition; otherwise, ending aperture shape recognition; a shape recognition module for performing shape recognition on the polygon and generating an aperture of the corresponding shape based on the shape recognition result; and a Pad creation module for creating a Pad of the corresponding shape based on the aperture generated by the shape recognition module.

[0007] An electronic device includes at least one processor and at least one memory communicatively connected to the processor, wherein the memory stores program instructions that, when executed by the processor, implement the aforementioned aperture shape recognition method based on Gerber files.

[0008] A computer storage medium storing program instructions that, when executed by a processor, implement the aforementioned aperture shape recognition method based on Gerber files.

[0009] The beneficial technical effects of the present invention are as follows: the aperture shape recognition method and device based on Gerber files described above can automatically identify the geometric shape of filled polygons in Gerber graphics and create corresponding Pads within the graphic error range so that the aperture rings of the Pads can be optimized normally in the future. Compared with relying on manual conversion of filled polygons into Pads of corresponding shapes, this method greatly improves efficiency and accuracy. Attached Figure Description

[0010] Figure 1 This is a schematic flowchart of the aperture shape recognition method based on Gerber files according to the present invention; Figure 2 This is a schematic diagram of the oval-shaped external structure; Figure 3 This is a schematic diagram of the polygon shape recognition process of the present invention; Figure 4 This is a schematic diagram of the square aperture recognition process of the present invention; Figure 5 This is a schematic diagram of the circular aperture recognition process of the present invention; Figure 6 This is a schematic diagram of the oval aperture recognition process of the present invention; Figure 7A diagram showing the division of a polygon into a left region, a middle region, and a right region; Figure 8 This is a schematic diagram of the aperture shape recognition device based on Gerber files according to the present invention. Detailed Implementation

[0011] To enable those skilled in the art to more clearly understand the purpose, technical solution, and advantages of the present invention, the present invention will be further described below in conjunction with the accompanying drawings and embodiments.

[0012] like Figure 1 As shown, in one embodiment of the present invention, the aperture shape recognition method based on Gerber files includes steps S10 to S50: S10. Select the polygon to be converted in the Gerber drawing, set the shape error Tol, and set the minimum and maximum sizes for conversion.

[0013] This step is the parameter initialization step. In the Gerber drawing, select the filled closed region as the polygon to be converted, and set the shape error Tol, as well as the minimum and maximum conversion dimensions. The shape error Tol is usually set to 1 mil, but it can be increased or decreased accordingly depending on the actual needs.

[0014] S20. Traverse the sub-edges of the polygon, calculate the circumscribed rectangle rect of the polygon, and calculate the horizontal width w and vertical height h of the circumscribed rectangle rect.

[0015] A polygon is composed of multiple sub-edges (which are either straight line segments or curved line segments). This step involves traversing the sub-edges of the polygon and calculating the circumscribed range of each straight line / curved line sub-edge to determine the polygon's circumscribed rectangle rect. Then, the horizontal width w and vertical height h of the circumscribed rectangle rect are calculated.

[0016] S30. Determine whether the horizontal width w and vertical height h are both within the range of minimum to maximum size. If yes, proceed to step S40; otherwise, end the aperture shape recognition method.

[0017] This step is the polygon size verification step. When both the horizontal width w and the vertical height h are within the range of the minimum to the maximum size, that is, when the maximum size ≥ the horizontal width w ≥ the minimum size and the maximum size ≥ the vertical height h ≥ the minimum size, the verification is successful, and the next step is performed to continue the aperture shape recognition. However, when the horizontal width w and / or the vertical height h exceed the range of the minimum to the maximum size, the verification is unsuccessful, and the aperture shape recognition method ends.

[0018] S40. Perform shape recognition on the polygon and generate an aperture of the corresponding shape based on the shape recognition result.

[0019] This invention categorizes polygon shapes into squares (rectangles), circles, ovals, and other shapes, with shapes other than squares, circles, and ovals considered as "other shapes." Therefore, the polygon shape recognition process is essentially the process of determining whether a polygon is square, circle, oval, or any other shape. Figure 2 The diagram shows the external structure of an oval shape, which, compared to a rectangle, has curved sides on both sides.

[0020] like Figure 3 As shown, in a preferred embodiment of the present invention, step S40 further includes: Square recognition: Determine whether the polygon is a square. If it is, generate a square aperture. If not, proceed to the next shape recognition step. Circle recognition: Determine whether the polygon is a circle. If it is, generate a circular aperture. If not, proceed to the next shape recognition step. Oval shape recognition: Determine whether the polygon is oval. If it is, generate an oval aperture. If not, proceed to the next shape recognition step. Other shape recognition: Determine if the polygon is another shape and generate an aperture of that other shape.

[0021] exist Figure 3 In the illustrated embodiment, when performing shape recognition on polygons, square recognition is performed first, followed by circle recognition, then oval recognition, and finally other shape recognition. Of course, in other embodiments of the present invention, the order of square recognition, circle recognition, and oval recognition steps can be interchanged. After square recognition, circle recognition, and oval recognition are completed, other shape recognition is performed last.

[0022] like Figure 4 As shown, the square recognition step further includes: shrinking one side of the circumscribed rectangle rect of the polygon to obtain a shrunken rectangle; traversing the child sides of the polygon and determining whether all child sides of the polygon do not intersect with the child sides of the shrunken rectangle. If so, the polygon is determined to be a square, and a square aperture is generated; otherwise, the square recognition step ends. Shrinking one side of the circumscribed rectangle rect of the polygon means moving one of the child sides of the circumscribed rectangle rect parallel to the center of the circumscribed rectangle rect along its perpendicular direction by a set distance (this set distance can be a shape error Tol), thereby obtaining a reduced rectangle, called the shrunken rectangle.

[0023] like Figure 5As shown, the circle recognition step further includes: determining whether the difference between the horizontal width w and the vertical height h of the circumscribed rectangle rect of the polygon is less than the shape error Tol; if yes, proceed to the next step; if no, end the circle recognition step; setting the center of the circumscribed rectangle rect as the center of the circle, and setting the average value of the horizontal width w and the vertical height h as the diameter; converting the curved sub-sides of the polygon into straight sub-sides; traversing the sub-sides of the polygon, determining whether the difference between the distance from all sub-sides (straight sub-sides) of the polygon to the center and the radius is less than the shape error Tol; if yes, determine that the polygon is a circle and generate a circular aperture; if no, end the circle recognition step. Specifically, when converting the curved sub-sides of the polygon into straight sub-sides, the curved sub-sides of the polygon are first divided into multiple curved segments of a set length, and then the curved segment is replaced by a straight segment formed by connecting the two endpoints of each curved segment, thereby converting the curved sub-sides of the polygon into straight sub-sides.

[0024] like Figure 6 As shown, the oval recognition step further includes: determining whether the horizontal width w of the circumscribed rectangle rect of the polygon is greater than the vertical height h; if so, proceeding to the next step; otherwise, ending the oval recognition step; dividing the polygon into a left region, a middle region, and a right region using two vertical line segments, as shown. Figure 7 As shown, the coordinates of the two endpoints of the left vertical line segment are (rect.MinX+h / 2, rect.MaxY) and (rect.MinX+h / 2, rect.MinY), respectively, and the coordinates of the two endpoints of the right vertical line segment are (rect.MaxX-h / 2, rect.MaxY) and (rect.MaxX-h / 2, rect.MinY), respectively. Here, rect.MinX represents the minimum X-axis coordinate of the circumscribed rectangle rect, rect.MinY represents the minimum Y-axis coordinate of the circumscribed rectangle rect, rect.MaxX represents the maximum X-axis coordinate of the circumscribed rectangle rect, and rect.MaxY represents the maximum Y-axis coordinate of the circumscribed rectangle rect. If the shapes of the left and right regions are semicircles and the shape of the middle region is a rectangle, then the polygon is determined to be oval, and an oval aperture is generated; otherwise, the oval recognition step ends.

[0025] The process of determining whether the shape of the left region is a semicircle is as follows: Set the midpoint of a vertical line segment on the left as the center of the circle, and set 1 / 2 of the vertical line segment as the radius; convert the arc segments of the left region with X-axis coordinates less than rect.minX+h / 2 into straight line segments; traverse the straight line segments of the left region with X-axis coordinates less than rect.minX+h / 2, and determine whether the difference between the distance from the straight line segment to the center of the circle and the radius of all the straight line segments of the left region with X-axis coordinates less than rect.minX+h / 2 is less than the shape error Tol. If so, the shape of the left region is determined to be a semicircle; otherwise, the oval shape recognition step ends.

[0026] The process of determining whether the shape of the right region is a semicircle is as follows: Set the midpoint of a vertical line segment on the right as the center of the circle, and set 1 / 2 of the vertical line segment as the radius; convert the arc segments of the right region with X-axis coordinates greater than rect.MaxX-h / 2 into straight line segments; traverse the straight line segments of the right region with X-axis coordinates greater than rect.MaxX-h / 2, and determine whether the difference between the distance from the straight line segment of the right region with X-axis coordinates greater than rect.MaxX-h / 2 to the center of the circle and the radius is less than the shape error Tol. If so, the shape of the right region is determined to be a semicircle; otherwise, the oval shape recognition step ends.

[0027] Such as Figure 4 The square recognition step in the illustrated embodiment is used to determine whether the shape of the middle area is rectangular, which will not be described in detail here.

[0028] exist Figure 6 In the illustrated embodiment, when performing oval shape recognition, the shape of the left region is recognized first, then the shape of the right region is recognized, and finally the shape of the middle region is recognized; of course, in other embodiments of the present invention, the order of the shape recognition steps of the left region, the right region and the middle region can be interchanged.

[0029] Other shape recognition: After square recognition, circle recognition, and oval recognition are completed, if the polygon is not a square, circle, or oval shape, it can be determined that the polygon is another shape and an aperture of another shape can be generated.

[0030] After determining that the polygon is of another shape, generate the other shape of the aperture by the following steps: take the bottom right point of the polygon as the starting point and reconstruct the polygon counterclockwise; traverse the created file apertures and determine whether the shape of all created file apertures is different from that of the reconstructed polygon. If so, create a new file aperture with the reconstructed polygon and store it in the file aperture set. If not, return the created file aperture.

[0031] Determine if the shape of the created file aperture is the same as that of the reconstructed polygon: When the number of sides of the created file aperture is the same as that of the reconstructed polygon, compare the endpoint coordinates of the created file aperture with the corresponding endpoint coordinates of the reconstructed polygon, and determine if the difference (including the difference in X and Y axis coordinates) is less than the set error. When the difference between all endpoint coordinates of the created file aperture and the corresponding endpoint coordinates of the reconstructed polygon is less than the set error, it can be determined that the shape of the created file aperture is the same as that of the reconstructed polygon.

[0032] S50. Create a Pad of the corresponding shape based on the aperture generated in step S40.

[0033] Delete the selected polygon, add a new Pad element, and take the center coordinates of the outer rectangle rect as the coordinates of the Pad. The Pad can reference the aperture generated in step S40.

[0034] The aperture shape recognition method based on Gerber files of this invention can automatically identify the geometric shape of filled polygons in Gerber graphics and create corresponding Pads within the error range of the graphics, so as to optimize the aperture ring of the Pads normally in the future. Compared with relying on manual conversion of filled polygons into corresponding Pad shapes, this method greatly improves efficiency and accuracy. In addition, this invention can convert non-standard square, circular, and oval apertures into corresponding standard shapes within the error range, which is beneficial for aperture ring optimization in CAM (computer-aided manufacturing).

[0035] like Figure 8 As shown, based on Figure 1 The aperture shape recognition method based on Gerber files in the illustrated embodiment provides an aperture shape recognition device based on Gerber files, including a graphic selection module 10, a graphic calculation module 20, a size verification module 30, a shape recognition module 40, and a Pad creation module 50.

[0036] The graphic selection module 10 is used to select the polygons to be converted in the Gerber graphic, set the shape error Tol, and set the minimum and maximum sizes for conversion, i.e., to perform the conversion. Figure 1 Step S10 in the aperture shape recognition method based on Gerber files in the illustrated embodiment.

[0037] The graphics calculation module 20 is used to traverse the sub-sides of the polygon, calculate the bounding rectangle rect of the polygon, and calculate the horizontal width w and vertical height h of the bounding rectangle rect, i.e., it is used for execution. Figure 1 Step S20 in the aperture shape recognition method based on Gerber files in the illustrated embodiment.

[0038] The size verification module 30 is used to determine whether the horizontal width w and vertical height h are both within the range of minimum to maximum size. If so, polygon shape recognition is performed; otherwise, aperture shape recognition is terminated, i.e., it is used to execute... Figure 1 Step S30 in the aperture shape recognition method based on Gerber files in the illustrated embodiment.

[0039] The shape recognition module 40 is used to perform shape recognition on polygons and generate an aperture of the corresponding shape based on the shape recognition result, i.e., it is used to perform... Figure 1 Step S40 in the aperture shape recognition method based on Gerber files in the illustrated embodiment.

[0040] Pad creation module 50 is used to create Pads of corresponding shapes based on the aperture generated by the shape recognition module, i.e., it is used to execute... Figure 1 Step S50 in the aperture shape recognition method based on Gerber files in the illustrated embodiment.

[0041] The present invention also provides an electronic device comprising a processor and a memory communicatively connected to the processor, wherein the memory is used to store various types of data to support operation on the electronic device, and the data may include program instructions for any application or method operating on the electronic device, as well as application-related data, such as data for executing... Figure 1 The illustrated embodiment includes program instructions, parameter configuration data, etc., for the aperture shape recognition method based on Gerber files. The memory can be implemented using one or more volatile or non-volatile storage devices of any type, or combinations thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. One or more processors can be used to control the overall operation of the electronic device by calling and executing program instructions stored in the memory to complete tasks. Figure 1 The steps of the aperture shape recognition method based on Gerber files in the illustrated embodiment.

[0042] The present invention also provides a computer storage medium storing program instructions that, when executed by a processor, implement the aforementioned aperture shape recognition method based on Gerber files. The computer storage medium can be the aforementioned memory containing program instructions, which can be executed by a processor to complete the task. Figure 1 The steps of the aperture shape recognition method based on Gerber files in the illustrated embodiment.

[0043] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention in any way. Those skilled in the art can make various equivalent changes and improvements based on the above embodiments, and all equivalent variations or modifications made within the scope of the claims should fall within the protection scope of the present invention.

Claims

1. A method for aperture shape recognition based on Gerber files, characterized in that, Includes the following steps: S10. Select the polygon to be converted in the Gerber drawing, and set the shape error Tol, as well as the minimum and maximum conversion size. The polygon is composed of multiple sub-sides, which are either straight line segments or arc segments. S20. Traverse the sub-edges of the polygon, calculate the bounding rectangle rect of the polygon, and calculate the horizontal width w and vertical height h of the bounding rectangle rect; S30. Determine whether the horizontal width w and vertical height h are both within the range of minimum to maximum size. If yes, proceed to step S40. If no, end the aperture shape recognition method. S40. Perform shape recognition on the polygon and generate an aperture of the corresponding shape based on the shape recognition result; S50. Create a Pad of the corresponding shape based on the aperture generated in step S40; Step S40 further includes: Square recognition: Determine whether the polygon is a square. If it is, generate a square aperture. If not, proceed to the next shape recognition step. Circle recognition: Determine whether the polygon is a circle. If it is, generate a circular aperture. If not, proceed to the next shape recognition step. Oval shape recognition: Determine whether the polygon is oval. If it is, generate an oval aperture. If not, proceed to the next shape recognition step. Other shape recognition: Determine if the polygon is another shape and generate an aperture of another shape, wherein the other shape is a shape other than square, circle, or oval; The square recognition step further includes: The indented rectangle is obtained by moving one of the child sides of the circumscribed rectangle rect of the polygon parallel to the center of the circumscribed rectangle rect along its perpendicular direction by a set distance. Traverse the sub-sides of the polygon and determine whether all sub-sides of the polygon do not intersect with the sub-sides of the indented rectangle. If so, the polygon is determined to be a square and a square aperture is generated. If not, the square recognition step ends. The circular recognition step further includes: Determine whether the difference between the horizontal width w and the vertical height h of the bounding rectangle rect of the polygon is less than the shape error Tol. If yes, proceed to the next step; otherwise, end the circle recognition step. Set the center of the circumscribed rectangle rect as the center of the circle, and set the average of the horizontal width w and the vertical height h as the diameter; Convert the curved edge segments of a polygon to straight edge segments; Traverse the sub-sides of the polygon and determine whether the difference between the distance from all sub-sides of the polygon to the center and the radius is less than the shape error Tol. If so, the polygon is determined to be a circle and a circular aperture is generated. If not, the circle recognition step ends. The oval shape recognition step further includes: Determine whether the horizontal width w of the bounding rectangle rect of the polygon is greater than the vertical height h. If yes, proceed to the next step; otherwise, end the oval shape recognition step. The polygon is divided into a left region, a middle region, and a right region using two vertical line segments. The coordinates of the two endpoints of the left vertical line segment are (rect.MinX+h / 2, rect.MaxY) and (rect.MinX+h / 2, rect.MinY), respectively. The coordinates of the two endpoints of the right vertical line segment are (rect.MaxX-h / 2, rect.MaxY) and (rect.MaxX-h / 2, rect.MinY), respectively. Here, rect.MinX represents the minimum X-axis coordinate of the outer rectangle rect, rect.MinY represents the minimum Y-axis coordinate of the outer rectangle rect, rect.MaxX represents the maximum X-axis coordinate of the outer rectangle rect, and rect.MaxY represents the maximum Y-axis coordinate of the outer rectangle rect. If the left and right regions are semi-circular and the middle region is rectangular, then the polygon is determined to be oval, and an oval aperture is generated; otherwise, the oval recognition step ends.

2. The aperture shape recognition method based on Gerber files as described in claim 1, characterized in that, The generation of apertures in other shapes further includes: Starting from the bottom right point of the polygon, reconstruct the polygon counterclockwise. Iterate through the created file apertures and determine whether the shapes of all created file apertures are different from those of the reconstructed polygons. If they are different, create a new file aperture using the reconstructed polygons and store it in the file aperture set. Otherwise, return the created file aperture.

3. The aperture shape recognition method based on Gerber files as described in claim 1 or 2, characterized in that, The order of the square recognition step, the circle recognition step, and the oval recognition step can be interchanged.

4. An aperture shape recognition device based on Gerber files, characterized in that, Including: The graphic selection module is used to select the polygon to be converted in the Gerber graphic, set the shape error Tol, and set the minimum and maximum conversion size. The polygon is composed of multiple sub-sides, which are either straight line segments or arc segments. The graphics calculation module is used to traverse the sub-sides of a polygon, calculate the bounding rectangle rect of the polygon, and calculate the horizontal width w and vertical height h of the bounding rectangle rect; The size verification module is used to determine whether the horizontal width w and vertical height h are both within the range of minimum to maximum size. If so, polygon shape recognition is performed; otherwise, aperture shape recognition is terminated. The shape recognition module is used to recognize the shape of polygons and generate an aperture of the corresponding shape based on the shape recognition result; The Pad creation module is used to create Pads of corresponding shapes based on the aperture generated by the shape recognition module. The shape recognition module is further used for: Square recognition: Determine whether the polygon is a square. If it is, generate a square aperture. If not, proceed to the next shape recognition step. Circle recognition: Determine whether the polygon is a circle. If it is, generate a circular aperture. If not, proceed to the next shape recognition step. Oval shape recognition: Determine whether the polygon is oval. If it is, generate an oval aperture. If not, proceed to the next shape recognition step. Other shape recognition: Determine if the polygon is another shape and generate an aperture of another shape, wherein the other shape is a shape other than square, circle, or oval; The square recognition step further includes: The indented rectangle is obtained by moving one of the child sides of the circumscribed rectangle rect of the polygon parallel to the center of the circumscribed rectangle rect along its perpendicular direction by a set distance. Traverse the sub-sides of the polygon and determine whether all sub-sides of the polygon do not intersect with the sub-sides of the indented rectangle. If so, the polygon is determined to be a square and a square aperture is generated. If not, the square recognition step ends. The circular recognition step further includes: Determine whether the difference between the horizontal width w and the vertical height h of the bounding rectangle rect of the polygon is less than the shape error Tol. If yes, proceed to the next step; otherwise, end the circle recognition step. Set the center of the circumscribed rectangle rect as the center of the circle, and set the average of the horizontal width w and the vertical height h as the diameter; Convert the curved edge segments of a polygon to straight edge segments; Traverse the sub-sides of the polygon and determine whether the difference between the distance from all sub-sides of the polygon to the center and the radius is less than the shape error Tol. If so, the polygon is determined to be a circle and a circular aperture is generated. If not, the circle recognition step ends. The oval shape recognition step further includes: Determine whether the horizontal width w of the bounding rectangle rect of the polygon is greater than the vertical height h. If yes, proceed to the next step; otherwise, end the oval shape recognition step. The polygon is divided into a left region, a middle region, and a right region using two vertical line segments. The coordinates of the two endpoints of the left vertical line segment are (rect.MinX+h / 2, rect.MaxY) and (rect.MinX+h / 2, rect.MinY), respectively. The coordinates of the two endpoints of the right vertical line segment are (rect.MaxX-h / 2, rect.MaxY) and (rect.MaxX-h / 2, rect.MinY), respectively. Here, rect.MinX represents the minimum X-axis coordinate of the outer rectangle rect, rect.MinY represents the minimum Y-axis coordinate of the outer rectangle rect, rect.MaxX represents the maximum X-axis coordinate of the outer rectangle rect, and rect.MaxY represents the maximum Y-axis coordinate of the outer rectangle rect. If the left and right regions are semi-circular and the middle region is rectangular, then the polygon is determined to be oval, and an oval aperture is generated; otherwise, the oval recognition step ends.

5. An electronic device, characterized in that, The electronic device includes at least one processor and at least one memory communicatively connected to the processor, wherein the memory stores program instructions that, when executed by the processor, implement the aperture shape recognition method based on Gerber files as described in any one of claims 1 to 3.

6. A computer storage medium, characterized in that, The computer storage medium stores program instructions, which, when executed by a processor, implement the aperture shape recognition method based on Gerber files as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • GERBER file parameter analysis method and device and computer equipment

    CN114090517A