Skip to content

fix: allow edge-contact copper for off-board components - #235

Draft
KrishnaX12 wants to merge 1 commit into
tscircuit:mainfrom
KrishnaX12:fix/allow-off-board-edge-contact-clearance
Draft

fix: allow edge-contact copper for off-board components#235
KrishnaX12 wants to merge 1 commit into
tscircuit:mainfrom
KrishnaX12:fix/allow-off-board-edge-contact-clearance

Conversation

@KrishnaX12

Copy link
Copy Markdown

Summary

Fixes #228 by skipping the copper-to-board-edge clearance check for copper elements (SMT pads and plated holes) belonging to components marked allowOffBoard (is_allowed_to_be_off_board: true).

Problem

An SMT pad or component intentionally placed at or over the board boundary (such as an edge contact / finger jumper) was reported as violating the copper-to-board-edge clearance rule because checkCopperToBoardEdgeClearance did not check is_allowed_to_be_off_board on the owning pcb_component.

Solution

  1. In lib/check-copper-to-board-edge-clearance.ts, collect component IDs with is_allowed_to_be_off_board === true.
  2. Skip copper elements (pcb_smtpad, pcb_plated_hole) whose pcb_component_id matches an allowed off-board component.
  3. Update tests/repros/repro-edge-contact-pad-clearance.test.tsx from test.failing to test with an inline snapshot assertion expect(errors).toMatchInlineSnapshot("[]").

Verification

  • bun test tests/repros/repro-edge-contact-pad-clearance.test.tsx passes
  • bun test passes (183 pass, 0 fail across 81 files)
  • bun run format and bun run build pass cleanly

@KrishnaX12

Copy link
Copy Markdown
Author

Visual & Snapshot Verification

  • Diagnostic Output: checkCopperToBoardEdgeClearance now returns [] (0 errors) when allowOffBoard is set on the component. Added inline snapshot expect(errors).toMatchInlineSnapshot("[]").
  • Board Geometry: The $2\text{mm} \times 7\text{mm}$ SMT pad is placed $0.01\text{mm}$ from the bottom board edge outline.
  • Test Suite: All 183 tests pass cleanly.

@KrishnaX12
KrishnaX12 marked this pull request as draft August 24, 2026 12:01
@KrishnaX12
KrishnaX12 force-pushed the fix/allow-off-board-edge-contact-clearance branch from 24d81e7 to ae7487e Compare August 25, 2026 13:03
@KrishnaX12
KrishnaX12 force-pushed the fix/allow-off-board-edge-contact-clearance branch from ae7487e to c7f5eb8 Compare August 25, 2026 13:15
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