Add DRC error when routed trace is thinner than requested#132
Add DRC error when routed trace is thinner than requested#132seveibar merged 12 commits intotscircuit:mainfrom
Conversation
seveibar
left a comment
There was a problem hiding this comment.
include a pcb snapshot with error display on for the test, too difficult to know if this works etc. as is
can i add a repro3 ? |
seveibar
left a comment
There was a problem hiding this comment.
very good! can we make it a warning? would like to see the coordinate
|
yes ! sounds logic ! |
| ] | ||
| }), | ||
| ) | ||
| .at(0) |
There was a problem hiding this comment.
this is inefficient, use a regular loop and break early, you're finding all the segments then taking .at(0) at the end
| sourceTrace.display_name && | ||
| !containsCircuitJsonId(sourceTrace.display_name) | ||
| ? sourceTrace.display_name | ||
| : "trace" |
There was a problem hiding this comment.
we're not allowing this anymore. It leaves a bad error message- you have to always have a presentable name, there should be a function for getting a display name, "trace" is never acceptable
| : "trace" | ||
|
|
||
| warnings.push({ | ||
| type: "pcb_trace_thickness_warning", |
There was a problem hiding this comment.
this needs to be defined in the circuit-json specification, make sure to do a PR over there, then make sure you're constructing this warning in a typesafe way
seveibar
left a comment
There was a problem hiding this comment.
very good, just need the type for the warning
seveibar
left a comment
There was a problem hiding this comment.
This is good but it cant be a part of runAllRoutingChecks yet, because there’s nothing for thebuser to act on and it doesnt prohibit manufacturing
|
making sense |
|
|
||
| expect(standaloneWarnings).toHaveLength(1) | ||
| expect(routingIssues).toEqual([]) | ||
| }) |
There was a problem hiding this comment.
you should remove this test- it's confusing to have an exclusion test
seveibar
left a comment
There was a problem hiding this comment.
Can merge after removing that one test case
|
Thank you for your contribution! 🎉 PR Rating: ⭐⭐ Track your contributions and see the leaderboard at: tscircuit Contribution Tracker |
Motivation
Right now, if the autorouter cannot honor an explicit trace thickness because of clearance limits, it quietly routes a thinner trace with no feedback. That makes routing results misleading and hard to debug. Showing an error makes the problem visible and helps users understand that their requested thickness was not actually achieved.
This change adds a routing check that reports a pcb_trace_error when a trace is routed thinner than its explicit requested thickness. Instead of silently accepting a narrower routed trace, the checker now surfaces the mismatch as a DRC-style error.