Skip to main content

kicad-to-openpnp

kicad-to-openpnp helps you convert your KiCad project into a set of full-fledged OpenPnP packages and parts, including pin definitions, as well as dimensions taken from 3D models of the footprints.

It does not replace OpenPnP's KiCad position file import process, it enhances it.

While this project is still WIP, it's been used in several successful assemblies so far.

Installation

Using pipx (installation instructions) is recommended:

pipx install --system-site-packages kicad-to-openpnp

(--system-site-packages is required due to how KiCad distributes its Python bindings.)

Alternatively, for the latest of the latest, you can try installing directly from GitHub:

pipx install --system-site-packages git+https://github.com/mmalecki/kicad-to-openpnp.git

Usage

Assuming your board file is called board.kicad_pcb, and you're in your .openpnp2 directory, you can run the following two commands to generate your new packages.xml and parts.xml:

kicad-board-to-openpnp-packages --board board.kicad_pcb --join packages.xml > packages.new.xml
kicad-board-to-openpnp-parts --board board.kicad_pcb --join parts.xml > parts.new.xml

The --join option will preserve your previous packages and parts and add them without modification to your new files. An option to allow for updating old entities based on new findings is in the works.

Therefore, if you just want to look at what the tool would output for your current board only:

kicad-board-to-openpnp-packages --board board.kicad_pcb
kicad-board-to-openpnp-parts --board board.kicad_pcb

If the new package and part files look correct, and your OpenPnP application is closed, you can now move them in place of the old files (making backups beforehand, if you'd like):

mv packages.new.xml packages.xml
mv parts.new.xml parts.xml

Why and how?

I found inputting part heights, sizes and pads into OpenPnP to be a rather large time commitment, so I begun looking for ways to automate that.

I quickly realized that KiCad footprints don't actually contain part body size information.
However, manufacturers now happily publish STEP files of their products, and I'm yet to find a model which would be so wildly inaccurate that it would be a problem for PnP process (0.1 ~ 0.2 mm variations are typical, though).

I then used the KiCad Python bindings to read in the pads and 3D models from the footprints (accounting for rotation), and CadQuery to load the models and measure their bounding boxes. This turned out to work. I was able to run several PnP jobs using the data generated by these here scripts.

Metadata

Release files for kicad-to-openpnp 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kicad-to-openpnp 0.2.0
File Size Uploaded
kicad_to_openpnp-0.2.0.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kicad-to-openpnp 0.2.0
File Interpreter ABI Platform
kicad_to_openpnp-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.2 kB

Release files / kicad_to_openpnp-0.2.0.tar.gz

Download URL kicad_to_openpnp-0.2.0.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ed938afb13d25ca58daa250b11ec17592db39792864c03649f3ab1cf655bde5d
BLAKE2b-256 checksum
How to use checksums
f085a91c0afa96cb0d598ffa5b5b03a33f8c8d8f11519ddcb3868a244ebdb8f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.12.10 Linux/6.17.13+deb14-amd64

Release files / kicad_to_openpnp-0.2.0-py3-none-any.whl

Download URL kicad_to_openpnp-0.2.0-py3-none-any.whl
Size 10.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
62e8f74955b5a2a5706bad8803cca8b377bd7e92b9e1a567d962c1f5f984839b
BLAKE2b-256 checksum
How to use checksums
505ce90dd3a774a3b4a8ee9b3e7553642219c0f2615701ad5e020ec83b2c0a71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.1 CPython/3.12.10 Linux/6.17.13+deb14-amd64

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page