Is there a way to convert whole PCB in new footprint?

Hi @bobc, you mentioned the script was “half finished”. Did you get around to completing the script?

Hi bobc,
would it be difficult to automatically re-use the delimiter zone of the connectors as delimiter zone for the new board since the new board will be superposed to another one and we can populate the surface under the new board, apart from the connectors ?
Thank you !

Hi @bobc, just to let you know that your script has been very useful ! Thanks a lot. :slight_smile:

1 Like

Hi, this looks interesting and useful, though a noticed some difficulties setting up the python script environment.
Pcb_to_foorprint.py activates but execution stops at missing command

Files\KiCad_5.1.2-2\x08in’, ‘C:\Program Files\KiCad_5.1.2-2\lib\python2.7\site-packages’, ‘C:\kicad-footprint-generator’, ‘C:\Program Files\KiCad_5.1.2-2\x08in’, ‘C:\Program Files\KiCad_5.1.2-2\lib\python2.7\site-packages’]
Traceback (most recent call last):
File “”, line 1, in
File “C:\kicad-footprint-generator\pcb_to_footprint.py”, line 51, in
from KicadModTree import *
ImportError: No module named KicadModTree

So this looks bit complex now, as the role of the KicadMod_Tree is
not included to search path or active in libraries known or in use?

Br

You will also need https://github.com/pointhi/kicad-footprint-generator and edit the script a bit to point to the right path, and add parameters specific to your design.KicadModTree https://github.com/pointhi/kicad-footprint-generator

Ok, this kicad-footprint-generator looks external library package to Kicad internal python environment, and the brief documentation shows how this package is installed to linux.

Now the external package installation document for the windows is not shown ? I thing there is something somewhere.

Actually this hierarchical pcd workflow could be part of the KiCad itself to add more flexibility to sch-pcb workflow phases by allowing a project to contain several pcb-designs, as long they use unique external interfaces or the signals can be manually connected.
This probably doesn’t work at trace-level, but signalling must be higher level, connector layer signal interfaces to and from a black-box.

Currently interface signalling is inherited from one schematic only, one to one relation, but some cases there can be need for pcb design include another ready made, non-standard pcb-unit as a component.

This is however not the same when sch -> pcb is many to one relation, which is usually the case used in hierachy designs.

This same result would be possible if pcb-component .cmp layer could import ready pcb-design as a source for creating new pcb component.
Signal names, pin positions and types were ready, without those trace layers that are not needed at component level.

Reusing previous pcb designs is also cost and time effective when available in the same way as with other software packages.

Br

Nope the footprint generator is complete stand alone. It only needs python. Preferably python 3.x


Edit: however the stuff made by @bobc uses kicad python to decode the board information so yes it needs not only the footprint generator but also kicads python. You might therefore need to setup the python path as needed.


Edit2: The script even sets up the python path for the footprint generator using an absolute path in line 44. You can either place the repo under C:\github or change the line to point to the correct place.
You then only need to setup python path to have the pointer to kicads python. (On linux this is already the case out of the box. I do not know if this is the case for windows as well.)

1 Like

… my two cents…

Perhaps this will help. Very quickly done and did not add stuff beyond the minimal.

Created a New Footprint (used a SIP (Single Inline Pads, Double Row and Single Row).
Exported it as STEP [File>Export>Step]. Loaded it as 3D model.
Created a New Project, Drew a PCB Shape on Cuts Layer, Added a Two-Pin pad with a Wire (I previously did the wire in FreeCad and added it the Two-Pin Footprint).
Added a Part (the newly created Daughter Card footprint).

Results (in 3D Viewer) below shows result. Sure, I could have added connectors… etc to both).

[EDIT] Added Daughter Card image - don’t why it doesn’t show in 3D along with the Main Card and Wire but, still works well enough…