Enable drill marks for Gerber files


If you are using Linux, then http://gerbv.geda-project.org/ … note… not -gerbview- can do this.

Load the gerber copper layer and drill (*.drl) file.

Change the background color and the color of the drill holes to white, then print to a graphic format ( svg, png etc). The copper layer will be printed with the drill holes unfilled.

gerbv is supposedly able to run on windows but I am not a windows user so I cannot confirm this

The old dos based Ultiboard pcb software used to do this by subtracting one plot file from another many years ago.

Edit: changed the link to gerbv
Edit, Edit: corrected a typo


Do I understand that what you want is not a paper document showing locations of drill hits, but rather to have a little dimple, or cross, actually etched into the copper of each pad?

(To those who have had a culturally deficient upbringing - devoid of any hands-on shop class with real machinery - the dimple in the copper will grab a drill point and pull it to the desired center of the hole location. DIY builders rely on this behavior to produce accurately drilled hole patterns.)

If so, I don’t think KiCAD can do this on the copper layers. But if it’s possible, I’d like to know how!

If you added (with the footprint editor) a tiny copper keep-out area at the center of each drilled pad, would the plotted Gerber file honor the keep-out?



The footprint editor is currently not able to add keepout. @SchrodingersGat started an implementation for that but live (and the library reorganization) got in the way.


Exactly this AND I need the dimple in the Gerber files. So far I found many ways to achieve this with non-Gerber files but no way with Gerber files.


Using gerbv seems to work well with any export format except Gerber. With Gerber export from gerbv I get only the complete copper layer but no holes removed.


I have to admit, I didn’t read your first post properly.
How are you producing the boards if you need a Gerber with drill centre marks?


It seems like an easy thing for a script to read a drill file and generate gerber instructions, if I find some time over the weekend I might have look into it.


I use flatcam to produce G code of the outlines for a laser cutter and then use the laser cutter on the PCB. After that I need to drill a few holes by hand.


Aah, that makes sense. I guessed it was by some mechanical means but didn’t think of a laser cutter


Yes, once the mark shows up in a Gerber file it will be etched into the board’s copper.

Perhaps create a second pad containing a small (20 mils (0.5mm) or so) NPTH hole, and stack this on top of the component pad. Will the Gerber file created by KiCAD show a clear area where the NPTH hole is located?



I tried the NPTH pads also and they are both filled.

The difference is in the separate drill file. NPTH is a circle and normal hole is a cross.


KiCad never generates Gerbers with holes, the assumption is that Gerbers are for copper, and the drill file is for NC drill.

However, with a text editor I combined part of the drill map file (gerber) with top copper layer and it shows copper layer with drill marks removed from the copper. The key is to use %LPC*% which plots clear, ie. it unexposes the etch resist.

ktest4-merge-F.Cu.gbr (1.8 KB)

Now just a question of writing some code :slight_smile:


I like the way you approach this. Appending the holes to the Gerber file via text sounds pretty straight-forward. The holes and crosses that KiCAD provides, however are too big for drill centering and they might even cut smaller pads into pieces. I need some small dimples instead.

In the “.drl” file the coordinates seem to be in clear text for each hole.

Could we take these coordinates and create a small circle on each of these positions and append it to the gerber file?


Certainly, it is mostly just changing numbers!

You need to add an aperture to the apertures list for the pilot hole
Then add flash commands (D03) for each drill coordinate, using that aperture.

ktest4-merge-F.Cu.gbr (1.7 KB)


I just had another quick look at this myself.

gerbv can load an Excellon drill file and export it as a Gerber file.
The Gerber can then be opened in a text editor and all the aperture sizes and references removed apart from one which is set at the required size, say, 0.15mm or so. This file should then hopefully load into Flatcam.

It is all a bit of a faff because this would mean doing two passes over the board with one for the traces and another for the holes but it is worth an experiment.

An example, if the formatting is not all over the place

G04 This is an RS-274x file exported by *
G04 gerbv version 2.6.1 *
G04 More information is available about gerbv at *
G04 htt://gerbv.geda-project.org/ *
G04 --End of header info–*
G04 --Define apertures–*
G04 --Start main section–*

Edit: Well done bobc, you posted while I was still trying to get my post to format properly,
That is the difference between someone that knows how to code and someone that fudges around problems :slight_smile:


I created a Python script to add pilot holes to a gerber file using the NC drill file, which can be found here https://github.com/bobc/kicad-utils/tree/v5/scripts/add_pilot. It should be run from a command line prompt.


That’s brilliant ! :slight_smile:

Can I add a small feature request - to allow the plot-negative file to be Gerber, as well as Excellon ?

The reason is to support the often-requested Negative Text feature
With this, users can assign a special layer for cut-out/negative text, and plot that layer separately, then append to the copper-fill-layer using the LPC append.
(with due care, of course, as this will cut into any and all copper data :wink: )

One example of Negative text conversations :

Combine gerbers (useful for negative text)

Is there a functional reason for negative text, or is it just cosmetic?


I suspect mainly cosmetic. But it might allow to add text where one can not otherwise add it because of space constrains. (If you do not have silkscreen you might want to add as much text as possible on copper.)


I’d say mostly cosmetic, but it does avoid a larger break / cutout in the copper, which means shorter paths, and lower thermal resistance too.

I have seen it used to good effect on the Micro:Bit for example, for nice, clear pin labeling