Gerber to Footprint

Hi Everybody,

I have just started using Kicad in order to evaluate whether it should be used professionally as a substitute for Altium.

I do alot of antenna design in CST Microwave Studio where I export PCB antennas as gerber or dxf. Now, I want to import the gerber (or dxf) as a footprint so I do not have to draw everything again.

The gerbview program seems to be able to open the gerber files, but exporting to .brd and opening using Pcbnew tells me that it is an old version and will try and convert it. Alas, it does not end up well. Anywho, using some dxf to svg to kicad_brd I got the outline of the antenna into Pcbnew. However, I can’t seem to get the actual footprint into a new module.

I have tried on both Xubuntu 14.04 x64 using standard repos and the windows x64 installer from here. But to no avail.

What do I do? I am guessing that I am simply doing something completely wrong…

Any help is much appreciated (would really like to find an alternative to Altium since I really loathe that program).

Thanks.

1 Like

Is it possible to export to a bitmap and then import that as a footprint?

I have just tested it, and my gerbview export properly ot kicad_pcb except that it does not fill the zone from the gerber, and the saving is a bit strange. I guess that should be two new bug reports.

I tested with bzr 5320, so I suggest you try to get a recent build, for example the PPA for ubuntu.

Yes, that gets the PCB antenna into the Module Editor. However, now I need to push this into a signal layer instead of a silk screen.

I don’t think the module editor is what I’m after. What I want is coherency between the schematic (where a PCB antenna is present) and the layout where I want the PCB antenna to be a component that I can move around. The same could be said for PCB inductors etc. And it should work with DRC and LVS. Perhaps this is the right question to ask…? :smile:

Sorry for the confusion and thanks for the response.

When you save in gerbview you can select what layer it should save on.

I got hold of BZR5324 and now I am able to open the gerber files in gerbview - so far so good. However, saving in kicad_pcb file format and opening in pcbnew just gives a single line - basically same thing as before.
Given that the gerber to kicad_pcb was actually done correctly, how would you translate this into a module?

It is possible though in the module editor to force graphics into copper layers (LVS, DRC issues, it gives a warning?). So I can import dxf and free hand draw the shape I need - pretty tiresome work…

There must be someone who has tried to make a planar PCB inductor or an antenna as a module (or component - don’t know the correct lingo?).

Could you please try to provide a antenna design and a screenshot of how it should look in Altium, and how it actaully looks in KiCad?

Also I notied that a zone from a gerber is not imported correctly, only the tacksegemnts defining the edge is imported. But that should be a bug that should be reported.

I have not made this project in Altium - but please see attached pictures taken directly from CST. They show the basic idea. Basically an antenna and a ground plane where IC/SMDs are mounted.

3d
top annotated

The antenna is a 2 pin device with a ground connection and a feed. Exporting only the antenna element to gerber and opening in gerbview:

** Can’t post more than two links and no pictures???!!! **

Saving to kicad_pcb and opening in pcbnew yields (nothing- empty file).

Fair enough, so gerber import is a problem. However, I want the antenna as a module. Exporting to dxf and importing in Footprint Editor (openGL) gives the outline

From here I could manually draw the lines and force them into the copper layer, but then it seems it would ignore DRC.

I know this is just a trace, but the idea is to have a footprint that uses the copper layers - again, the application could also be a planar PCB inductor.

I have done several antenna designs in KiCad and created modules that can be placed/moved like any other footprint. However the process involved printing out an annotated antenna design from the microwave design package and then hand creating it out of overlapping rectangular pads in the KiCad module editor.

I’m not sure what the status of support for filled zones in modules is, in my current version (5111) you still can’t place them in the module editor although I think the file format might support them. You can’t use normal traces for microwave work because they always have rounded corners.

The ability to add filled zones to modules would be a massive step forward for this kind of work.

Definitely agree with that!

@Hoejrup, can’t post more than two pictures (links actually) because you’re a relatively new user. Spend just a little more time on site and you’ll get upgrades (it’s for spam purposes)

As for getting the module to the copper layer, I can make a video for that, but it’s about changing the numbered layer in the footprint file. I thought that was in the library of videos, but I’m realizing now that it might only be in the CE course.

Made the video this morning, hopefully it helps clear things up:

1 Like

@Hoejrup, it is easier if you can provide the dxf and or gerber output from your antenna design software, such that I can try it. Personally the bitmap mapping is not that desireable. It should be possible to get it in from those files, if not “cleanly” via the gui, some modificaiton of the files by hand should be possible such that you will get exactly what the design software said. I consider the bitmap an approximation.

@ChrisGammell, great video, thank you very much. One issue would be keep out areas and DRC checking of the antenna though. I do agree with @nickoe that bitmap seems somewhat of an approximation. Hence, I have been thinking of doing a python script that translates the dxf files into kicad_mod files. Basically just a text parser I need to use as the shapes are defined by connected points it seems. This script would also change layers etc.

Then for DRC another python script that automatically adds keepout zones and checks for DRC in the components could be applied to kicad_pcb file. Then it could also add vias for multilayer antennas. Thus the workflow would be to export antenna design to dxf, run dxf2kicad_mod script, make your layout, run pyKiCadDRC script, run DRC in kicad (or something like this)

Think I will try and make these two scripts over the holidays and see what I can figure out - unless you have something more clever in mind?

@nickoe, the dxf and gerber files are here dxf, gbr

I can confirm that the gbr to kicad_pcb does not work properly thwere, it only exports one line segment.

IMHO it would be better for you and human kind to fix the gerbview export instead. Tested with rev 5320.

But it do indeed seem like the export from your antenna application is broken (unless it is the KiCad’s DXF importer), because the DXF imported does not look as a closed shape. I don’t have anoter CAD right now to import DXF to verify.

But I think you could just import the DXF, then change the layer to F.Cu or whatever appropiate. Possibly also assign the net.

The dxf is missing one line in kicad, but it shows correctly using QCAD.

I agree that it would be best to fix the gerber import. However, I would still prefer to have the antenna as a schematic and pcb component so there is LVS. But it seems that drawing copper traces and keepout in the footprint editor is somewhat far away since it requires some DRC changes to kicad (as far as I could understand on the kicad roadmap/newsletter, can’t find the link right now).

There is something special about that DXF file, I tried to make various shapes in QCAD and they all import just fine. (I am no QCAD expert, maybe I did not make a proper polygon)

Have you guys tried GerbV? It’s part of gEDA and seems more full featured than GerbView. That’s how I merge the drill and NPTH files to send to OSHPark.

Hoejrup, I have faced similar issues before and I think it’s partly because of the initial conversion from the gerber which hasn’t been done properly. It was always missing a line or a polygon when I converted my gerbers, a different problem every time. I haven’t used GerbV though, will try it out as soon as I get some time on my hands.

electronic manufacturing services