Fix NaN KiCad segments from through_obstacle trace route points#291
Open
mohan-bee wants to merge 3 commits intotscircuit:mainfrom
Open
Fix NaN KiCad segments from through_obstacle trace route points#291mohan-bee wants to merge 3 commits intotscircuit:mainfrom
mohan-bee wants to merge 3 commits intotscircuit:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
seveibar
reviewed
May 7, 2026
| this.pcbTraces = this.ctx.db.pcb_trace.list() | ||
| } | ||
|
|
||
| private getRoutePointPosition(point: any, edge: "start" | "end") { |
seveibar
reviewed
May 7, 2026
| typeof position?.x !== "number" || | ||
| typeof position?.y !== "number" || | ||
| !Number.isFinite(position.x) || | ||
| !Number.isFinite(position.y) |
Contributor
There was a problem hiding this comment.
undo all this typeof nonsense and isFinite etc., use proper imported types- this isn't the right module for this fix as well- the fix should be in core and requires a circuit json spec change CC @AnasSarkiz
Contributor
Author
There was a problem hiding this comment.
ok, yes maye be in core let me try to debug there in core also, learning stuffs.. 😄
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
closes #290
This fixes a KiCad export bug where through_obstacle entries in pcb_trace.route could generate invalid segments like (end NaN NaN).
AddTracesStage now reads coordinates from either top-level x/y route points or start/end route points, and skips invalid or zero-length segments.
Also adds a focused regression test for through_obstacle route points to ensure the exporter no longer emits NaN in generated .kicad_pcb output.
Board rendering successfully: