GithubHelp home page GithubHelp logo

stahta01 / kicad-diff Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gasman2014/kicad-diff

0.0 2.0 0.0 5.46 MB

Scripts for performing image diffs between pcbnew layout revisions

License: MIT License

Python 59.63% Shell 5.48% CSS 13.78% HTML 12.19% JavaScript 8.00% Makefile 0.91%
kicad

kicad-diff's Introduction

KiCad-Diff

This is a Python program that compares revisions of KiCad PCBs.

The layers of a KiCad board are exported to SVG, and the output is presented as a gallery of images on a web page. Each layer pair can be compared, and the combined view clearly highlights where the layers differ from one another.

The diff output can be scrolled and zoomed in and out for closer inspection. The pair of "before and after" views will also pan and zoom together.

Instructions

Dependencies

  • Ensure that you have Python3 installed. Why? https://www.pythonclock.org
  • Python Libraries from Kicad 5.* or 6.*
  • For extra python dependencies check the requirements.txt

wxWidgets

On macOS using Apple sillicon, you should export these flags first

export CFLAGS=-I/$(brew --prefix)/include
export CXXFLAGS=-I/$(brew --prefix)/include

On Ubuntu, wxWidgets can be installed with:

sudo apt install python3-wxgtk4.0

Installing dependencies

cd KiCad-Diff
pip3 install -r requirements.txt

Usage

Make sure you have SCMs (Git, Fossil and/or SVN) available through the PATH variable. Add the script path to your PATH too so the kidiff and plot_kicad_pcb will be available. This can be done easily with:

cd KiCad-Diff
source env.sh

The terminal should give you some useful information on progress. Please include a copy of the terminal output if you have any issues.

Command line help

usage: kidiff [-h] [-a COMMIT1_HASH] [-b COMMIT2_HASH] [-g] [-s SCM] [-d DISPLAY] [-p PORT] [-w] [-v] [-o OUTPUT_DIR] [-l] [-f] [PCB_PATH]

Kicad PCB visual diffs.

positional arguments:
  PCB_PATH              Kicad PCB path

optional arguments:
  -h, --help            show this help message and exit
  -a COMMIT1_HASH, --commit1-hash COMMIT1_HASH
                        Commit 1 hash
  -b COMMIT2_HASH, --commit2-hash COMMIT2_HASH
                        Commit 2 hash
  -g, --gui             Use gui
  -s SCM, --scm SCM     Select SCM (git, svn, fossil)
  -d DISPLAY, --display DISPLAY
                        Set DISPLAY value, default :1.0
  -p PORT, --port PORT  Set webserver port
  -w, --webserver-disable
                        Does not execute webserver (just generate images)
  -v, --verbose         Increase verbosity (-vvv)
  -o OUTPUT_DIR, --output-dir OUTPUT_DIR
                        Set output directory. Default is '.kidiff'.
  -l, --list-commits    List commits and exit
  -f, --frame           Plot whole page frame

Usage examples

# With a Git repo
kidiff led_test.kicad_pcb

# Forcing an specific SCM when more than one is available (Precedence: Git > Fossil > SVN)
kidiff led_test.kicad_pcb --scm fossil

# With a SVN repo, passing commit 1 and 2 on the command line
kidiff led_test.kicad_pcb -a r1 -b r3

Debugging

There should be some output in the launch terminal. Please copy this and include it in any issues posted. If the program is not working, please check that you can run the plot_kicad_pcb routine directly by invoking it from the command line and passing the name of the *.kicad_pcb file.

plot_kicad_pcb board.kicad_pcb

Screenshots

Commits Selection GUI
Commits Selection

Gallery view
Gallery View

Triptych view
Triptych view

Attributes Diff
Attributes Diff

kicad-diff's People

Contributors

leoheck avatar gasman2014 avatar jnavila avatar sunwukonga avatar ajwahab avatar chuckwagoncomputing avatar benroe avatar luzpaz avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.