GerbView export to Pcbnew behaviour

Before I raise a bug report, is this expected behaviour (pre 5.1.3)?

I open a single valid copper layer Gerber (a demo board from Analog) and it displays correctly
Export to PcbNew as a layer, F Copper in this case and loads of vias are added
The package is QFN and there are no vias at the pins in the original pcb


I am not shure a bug report exists but the behavior was the same with kicad 4.

I usually copy a Gerber layer to Eco1 as a template when I want to follow a known good layout.
KiCad seems to be guessing vias at segment ends. This would have made sense in THT times, but messes things up with SMD

Yes, this is a known limitation/artifact.
I think there are plans to improve the export, with some more user choices.
eg
I suggested they add the optional ability to extract hole size and hole-exists, from Drill files in a bug report. (https://bugs.launchpad.net/kicad/+bug/1646221)
I got an ‘in progress’ email on 6 May, re GerbView export improvements, so this is being worked on.

2 Likes

For template purposes, just faithfully rendering the layer is the best solution. Trying to guess vias rather than using the drill file is a bad idea

I raised a bug, quickly closed as a duplicate.
The problem is that Pcbnew has no rectangular pad primitive to map Gerber flashes to.

One day I was thinking of trying to write code to match pads to known footprints, and then substitute those into the board, but it is rather tricky.

Sounds really tricky if you actually mean comparing gerbers with KiCad footprints. For example rounded rectangles, when KiCad exports them to gerbers, are made with several flashes. It’s impossible to know where each flash belongs to if there’s no metadata, so you can’t even create pads, not speaking of whole footprints. Round and rectangle pads should be easier. Even then I would do it like this (not an exact description, just some rough outlines):

  1. Export whole board, exporting each pad as one footprint.
  2. Write “create footprint out of items” script.
  3. Select items from the board for one footprint and create a footprint out of them, saving it to a library.
  4. Compare all board items with the items of the new footprint and find matching collections of items. Make footprints out of them, using the first footprint as the library footprint.

This could be extended so that first you should manually create a 1-pad footprint out of several flashes. I would be compared with all groups of flashes. That way it might be possible to find complex pad shapes.

EDIT: this would be semi-manual at best. I can’t see a way to make it fully automatic. And it wouldn’t be very useful to reverse-engineer gerbers exported by KiCad. It would be needed for gerbers from other EDA software, and only God knows how they have used gerber specs to create copper features.

1 Like

I would be really happy with Pcbnew just handling the rectangular flash as a graphic so that the layer can be drawn as an image accurately.
Importing from Gerber is most useful to Eco1 as a copying template. Importing directly as a copper layer with all the assumptions about preferred track widths, angles and design rules is much harder

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