Allow use of kicad-cli for KiKit present#820
Conversation
|
|
||
| kicadCli = shutil.which("kicad-cli") | ||
| if not kicadCli: | ||
| raise RuntimeError("kicad-cli needs to be installed in order to render boards") |
There was a problem hiding this comment.
| raise RuntimeError("kicad-cli needs to be installed in order to render boards") | |
| if sys.platform == "darwin": | |
| kicadCli = "/Applications/KiCad/KiCad.app/Contents/MacOS/kicad-cli" | |
| else: | |
| raise RuntimeError("kicad-cli needs to be installed in order to render boards") |
kicad-cli tends not to be on the PATH on MacOS
|
Hi! I have plans to revisit PCBDraw and actually use the rendering facilities in Kicad-cli. However, lately, I have struggled to find enough time to make larger changes to my tools. Overall, I would prefer fixing PcbDraw. However, given the circumstances, I think your solution is appropriate and I will be happy to merge the PR. I see two minor problems we need to resolve in your PR:
|
|
I also had issues installing pcbdraw with the latest version of kikit, due to the pcbnewtransition package, that is when I found @vroland fork implementing a new render engine. My OS is Windows and while the kicad-cli executable was found no problem, even with ImageMagick installed the code found a convert utility under Windows for converting FAT to NTFS volumes definitely not the convert needed. |
The native kicad-cli now offers a way to render board images from the CLI . Since some users (including me) had some dependency issues with PcbDraw, this PR adds the option to use kicad-cli for board images by adding a
--rendererswitch tokikit present.Kicad-cli is not perfect unfortunately, as there is no way currently to output appropriately sized images directly. As a workaround, this uses image magick to crop the images generated by KiCad.
Let me know if you're willing to upstream this and if there are any changes to make.