Diff tool for Gerber/Excellon PCB files: visual raster overlays and attributed vector-geometry change analysis
Project description
gerberdiff
Diff tool for Gerber/Excellon PCB design files, with two complementary engines:
- Raster diff (
diff) -- visual overlay PNGs of changed pixels. - Geometry diff (
geomdiff) -- resolution-independent, attributed changes (moved/resized/added/removed) computed on the parsed vector geometry, down to micrometre displacements.
Install
pip install gerberdiff
Requires Python >= 3.11. The raster engine needs the system Cairo library
(libcairo2 on Debian/Ubuntu, cairo via Homebrew); the geometry engine
is Cairo-free.
Quick start
# Geometry diff: what moved, resized, was added or removed -- and by how much
gerberdiff geomdiff before/ after/ --out-json report.json --out-svg overlays/
# Raster diff: visual overlay PNGs
gerberdiff diff before/ after/ --out-json report.json --out-png diffs/
# Exit 1 if any changes detected (useful in CI)
gerberdiff geomdiff before/ after/ --fail-on-diff
import gerberdiff
from pathlib import Path
result = gerberdiff.compute_geometry_diff(Path("before/"), Path("after/"))
for layer in result.layers:
for change in layer.changes:
print(f"{layer.name}: {change.kind} {change.op_kind} "
f"dx={change.dx_mm} dy={change.dy_mm}")
Docs
| Topic | File |
|---|---|
| CLI reference | docs/cli.md |
| Python API | docs/api.md |
| JSON report schemas | docs/schema.md |
| Architecture | docs/architecture.md |
| Geometry diff engine | docs/geometry-diff.md |
Known limitations
- Excellon rout mode: only drill hits are processed; routing paths produce a
Warningdiagnostic but no geometry. - Deprecated RS-274X commands (
%MI%,%OF%,%SF%,%AS%): ignored with anInfodiagnostic. - Rectangle/obround aperture strokes: the raster engine strokes with
max(width, height); the geometry engine computes the exact Minkowski sum for linear strokes (see docs/geometry-diff.md).
Development
See CONTRIBUTING.md.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gerberdiff-0.29.1.tar.gz.
File metadata
- Download URL: gerberdiff-0.29.1.tar.gz
- Upload date:
- Size: 2.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5080e80a41f4a9d4ef57a806559e914b39d226f7a78acb3099a33055211214e2
|
|
| MD5 |
79f5b8c86bfba2dd5a36539f8c76e4a8
|
|
| BLAKE2b-256 |
43a95f43af79cac0aa8e8e7cbff305277786f140ae723dbc6221a8a9389d298a
|
Provenance
The following attestation bundles were made for gerberdiff-0.29.1.tar.gz:
Publisher:
release.yml on CameronBrooks11/gerberdiff
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gerberdiff-0.29.1.tar.gz -
Subject digest:
5080e80a41f4a9d4ef57a806559e914b39d226f7a78acb3099a33055211214e2 - Sigstore transparency entry: 1806654698
- Sigstore integration time:
-
Permalink:
CameronBrooks11/gerberdiff@8d878f05443c3a5a91dbf031230fc032937ba944 -
Branch / Tag:
refs/tags/v0.29.1 - Owner: https://github.com/CameronBrooks11
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8d878f05443c3a5a91dbf031230fc032937ba944 -
Trigger Event:
push
-
Statement type:
File details
Details for the file gerberdiff-0.29.1-py3-none-any.whl.
File metadata
- Download URL: gerberdiff-0.29.1-py3-none-any.whl
- Upload date:
- Size: 82.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe3bfeb31971dd1d3550e79c3495cdbe8f8692b210f4c377b68ad0d96f2c2f5d
|
|
| MD5 |
0a57f031b9db7b76de73ec88bfad5722
|
|
| BLAKE2b-256 |
c2061e069d5d45beb0a7932db36bafd12c87f9f7e1a8f8b1e7b66e8f0a64e8e1
|
Provenance
The following attestation bundles were made for gerberdiff-0.29.1-py3-none-any.whl:
Publisher:
release.yml on CameronBrooks11/gerberdiff
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gerberdiff-0.29.1-py3-none-any.whl -
Subject digest:
fe3bfeb31971dd1d3550e79c3495cdbe8f8692b210f4c377b68ad0d96f2c2f5d - Sigstore transparency entry: 1806654766
- Sigstore integration time:
-
Permalink:
CameronBrooks11/gerberdiff@8d878f05443c3a5a91dbf031230fc032937ba944 -
Branch / Tag:
refs/tags/v0.29.1 - Owner: https://github.com/CameronBrooks11
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8d878f05443c3a5a91dbf031230fc032937ba944 -
Trigger Event:
push
-
Statement type: