Skip to content

michael-betz/kiff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kiff, the Kicad diff

Graphically compare layout changes between two git versions of a PCB.

If -c is not given, compares the local working copy against the latest version on git. This is useful to verify board changes before committing them.

If a git commit-id is given in -c, will compare the local version against this commit. This is useful to compare changes between 2 commits.

A useful shortcut for the commit-id is HEAD~1, which means the previous one.

Elements which have been added in the local version are colored green, removed ones red. Note that this may look inverted for features on copper fills.

Requires

  • poppler-utils to convert the Kicad .pdf plots to bitmaps
  • python-pil and python-numpy for image manipulations
  • kiff.py needs to be in your path

Tested to work with Python 2 and 3. To enable scripting with Python 3, Kicad needs to be compiled with -DKICAD_SCRIPTING_PYTHON3=TRUE.

Kicad 6

Tested on 2022-02-15 to work out of the box with Kicad 6.0.2.

Usage example

Compare the current version against the one from 3 commits ago:

$ cd <kicad_project>
$ kiff.py my_pcb.kicad_pcb -c HEAD~3

This will generate diffs/<layer_name>.png for each layer.

diff example

It works by using plot_layers.py to make Kicad plot each layer of each version as .pdf into 2 temporary directories. Then pdftoppm is called to crop the pdfs and convert them to bitmap. Bitmap data is read by PIL over stdin and the diff image is created in python using numpy arrays.

About

Kiff, the Kicad diff

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published