Guidance for Gerber Viewer in 5.99

I am using the KiCad gerber viewer to review the gerber output from an Altium design. I have previously used Pentalogix Viewmate and I think that the KiCad viewer is pretty good by comparison. This is not a complaint!

Rather; My questions concerns:…The menus include selections for: Cmp (component?) Net, and Attr.

I have always thought that gerber viewers were just a convenient way to view a bunch of dumb images. If there is really some added intelligence available, I would like to take advantage of that.

  1. Is there really some way within the KiCad gerber viewer to select nets or components?

  2. What do I need to load and/or do beforehand to make that work? General instructions?

  3. Can this capability work with Gerber outputs from other EDA tools such as Altium?

Thanks!

Application: KiCad Gerber Viewer (64-bit)

Version: (5.99.0-11659-gbafa105ed0), release build

Libraries:
wxWidgets 3.1.5
libcurl/7.74.0-DEV Schannel zlib/1.2.11

Platform: Windows 10 (build 19043), 64-bit edition, 64 bit, Little endian, wxMSW

Build Info:
Date: Aug 6 2021 20:59:18
wxWidgets: 3.1.5 (wchar_t,STL containers)
Boost: 1.75.0
OCC: 7.5.0
Curl: 7.74.0-DEV
ngspice: 34
Compiler: Visual C++ 1928 without C++ ABI

Build settings:
KICAD_USE_OCC=ON
KICAD_SPICE=ON

The Gerber file format is not a frozen standard.

For (quite some time) X2 extensions are available, and X3 is in the workings as far as I know.

There is some competing standard which claims to be “complete” and that may be a part of the reason Gerbers are being improved. Or just that better standards allow more functionality is a good enough reason to improve Gerber standards.

One of the things that have been improved is that it’s now possible to define real pads in Gerber files. These can for example be used for flying probe tests. In the X3 standard netlist info can also be added to the Gerber files. Previously the data needed for flying probe tests was probably derived by guesswork by analyzing the Gerber images.

I do not know much about these standards though. If you want to know more then starting with reading those standards may be a good idea.

Thanks, Paulvdh

I am not familiar with these extensions but you have provided me with an avenue to investigate. In my consulting work, I often need to review pcb layout produced by different EDA tools. If gerbers and the viewers can be more intelligent, that could greatly reduce the need to wrestle with the layout viewers from Altium, PADS, Driptrace :slight_smile: , Cadence, etc. etc.

Ucamco is a company that makes the Gerber plotters and manages the Gerber standards, and make it freely available. They also have extra information on their site about “best practices” on how to use the standard and implement it in software. It’s an old standard, and lots of older things are still supported, but not deprecated.

Apparently there is also some (personal or business?) link between a KiCad developwer (JP Charras?) and Ucamco.
I’ve never been stellar in personal stuff though.

Hey, I could give some info about this:

Some years ago, Karel Tavernier, the Managing Director of Ucamco, contacted a few guys to collect advice and info in order to update the Gerber format (namely X1 format) and adding metadata (more file info, netlist info etc…) to help board manufacturing (reduce errors, mistakes …) in order to add some info similar to the IPC2581 needed by modern CAM tools

A few guys were in CAM software, some others in ECAD software.
One thing I learned is the fact CAM guys do not know well the ECAD world, and ECAD guys (like me) do not know well the CAM world.

However, to enhancet he X1 format to the X2 format (and later the X3 stuff) CAM and ECAD worlds must cooperate.

So during some time, something as a working group worked on new and missing features to enhance the X1 format (and later create a xnc drill file guidance)

I was a guy from the ECAD world to help the work on X2 format and later X3 extension.

The advantage was due to the fact it was much more easy to test new ideas in Kicad ( for instance in nightly builds) than in a commercial product.

And also I learned some constraints (for Gerber files) coming from CAM world, and added these constraints in Kicad Gerber files.

(Note: X3 is not a change in X2 format. It is just a file format to create drill files and P&P files using the Gerber X2 files).

I encourage everbody to use the full X2 format: it gives more reliable Gerber files.
For instance inside the files, the purpose of this file is encoded, so no need to use the ridiculous Protel file extensions: only the .gbr file ext is enough.

Netlist and Component info is also an info that can be used in CAM tools to verify the board from the full set of Gerber files.

4 Likes

Thank you…this all sounds good. But let’s say that I come neither from the ECAD world nor the CAM world. Except for having done some simple text edits of KiCad data files, I am pretty much a dumb user when it comes to software. I guess my simple question to the members of this forum: Is there a straightforward way for me to exercise more intelligence (including my own!!) when using KiCad’s gerber viewer so that I can use it to identify components and nets?

image

