WASM/WebGL2-based Gerber file viewer for PCB visualization.
- Viewer / Mirror
- Sample 1: SparkFun Thing Plus ESP32 WROOM C Panel
- Sample 2: LimeSDR-PCIe
- Sample 3: LimeNET-Micro
- Sample 4: Zaius EVT3 Motherboard (ODB++)
- Feature test
- Performance test - Stars: 1K, 10K, 100K, 1M, 5M, 10M, 20M, 50M
- Performance test - Single region: 72K, 648K, 1.8M
- Performance test - Arc region: 1.3M
- Memory64 test - Pads, uses more than 4 GiB of memory: 24M
- High-performance rendering for large Gerber files (>10 MB)
- WebGL2 hardware-accelerated rendering via WASM
- RS-274X Gerber rendering support
- NC drill overlay rendering support
- ODB++ job import (
.zip,.tgz,.tar.gz,.tar) - Touch support for mobile devices
- Multi-layer rendering with per-layer color and visibility control
- Composite Layers with Union, Intersection, Difference, and custom coverage combinations
- Feature picking with selected-area highlighting
- Horizontal/vertical flip controls
- Ruler measurements with mm/inch unit switching
- Screenshot export with resolution options, including ruler overlays
Bash
viewer_url="$(
curl -fsSL https://api.github.com/repos/dsafdsaf132/wasm-gerber-viewer/releases/latest |
sed -n '/"browser_download_url": .*\/wasm-gerber-viewer-.*\.tar\.gz"/ {
s/.*"browser_download_url": *"\([^"]*\)".*/\1/p
q
}'
)"
curl -fsSL "$viewer_url" | tar -xz &&
cd wasm-gerber-viewer-* &&
python3 -m http.server 8000Open http://localhost:8000 and upload Gerber files.
PowerShell
$viewerUrl = (
Invoke-RestMethod -Uri "https://api.github.com/repos/dsafdsaf132/wasm-gerber-viewer/releases/latest"
).assets |
Where-Object { $_.name -match '^wasm-gerber-viewer-.*\.tar\.gz$' } |
Select-Object -First 1 -ExpandProperty browser_download_url
Invoke-WebRequest -Uri $viewerUrl -OutFile viewer.tar.gz
tar -xzf viewer.tar.gz
Remove-Item viewer.tar.gz
Set-Location ((Get-ChildItem -Directory -Filter "wasm-gerber-viewer-*" | Select-Object -First 1).FullName)
python -m http.server 8000Open http://localhost:8000 and upload Gerber files.
Use this when you need to rebuild the WASM package locally instead of using the prebuilt release artifact.
Requirements:
- Rust stable - install with rustup
- wasm-pack -
cargo install wasm-pack
rustup target add wasm32-unknown-unknown
wasm-pack build wasm --target web --out-dir pkg --release
./scripts/build-wasm64.shJavaScript, Node.js, and CLI package for rendering Gerber files to PNG.
Node.js and CLI rendering are supported via
node-gles-webgl2.
For the Rust/WASM pipeline and module details, see wasm/README.md.
wasm-gerber-viewer/
├── index.html # Application shell
├── package.json # Project metadata and scripts
├── css/ # UI styles
├── js/
│ ├── main.js # Browser entry point
│ ├── core/ # GerberViewer state and orchestration
│ ├── loading/ # File, archive, URL, repeat, and worker loading
│ ├── layers/ # Layer list UI, filters, colors, and composite bitsets
│ ├── rendering/ # Viewport math, measurements, and screenshot export
│ └── ui/ # Dialogs, DOM lookup, notifications, diagnostics, options
├── vendor/ # Vendored browser libraries
├── packages/
│ └── wasm-gerber-renderer/ # npm package and Node CLI
├── wasm/
│ ├── Cargo.toml # Rust crate manifest
│ ├── README.md # Rust/WASM pipeline notes
│ ├── pkg/ # Generated wasm-pack output (wasm32)
│ ├── pkg64/ # Generated memory64 build (scripts/build-wasm64.sh)
│ └── src/
│ ├── lib.rs # WASM API entry point
│ ├── tests.rs # Crate-level tests
│ ├── geometry/ # Shared geometry model and region contours
│ ├── parser/ # Gerber parser, apertures, commands, and tests
│ ├── drill/ # Excellon/NC drill parser and tests
│ ├── interaction/ # Picking, compact payloads, and highlight data
│ ├── renderer/ # Gerber/composite masks, GPU resources, shaders, tests
│ └── util/ # Formatting and utility helpers
├── demo/ # Sample and performance Gerbers
├── docs/ # README assets
├── scripts/ # Build and deployment scripts
└── .github/workflows/ # CI, deploy, and release workflows
WebGL2 and WebAssembly SIMD are required.
- Chrome / Edge 133+
- Firefox 134+
- Chrome / Edge 96–132
- Firefox 114–133
- Safari 16.4+ / iPhone/iPad browsers: iOS 16.4+
Sample archives are loaded from their upstream sources and are not bundled in this repository.
Sample 1: SparkFun Thing Plus ESP32 WROOM C Panel
- Project: SparkFun Thing Plus ESP32 WROOM C Panel
- Copyright: SparkFun Electronics
- License: CC BY-SA 4.0
- Archive: https://raw.githubusercontent.com/sparkfun/SparkFun_Thing_Plus_ESP32_WROOM_C/main/Hardware/Production/SparkFun_Thing_Plus_ESP32_WROOM_C-Panel.zip
Sample 2: LimeSDR-PCIe
- Project: LimeSDR-PCIe
- Copyright: LimeSDR-PCIe (c) 2016 Lime Microsystems Ltd
- License: CC BY 3.0
- Archive: https://raw.githubusercontent.com/myriadrf/LimeSDR-PCIe/master/hardware/1v3/DFM/LimeSDR-PCIe_1v3_DB_DFMr2.zip
Sample 3: LimeNET-Micro
- Project: LimeNET-Micro
- Copyright: Lime Microsystems Ltd
- License: CC BY 3.0
- Archive: https://raw.githubusercontent.com/myriadrf/LimeNET-Micro/master/hardware/2v1/LimeNet-Micro_2v1-SDR_DB_DFMr2.zip
Sample 4: Zaius EVT3 Motherboard (ODB++)
- Project: Zaius & Barreleye G2
- Copyright: Copyright International Business Machines Corporation 2015
- License: Open Compute Project Hardware License-Permissive (OCPHL-P) v1.0
- Archive: https://media.githubusercontent.com/media/opencomputeproject/zaius-barreleye-g2/master/HW/EE/GBR/EVT/MB/Zaius-EVT3-LAYOUT-MB-ODB-X02-20161226-Final.zip
