Uhm, ok.
Some manual refinement is needed, it is difficult to get everything creating a script.
The vias are quite used when designing microstrip lines, in order to get shorted stubs and so on, but these does not need to be numbered pads, so maybe some "fp_circle"s on all copper layers are ok.
The discrete smd components needs square pads, so maybe some “fp_lines” with the right size are ok.
Then the ports can be directly inserted from the footprint editor or by adding “pad” (as you did) in the right place, but this second method is an overkill for me, I can add them manually in the editor.
Hence some manual editing is not easy to be avoided, but it would be easier with official complete documentations.
I guess you don’t have the kicad_pcb S-expression specification, but only for the kicad_mod (unofficial, in the link you provided and that I downloaded). I tried to search for the first, but I can not find it anywhere.
Maybe the procedure using bitmap is still easier and probably with the same final result.
Don’t you need a plated through hole? if you only have circles you don’t get that.
You could use “~” as pad number. This is used for pads that should not be connected to anything. (mounting holes, …)
Because your connections are done with lines this could work.
First of all, you can add or subtract features from the gerber within the gEDA project gerbv viewer.
Once you have the features you want in a gerber file, you can try running it through
which can create a gEDA PCB/pcb-rnd compatible footprint from a gerber, i.e. as shown here
which you can then import into kicad.
IIRC, the converter doesn’t deal with arcs, but kicad doesn’t routinely support arcs on copper anyway. Flashed apertures like pads may not be converted either due to the lack of detail in a gerber file as to the function or purpose of a specific feature.
Gerbers with painted features, i.e. from Eagle, are quite bulky and less useful once converted.
If you must have a .mod file, another way to go about it is to convert the entire gerber to a gEDA PCB/pcb-rnd footprint, and load it into a new layout in pcb-rnd (available at http://repo.hu/projects/pcb-rnd/ or as a debian/ubuntu package). In there, the footprint element can be broken up into constituents, and the useful bits retained. These can then be cut into the paste buffer, converted to an element, and pasted back onto the layout. The layout can then be exported in kicad format, and the bespoke footprint you have just created will be exported in the kicad layout as a module,
One possibility might be gerber-to-svg and then svg2mod but there is a lot of potential for things to go wrong with multiple steps. I know that gerber-to-svg generates a lot of <use> tags and I am not sure svg2mod even supports those.
No, I was supposing it was included in python, hence I did not clone the repo but just download the svg2mod script.
Now, after cloning the repo and with python 3.6, I get some errors:
Warning: Path segment has only 2 points (not a polygon?)
Writing polygon with 3 points
Unsupported SVG element: Circle
That’s just a warning. But yeah, if the result is no good then you might be out of luck. It could be a lot of work to make this method give good results.
Sorry, this message won’t be useful. Just expressing a little frustration that one has to jump through so many hoops to get this working. Implementing import of simple shapes, or shapes designed somewhere else (printed antenna in CST, or transmission line transitions and some sort of RF filters) should not be that painful.
I’m glad the community is able to figure it out in the end!
This script is for use from within inkscape and thereby lets inkscape do the conversion of paths for export to line segments, unlike svg2mod, which is standalone and uses its own library.
This script converts 1px to 1 mil.
Summary, it is subtly different in terms of results vs svg2mod, and does not expect to be given polygons. It simply converts paths, and doesn’t try to do anything clever such as allocating distinct layers in the exported footprint.
One of the scripts will export gEDA pcb .fp format, which Kicad can load directly.