Open r4dr3fr4d opened 3 years ago
I'm wanting to try to keep the PCB design process in Python. I saw this exchange and thought generate_pcb() might be a way to create a pcbnew board object by running pcbnew.LoadBoard() on the .kicad_pcb. Is this sound, or is there another way I should be doing this?
fp_libs
is a dict
that holds the full path to each file containing footprints. The key for each dictionary entry should be the nickname for the library file. I think the right key should be Resistor_SMD
without the .pretty
suffix.
The .kicad_pcb
file output by generate_pcb
should be acceptable to pcbnew.LoadBoard
although I haven't tried it. I have been able to load it using PCBNEW
.
I would be interested in hearing more about your efforts to do a Python-only PCB design. Maybe the forum is a better place for that.
Hmm, fp_libs (loaded from LibURIs()) seems to be an empty dictionary....I added a print to verify at line 135, right before the backtrace occurs. Could I be missing a package or something I wonder?
Yes, I'm already modelling a custom keyboard in just Python using cadquery and would like to extend that to the PCB design rather than learning a GUI, if possible. I'm a little surprised it's not a common workflow yet, maybe in the not-so-distant future?
I'm wanting to create a little single-switch PCB I can use many of, like this one - in fact, I'm trying to open that amoeba's .kicad_pcb file and just edit the dimensions to fit my 3d model.
If I add
generate_pcb()
to the end of the SKIDL example to try to something I can feed into the pcbnew module, I get the following. Seems to be kinet2pcb....is fp_libs supposed to contain the full names of the Part footprints?