Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SKiDL BUG] generate_pcb() #127

Open
r4dr3fr4d opened this issue Sep 3, 2021 · 3 comments
Open

[SKiDL BUG] generate_pcb() #127

r4dr3fr4d opened this issue Sep 3, 2021 · 3 comments
Labels

Comments

@r4dr3fr4d
Copy link

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?

No errors or warnings found during netlist generation.

Traceback (most recent call last):
  File "/home/rayce/linux_bkp/pcb_experiment.py", line 69, in <module>
    generate_pcb()
  File "/usr/lib/python3.9/site-packages/skidl-1.1.0-py3.9.egg/skidl/circuit.py", line 607, in generate_pcb
    gen_func(file_)  # Generate the PCB file from the netlist.
  File "/usr/lib/python3.9/site-packages/skidl-1.1.0-py3.9.egg/skidl/tools/kicad.py", line 1014, in _gen_pcb_
    kinet2pcb.kinet2pcb(self, file_)
  File "/usr/lib/python3.9/site-packages/kinet2pcb-0.1.4-py3.9.egg/kinet2pcb/kinet2pcb.py", line 154, in kinet2pcb
    lib_uri = fp_libs[fp_lib]
KeyError: 'Resistor_SMD.pretty'
@r4dr3fr4d r4dr3fr4d added the bug label Sep 3, 2021
@r4dr3fr4d
Copy link
Author

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?

@devbisme
Copy link
Owner

devbisme commented Sep 5, 2021

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.

@r4dr3fr4d
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants