Enable drill marks for Gerber files

In the plot dialog there is an option for drill marks when exporting PDF but it is greyed out for Gerber files and there doesn’t seem to be an easy way to enable drill marks for manual drilling. I’m using another software for processing the files that unfortunately only reads Gerber and not PDF.

Would it be possible to enable drill marks as an option for Gerber files?

If not is there a good workaround to add the drill marks to the Gerber files using another program?

Try the Generate Drill Files… dialog?

Ok, i tried that dialog and get some geometry out. X and O shapes where the holes go. This is almost what i would want but not quite. I would need small filled dots where the holes go and then a way to subtract them from the copper layer. The way that the drill marks would do it.

The O-Shapes leave the center with copper and both cut off too much of the pad.

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?

Dale

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.

1 Like

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?

Dale

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:

1 Like

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–*
%MOIN*%
%FSLAX34Y34*%
%IPPOS*%
G04 --Define apertures–*
%ADD10C,0.0100*%
G04 --Start main section–*
G54D10*
G01X0043504Y-033268D03*
G01X0043701Y-031496D03*
G01X0044488Y-031496D03*
G01X0045276Y-031496D03*
G01X0046890Y-028504D03*
G01X0049213Y-031575D03*
G01X0050098Y-032283D03*
G01X0055354Y-028425D03*
G01X0062244Y-032126D03*
G01X0062362Y-025276D03*
G01X0062362Y-027165D03*
M02*

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:

2 Likes

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.

1 Like

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 :