Add Gerber-based PCB short circuit detection#3485
Open
Abse2001 wants to merge 2 commits into
Open
Conversation
seveibar
requested changes
Jun 29, 2026
seveibar
left a comment
Contributor
There was a problem hiding this comment.
Needs rewrite
- reimplementing a ton of geometry checks and gerber types
- implementation for this lives in cli without robust testing
- No bitmap based testing
- Any new shapes etc require new implementation
Do this:
Create repo called check-shorts
Implement robust repros
Use circuit-to-canvas and do “bitmap coloring” using pcb_port and connectivity map keys. If you ever have to recolor with a connectivity map key then you have a short
Include a gerber mode which internally creates RASTERIZED gerbers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Shorts can be introduced or missed if we only inspect pre-Gerber circuit JSON geometry. This check validates the copper geometry that is actually emitted for fabrication, including traces, pads, vias, plated holes, and copper pours.
Implementation
Added tsci check short [file].
Generates Gerber ZIP output for the checked board.
Reconstructs copper primitives from Gerber commands:aperture flashes
stroked traces
filled regions
copper-pour clear regions/cutouts
Detects same-layer intersections between copper assigned to different nets.
Adds Gerber X2 net metadata using %TO.N,% / %TD.N%.
Uses X2 net metadata during analysis when present.
Falls back to circuit-json geometry matching for object/net association.
Splits short-check registration, analysis, and geometry helpers into dedicated files following CLI command conventions.