Skip to content

repro(svg): Elk Pi polygon cutout is painted over copper - #132

Closed
KrishnaX12 wants to merge 1 commit into
tscircuit:mainfrom
KrishnaX12:repro/board-and-polygon-cutout-clipping
Closed

repro(svg): Elk Pi polygon cutout is painted over copper#132
KrishnaX12 wants to merge 1 commit into
tscircuit:mainfrom
KrishnaX12:repro/board-and-polygon-cutout-clipping

Conversation

@KrishnaX12

@KrishnaX12 KrishnaX12 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Problem

PCB polygon and board cutouts are rendered as board-colored shapes painted over copper instead of being subtracted from copper geometry.

This makes the result look correct only while the overlay remains visible. The underlying copper pour is still continuous across the forbidden area, so layer visibility, opacity, ordering, and downstream SVG use expose solid copper where a real opening should exist.

Real-board reproduction

This PR strengthens the existing Elk Pi real-board regression in:

  • fixture: references/elk-pi.PcbDoc
  • test: tests/svg/elk-pi-polygon-cutout-detail.test.ts
  • snapshot: tests/svg/__snapshots__/elk-pi-polygon-cutout-detail.snap.svg

The selected crop naturally contains filled top-copper pour regions overlapping a multilayer POLYGON_CUTOUT.

The test and snapshot record the current broken behavior:

  1. The top-copper region is emitted as filled copper.
  2. The cutout is emitted later as a separate fill="#123d32" board-colored path.
  3. The visual snapshot shows that path acting as an overlay rather than a hole in the copper geometry.

The existing snapshot is included in this PR with reproduction-specific SVG title and accessibility metadata. No synthetic board, new fixture, or duplicate snapshot is added.

Expected behavior

Board cutouts, polygon cutouts, and relevant keepout geometry should be subtracted from copper pours. The resulting copper path should contain a genuine hole, normally represented by combined path geometry with an appropriate fill rule, instead of relying on a board-colored patch.

Testing

  • Focused Elk Pi SVG test passes.
  • Formatting, typecheck, lint, and package build pass.
  • Lint retains one pre-existing warning in schematic-component-value-reference.test.ts.

@vercel

vercel Bot commented Sep 4, 2026

Copy link
Copy Markdown

@KrishnaX12 is attempting to deploy a commit to the tscircuit Team on Vercel.

A member of the Team first needs to authorize it.

@KrishnaX12
KrishnaX12 force-pushed the repro/board-and-polygon-cutout-clipping branch from 2f929c6 to 11d57ac Compare September 4, 2026 16:00
@KrishnaX12

Copy link
Copy Markdown
Contributor Author

Closing this reproduction because further inspection showed that the Elk Pi copper Region geometry already contains the polygon cutout. Removing the board-colored POLYGON_CUTOUT
overlay still leaves the cutout area clear, so the overlay is not hiding a solid copper pour underneath. PR #125 covers the separate board-cutout visibility case.

@KrishnaX12 KrishnaX12 closed this Sep 4, 2026
@KrishnaX12
KrishnaX12 deleted the repro/board-and-polygon-cutout-clipping branch September 4, 2026 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant