Gasman2014/KiCad-Diff
소개
Scripts for performing image diffs between pcbnew layout revisions
디자인 및 미디어측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- 0
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
OriginalKiCad-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
- KiCad 5 or later (which provides most of the dependencies)
- Python 3
wxPython(for the revision picker ui)pexpect(macOS only)
- A version control tool like Git, Fossil or Subversion.
wxWidgets
On macOS using Apple silicon, 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] [--no-browser] [-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)
-p PORT, --port PORT Set webserver port
-w, --webserver-disable
Do not execute webserver (just generate images)
--no-browser Do not automatically open a browser window (webserver still runs)
-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
optional arguments for development use:
--dev, --live-assets Link webserver to source files, so changes can be seen live.
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
User Interface
By default kidiff automatically starts a webserver and opens a browser window to visualise the results. The main page shows:
- A table of side-by-side meta data and project statistics. The commit 1 is on the left and commit 2 on the right.
- A clickable gallery of individual schematic sheets and board layers. A preview of commit 1 is shown in the gallery tile.
- If commit 1 and commit 2 are identical for that sheet/layer,
(=)is shown in the caption to indicate they are equal.
- If commit 1 and commit 2 are identical for that sheet/layer,
Clicking any of the tiles opens that sheet/layer in a triptych view. It shows:
- Commit 1 and commit 2 overlaid and blended, so that equivalent sections are drawn in grey, sections unique to commit 1 are drawn in cyan, and sections unique to commit 2 are drawn in red.
- Commit 1 (the "before" view) in its own frame, drawn in the colour of that layer as defined in KiCad.
- Commit 2 (the "after view) in its own frame, drawn in the colour of that layer as defined in KiCad.
- A table of differences, grouped by category.
- If there are no differences for that category,
(=)is shown in the tab name to indicate they are equal.
- If there are no differences for that category,
Screenshots
Commits Selection
Gallery View
Triptych view
Attributes Diff
Development
Testing
pytest # (~4 s, no KiCad/Playwright required)
pytest --slow # (~11 s, end to end tests, skipped if KiCad/Playwright can't be found)
관련 프로젝트 살펴보기
불러오는 중…