Tools for inspecting and DRC'ing PCBs their Gerber files
Project description
GerberTools
Yet another tool for doing stuff with Gerber files. "Stuff" being:
- rendering to SVGs;
- rendering to 3D models (Wavefront OBJ format); and
- (very) basic electrical DRC.
Why? [insert tool here] can already do this.
For as far as I could find, no (open source) tool could do these things from just gerber files (they use their own EDA file format), don't do it detailed enough for my liking, can't be scripted, and/or don't have a way to export the data. It's all kind of a mess. For example...
-
Other tools exist to render Gerber files to SVGs. But they use (comparatively) complex SVG operations to make things work, thus relying on the SVG rendering engine to do most of the work. If you're just viewing the file that's fine; if you're reading them from a script it's not. The SVGs generated by GerberTools only use polygons, making them much easier to read.
-
Most EDA tools nowadays have a 3D viewer built into them. But if they have an exporter at all, the export is limited to the board shape and holes. That's fine when you're doing 3D CAD, but it's nowhere near good enough when you're trying to make somewhat photorealistic renders, like this:
The input file format (i.e. the native format of the EDA tool) can also be an issue, for example when you're crazy enough to procedurally generate a PCB. So is scriptability.
-
DRC has the same "issues" as above: when you only have Gerber files and a netlist, good luck getting any EDA tool to help you.
Ultimately, I built this because I myself needed it. Maybe it'll help someone else as well, maybe not.
How?
The core is written in C++, but wrapped in a (scarcely documented) Python module. This module also includes a basic command-line interface. You can get it the usual way with pip:
pip install gerbertools
Once you have it, you can use the command-line interface using
gerbertools --help
or equivalently, if the above won't work due to path shenanigans,
python -m gerbertools --help
From within Python, you can do something like
import gerbertools
help(gerbertools)
print(gerbertools.get_version())
gerbertools.read('some_pcb').write_svg('some_pcb.svg')
You can also run the tests by running the test_boards.py
script in the
tests
directory. This should give you some basic usage examples, and
generates some example output files in tests/output
.
Wheels should be available for Windows, MacOS, and Linux using the Python versions active at the time of writing. If you're reading this in N years and there is no wheel for your version, or you have some other reason to build it yourself, it should be fairly straightforward to do so. All dependencies are contained within the repository, so you really just need Python and a C++ compiler. The easiest way to build it is with:
NPROCS=10 pip install -v -e .
where the NPROCS
environment variable specifies the maximum amounts of
parallel compilation processes to use.
You can also build and install using the usual CMake methods, but then you only get the C++ library that the Python module is based on. So that's really only useful when you want to use the library from C++.
Copyright stuff
The polygon geometry processing is done using the Clipper library, lazily included as source files in this repository. It uses the Boost software license. The same thing goes for Earcut, which uses the ICS license. The relevant license text is at the top of the copied files.
Stuff I add will be licensed under MIT, which I'm more familiar with. Either way, it'll be permissively licensed.
The circuit board files in the test directory have different licenses. They are not distributed with or linked to any build, and I have no affiliation with the makers/owners of those boards.
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 Distributions
Built Distributions
File details
Details for the file gerbertools-0.1.0-cp39-cp39-win_amd64.whl
.
File metadata
- Download URL: gerbertools-0.1.0-cp39-cp39-win_amd64.whl
- Upload date:
- Size: 224.6 kB
- Tags: CPython 3.9, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.20.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66bc7608c14015f0786cb30757f4e270c21f7810f4b83c39220c11e66e298b43 |
|
MD5 | e3ec555969a66bdcd8426a447bbb2aae |
|
BLAKE2b-256 | ee7a2591dd311d7261c2f276718676dc458cb4f83d42d09fd9cde8d6497ba9e3 |
File details
Details for the file gerbertools-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: gerbertools-0.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 310.1 kB
- Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.20.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 389c18671736c2b2b8f19bb34a94d4528a5311abc2e4fc61388e940928e26e99 |
|
MD5 | d361f68bd5cdb1541e1eabe206f5b510 |
|
BLAKE2b-256 | 975eb8096c84a123415f021fe03015a57b04104f3830b7a67cd318425266a119 |
File details
Details for the file gerbertools-0.1.0-cp39-cp39-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: gerbertools-0.1.0-cp39-cp39-macosx_10_14_x86_64.whl
- Upload date:
- Size: 262.2 kB
- Tags: CPython 3.9, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.20.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4d7884b3aa4c42f4abf748f7a5f594dba59194574aca4daa0690dca55c5f999 |
|
MD5 | 22fe1c22d20fe3d8414816a1b8343455 |
|
BLAKE2b-256 | 7434afe0e71875e11d5c97315bbe2edbaed743cfa0c7ddce740f4b2054babd15 |
File details
Details for the file gerbertools-0.1.0-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: gerbertools-0.1.0-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 227.4 kB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.20.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 96a83ec1dcd66e5379caa3eaa3d3ec791ec81ce36c60967aaa632bea0dec4ef2 |
|
MD5 | 281f5a53aa28788f4e687cfb2e4f244e |
|
BLAKE2b-256 | 6d54e5c0e5096878488e1fcf596ec958b6f6739c343ea5c0d303271ec4e07558 |
File details
Details for the file gerbertools-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: gerbertools-0.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 309.9 kB
- Tags: CPython 3.8, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.20.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 078213e84dae4f7ff4ddcda7c32baa137c2e6d24967bb2fc19d604f90fff580a |
|
MD5 | f80f63b2cf4a13e5a3b9f0a11bdce31a |
|
BLAKE2b-256 | 18f8773621f6a66b0dababfabebb84c5382a15c738e0615c0ffc5f03d8325f43 |
File details
Details for the file gerbertools-0.1.0-cp38-cp38-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: gerbertools-0.1.0-cp38-cp38-macosx_10_14_x86_64.whl
- Upload date:
- Size: 262.2 kB
- Tags: CPython 3.8, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.20.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e9dce27a23ea412de09dbaa447a2645c2c4b3788a48a62d859d4e0d8479ac57 |
|
MD5 | d165e3d597557459ca907c56b32c3857 |
|
BLAKE2b-256 | 75f9e6de31ab405ce3fdb7c1d307ed2dd2f3996dbd0a5451e473ae407abd49b4 |
File details
Details for the file gerbertools-0.1.0-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: gerbertools-0.1.0-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 227.6 kB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.20.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f185a9670a9a063b4cb7914e37492ef08ad801d74a0ebaf8a9979059aca7705 |
|
MD5 | 59a315294ee6c4d571ede7804d7b7ae0 |
|
BLAKE2b-256 | ff5e6e6b244fe3258c52e7d8c21dfbd46b6c95566d075fbd9ee19e7972960dc9 |
File details
Details for the file gerbertools-0.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: gerbertools-0.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 313.9 kB
- Tags: CPython 3.7m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.20.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2329fc3a388a6f5cd575e9a577b145fc4f3910e3201ce942f9d944b2360096b0 |
|
MD5 | 1f0f461c5f7c6433c888e5d1dc85ab2d |
|
BLAKE2b-256 | bea969e939988891a969d73f59e4f6dc36fba1a8137d5d98abd70141a20424a6 |
File details
Details for the file gerbertools-0.1.0-cp37-cp37m-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: gerbertools-0.1.0-cp37-cp37m-macosx_10_14_x86_64.whl
- Upload date:
- Size: 260.8 kB
- Tags: CPython 3.7m, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.20.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 266fc445fe70a40c55c7ce02632d1da464ead59b29d20f49bdf1a88c7fd272bc |
|
MD5 | da0ed1daee5b066f2a1e28db4519d1f5 |
|
BLAKE2b-256 | c4a21ab796e4fd691d71499780ee196b167faffef0c65021da0de65d0bed0a62 |
File details
Details for the file gerbertools-0.1.0-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: gerbertools-0.1.0-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 227.5 kB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.20.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac33611ec51ddb74f90496ef2d3f58d9bd39f946b8ad0f2dae579324e3b13532 |
|
MD5 | 32cc6c74ae030e1c60cac4c25145fd6e |
|
BLAKE2b-256 | 59f314662f55aafcb2a154691ca4a109faf93405b7c03f7fa241f455bfeb5132 |
File details
Details for the file gerbertools-0.1.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
.
File metadata
- Download URL: gerbertools-0.1.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 313.7 kB
- Tags: CPython 3.6m, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.20.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dda0792a160ffef244a0e9143681b4b050d307c3a2a6806580c8bf778c357661 |
|
MD5 | 8b4b93606533ad8064948e024d74c96f |
|
BLAKE2b-256 | 10d98ac4220812b4c3ca6e70f9275f95288b54b961e896c0db28cef28b7644e5 |
File details
Details for the file gerbertools-0.1.0-cp36-cp36m-macosx_10_14_x86_64.whl
.
File metadata
- Download URL: gerbertools-0.1.0-cp36-cp36m-macosx_10_14_x86_64.whl
- Upload date:
- Size: 260.9 kB
- Tags: CPython 3.6m, macOS 10.14+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.5.0.1 requests/2.20.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/3.6.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8488a6c0ca6931c5e546a1681e000882f06c3fbada1874e62996707642c94d07 |
|
MD5 | 2db88cfec8dda052c40f83536f0b61c2 |
|
BLAKE2b-256 | 491b8a042ae56e3fc58b7bc6d386bd4217994e22038e900f925e731be2c6dc43 |