BTW I have done a quick scan through of the ucamco document…I don’t think it will do me much help…

You need to have generated X2 gerbers for this to work. There is a checkbox in KiCad for this, and if you are looking at Gerbers from other CAD software, they would have had to be generated in X2 format (if supported by the software). Altium for example supports this but requires you to specifically choose X2 format.

I once had an old Protel project (20 or so years old. Way before X2) that I reverse engineered for fun.
I could not read the Protel format, but it had a schematic in .pdf format and a set of Gerber files.

I re-created the schematic in KiCad, which was relatively straight forward (but a bit boring). You do not have to use your engineering brain to create the schematic, it’s just simple compare and draw.

After that I used KiCad’s Gerber viewer to create a PCB from the Gerber files.

I assigned new footprints to the schematic and ported the netlist and footprints to Pcbnew with [F8], and then started placing footprints on the PCB. This worked quite well. I even caught two errors I made on the schematic because the netlist it created caused DRC errors on the PCB.

You can just snap the new footprints to the track ends imported from the Gerber files, and use the Ratsnest as a guide for recognizing footprints. For the first few footprints you have to guess, because there is no footprint info yet, but as soon as you put footprints on tracks, KiCad recognizes the connection and places the net names on the tracks.

1 Like

Thank you. That is helpful. Is there a way for me to tell that from the list of gerber file name extensions?

OK I guess I can make my own gerbers from KiCad and test some of this…

No, gerber file extensions are not standardized at all.

The best way to tell is to check for some of the new attributes (for example TF.FileFunction) in a text editor.

Do you mean that you were somehow able to produce tracks and copper zones in KiCad by back-converting from Gerbers? I would think it would just be a dumb image?

1 Like

Yes, It is both a dumb image and I was able to Re-create the PCB from it.

If you do: Gerbview / File / Export to Pcbnew and choose the right layers (there was no layer info in that old project), then KiCad is smart enough to make copper tracks from the straight line segments on the copper layers.

KiCad also has the built in functionality that if a footprint is placed on a piece of track that does not belong to any net, then it assigns the net from the pins of the footprint.

So you do a bit of cleanup from the Gerber import (It had a lot of “painted pads” which I all deleted, and then placed imported footprints from Eeschema on the track ends. (By snapping a pin of a footprint to the endpoint of an existing track). And then KiCad gives net names to all the tracks that get connected to all the pins of that footprint. Those “dumb images” have quite a lot of info in them:

  • PCB outline.
  • All track segment locations.
  • Footprint locations, implicitly in the pads and/or end of track locations.
  • Mounting hole locations and sizes.

Layers as Soldermask and Silkscreen are also easily recognizable from the sort of graphics they have.
Inner layers do usually not have footprints, while the outer two layers do. If you accidentally swap top and bottom layer, then a lot of the SMT parts won’t fit because the footprint is mirrored.


A quick search:
https://html.duckduckgo.com/html?q=altium+gerber+file+naming+convention
And then the first result:

And you have some info about the naming convention altium uses for it’s gerber files.

1 Like

Thanks. This is good stuff…

Ohhh Noooo. But I suppose it makes sense.

But in an effort to answer my own questions, I took a pcb layout from a home project and produced gerbers in X2 format. I suppose I am being as dumb as my gerbers, but when I open up those gerbers with the KiCad viewer, I still do not see how to select or find components for example. This is all not a problem but I feel like I have some functionality and no clue how to use it. (mostly for gerbers which other people have developed with other EDA tools and sent to me.)

First:
Most of what I wrote is about Backporting the Gerbers into a KiCdad project, and therefore in Pcbnew (rebranded "PCB Editor in KiCad-nightly V5.99).

KiCad does support component, pad and netlist info in Gerber files, but those are optional. I generated a set of Gerbers (with V5.99) and checked: Include netlist attributes.

When you load that Gerberjob in Gerbview, you can select a component, a net, an attribute or a DCode from those four drop down lists at the top, and then it highlights them.

You can also point at things, and then there is a highlight function under the Right Mouse Button:

Hmm: I used “fabrication outputs” > Gerbers and got to the same dialog box. (Mine is cosmetically different but the X2 format and netlist attributes were both checked.

I was unable to select components from the gerber viewer. I must be doing something different from what you are… One thing; I opened a list of gerber files; I did not open a gerber job. In fact I do not even see a job file in the list of gerbers?

image

Aaah That is it!! My dialog box shown above is for a different design. When I went back to the one which I had plotted, the box to produce a gerber job file was unchecked. So I redid it and then opened the job file as you said. Now those pulldowns work. I have learned something useful here. Thanks a lot! Is this common knowledge that I am missing or ought it be documented somewhere?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.