Skip to content

fix: derive KiCad project design rules from exported traces and vias#208

Open
techmannih2 wants to merge 1 commit intotscircuit:mainfrom
techmannih2:pp
Open

fix: derive KiCad project design rules from exported traces and vias#208
techmannih2 wants to merge 1 commit intotscircuit:mainfrom
techmannih2:pp

Conversation

@techmannih2
Copy link
Copy Markdown
Contributor

No description provided.

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 18, 2026

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

Project Deployment Actions Updated (UTC)
circuit-json-to-kicad Ready Ready Preview, Comment Apr 18, 2026 2:10am

Request Review

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 50b1ffa2b9

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

}
}

return [...clearances].sort((a, b) => a - b)[0] ?? 0
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Fall back to a safe clearance when none is inferred

collectTraceClearance() returns 0 whenever the circuit has no pcb_group.autorouter_configuration.trace_clearance, and that zero is propagated into the Default netclass and board rule clearances. For common inputs that have routed traces but no pcb_group, this effectively disables spacing checks in the exported project, so KiCad can permit zero-clearance routing/zone behavior; use a nonzero fallback when no explicit clearance is available.

Useful? React with 👍 / 👎.

Comment on lines +209 to +210
const DEFAULT_VIA_DIAMETER = 0.6
const DEFAULT_VIA_DRILL = 0.3
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Match project via defaults to PCB fallback via sizes

The fallback defaults here (0.6 / 0.3) diverge from the PCB exporter fallback (0.8 / 0.4 in lib/pcb/stages/AddViasStage.ts:191-192). When via sizes are absent in Circuit JSON and cannot be inferred, .kicad_pro and .kicad_pcb end up with different default via geometry, so continuing routing in KiCad can create vias that do not match the sizes used in the exported board.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

@mohan-bee mohan-bee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@techmannih i think the motivation of this change is exposing the DRC setting config from the converter.

in my opinion we are forcing the kicad to valid our invalid design.

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.

2 participants