Skip to content

Conversation

@0hmX
Copy link
Contributor

@0hmX 0hmX commented Dec 24, 2025

Motivation

  • The board outline (cutout) was not consistently respected because board-void rectangles were not always present in the per-layer obstacle RBush indexes.
  • When solver snapshots are rehydrated or an obstacle index is provided externally, the board mask might be missing and free-space seeds can appear inside cutouts.
  • The intent is to ensure the board-outline mask is treated as obstacles so seeding and expansion honor the outline.

Description

  • Add a helper ensureBoardVoidRectsInObstacleIndex to inject board void XYRects into obstacleIndexByLayer (RBush) arrays without duplicating entries.
  • Call this helper from RectDiffSeedingSolver during setup and from RectDiffExpansionSolver when preparing obstacle indexes so both phases consistently include the board mask.
  • Keep the helper and call sites type-safe by operating on Array<RBush<RTreeRect>> and using rectToTree/sameTreeRect to dedupe.

Testing

  • Ran type-checking with bunx tsc --noEmit which completed successfully with no errors.
  • Ran the test suite with bun test and all automated tests passed (11 pass, 1 skip, 0 fail), including tests/board-outline.test.ts which verifies the outline behavior.
  • The changes were committed with message Ensure board void rects in obstacle index.

Codex Task

@vercel
Copy link

vercel bot commented Dec 24, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
rectdiff Ready Ready Preview, Comment Dec 24, 2025 8:37pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants