Wrong kind of aperture used for slot holes in Gerber X2 drill files.
Description
When producing a drill file in Gerber X2 format, KiCad generates obround or macro apertures and uses Flash (D03) command to define slots (oval holes), which should not be used for this purpose. Instead, only circular apertures with a plot command (D01 + operation commands G01, G02, G03) must be used for defining slots, as clearly defined in The Gerber Layer Format Specification (Revision 2023.08, page 159):
In drill or rout files only circular apertures can be used, and only in the following manner:
•For drill holes: flashes.
•For slots draws and arcs: a single draw/arc or a non-closed chain of draw/arcs
The Gerber Layer Format Specification: https://www.ucamco.com/en/news/gerber-layer-format-specification-revision-202308
Steps to reproduce
-
Open an empty project in KiCad.
-
Open PCB Editor.
-
Place a footprint that contains slots, for example place a BatteryHolder_Keystone_590 anywhere on the page.
-
Open the menu: File->Fabrication Outputs->Gerbers
-
Click the "Generate Drill Files..." button on the opening window.
-
Select "Gerber X2" as the Drill File Format
-
Click "Generate Drill File".
-
Open the generated file "Projectname-PTH-drl.gbr" using a text editor.
-
On lines 16 and 20, obround apertures are generated for defining slots. These apertures are then used with D03 Flash commands on lines 25, 27, 29.
-
To generate a similar example for the case where an aperture macro is defined for slots; Go to step 3, this time rotate the footprint previously placed by setting its Orientation property to 15 degrees on the Footprint Properties window, then repeat the remaining steps.
-
This time, on lines 15-33, two aperture macro definitions are made. On lines 37, 39, 41, they are used for defining slots, which violates the current Gerber specification. Instead of macro apertures, a circular aperture must have been defined, like "ADD11C,0.5" and then slots should have been plotted using the D01 command with the operation command G01.
The example project I used:
KiCad Version
Application: KiCad PCB Editor x64 on x64
Version: 7.0.10, release build
Libraries:
wxWidgets 3.2.4
FreeType 2.12.1
HarfBuzz 8.2.1
FontConfig 2.14.2
libcurl/8.4.0-DEV Schannel zlib/1.3
Platform: Windows 10 (build 19045), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
Date: Dec 28 2023 21:18:15
wxWidgets: 3.2.4 (wchar_t,wx containers)
Boost: 1.83.0
OCC: 7.7.1
Curl: 8.4.0-DEV
ngspice: 41
Compiler: Visual C++ 1936 without C++ ABI
Build settings:
KICAD_SPICE=ON