Skip to main content

PCB routing reinforcement learning environment

Project description

PCBEnv2: Printed Circuit Board Machine Learning Environment

Usage

See the API documentation, as well as pcbenv/playground.py and pcbenv/tests/ for examples.

Example Boards

Run pcbenv/data/boards/download.py to auto-fetch some boards for testing.

UI Controls

  • Hold right mouse button to scroll
  • Left click on pins to select a connection
  • Left click on a pin of the selected connection to reverse the order
  • Hold Ctrl to rectangle-select (for Autoroute and Unroute Selection)
  • Hold Alt to add to rectangle selection
  • Click Shift to activate manual routing tool

Installation (Linux)

  1. Check dependencies section.
  2. git clone ...
  3. cd PCBEnv
  4. pip install .

Non-installation (Linux)

  1. cd PCBEnv/pcbenv/cxx
  2. mkdir build
  3. cd build
  4. cmake ../ -DENABLE_UI=[1|0]
  5. make -j$(nproc) install
  6. run your python scripts from the pcbenv directory with PYTHONPATH=$PYTHONPATH:/path/to/PCBEnv

Dependencies

Most of them (with the exception of CGAL) are hopefully already installed [on a development machine] or are fetched automatically by cmake. Only Python, Qt (optional), and SWIG are not fetched automatically.

Necessary:

  • Python with C headers
  • CGAL (Computational Geometry Algorithms C++ header library)
  • rapidjson (C++ header library)
  • swig (C++/Python interface generator)

Required by CGAL:

  • boost (Boost C++ header libraries >= 1.74) Can be used by CGAL but are disabled by default:
  • gmp (The GNU MP Bignum Library)
  • mpfr (GNU multiple-precision floating-point computations)

For the user interface (if enabled):

  • Qt6 with C++ headers
  • OpenGL headers

NOTE: CGAL and Qt are free for academic and open source users, so if you read anything about getting a license: no, click elsewhere.

Install with, for example: pacman -S cgal swig rapidjson qt6-base qt6-tools

Fallback on Linux

If you don't have root access and something has failed to install so far, please consider building manually.

For example, do ./configure --prefix=/your/home/... and edit CMakeLists.txt to look there by uncommenting the obvious bits at the top. There is a python script to do this in the Dependencies folder but you really shouldn't need to.

Directory structure

  • cxx/ C++ code (see code documentation for an overview).
  • data/ Example boards, settings file, JSON schemas, UI resources.
  • util/ Python class for the PCB JSON format and JSON to SVG converter.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pcbenv-2026.1.0.tar.gz (10.7 MB view details)

Uploaded Source

File details

Details for the file pcbenv-2026.1.0.tar.gz.

File metadata

  • Download URL: pcbenv-2026.1.0.tar.gz
  • Upload date:
  • Size: 10.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for pcbenv-2026.1.0.tar.gz
Algorithm Hash digest
SHA256 d0873c4933f072606a219aae995f7fd02b6da51004ba820c24d77ab2f87d23f5
MD5 e7e93ecf5c689e414a812295662fdba3
BLAKE2b-256 a9ae8590316a9ccebb97a472432d5a4337158d8b37f8843d371bb2e33d646406

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page