fix: derive KiCad project design rules from exported traces and vias#208
fix: derive KiCad project design rules from exported traces and vias#208techmannih2 wants to merge 1 commit intotscircuit:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 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 |
There was a problem hiding this comment.
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 👍 / 👎.
| const DEFAULT_VIA_DIAMETER = 0.6 | ||
| const DEFAULT_VIA_DRILL = 0.3 |
There was a problem hiding this comment.
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 👍 / 👎.
mohan-bee
left a comment
There was a problem hiding this comment.
@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.
No description provided.