fix: remove zero-length trace segments from duplicate consecutive points (#78)#396
Open
voltrace-io wants to merge 2 commits into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…nts in simplifyPath Root cause: _applyBestRoute() in UntangleTraceSubsolver splices rerouted segments into the original trace path, which can produce consecutive duplicate boundary points. These zero-length segments survive the collinear-collapse pass and render as extra trace lines in the schematic. Fix: Added removeDuplicateConsecutivePoints() to strip identical adjacent points before each collinear-collapse pass in simplifyPath(). The function runs dedup-collapse-dedup-collapse-dedup to ensure all zero-length segments are eliminated regardless of ordering. Tests: 8 new unit tests for duplicate point removal. Updated example35 snapshot (35 fewer SVG lines, confirming extra trace removal). Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
0202790 to
95fc820
Compare
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.
Summary
Fixes #78 — extra trace lines in post-processing step.
Root cause:
_applyBestRoute()inUntangleTraceSubsolversplices rerouted segments into the original trace path, which can produce consecutive duplicate boundary points. These zero-length segments survive the existing collinear-collapse pass insimplifyPathand render as extra trace lines in the schematic output.Fix: Added
removeDuplicateConsecutivePoints()to strip identical adjacent points (within floating-point epsilon) before each collinear-collapse pass insimplifyPath(). The function alternates dedup→collapse→dedup→collapse→dedup to ensure all zero-length segments are eliminated regardless of ordering.Result: example35 snapshot reduced by 35 SVG lines, confirming extra trace removal.
/claim #78
Review & Testing Checklist for Human
bun test— should see 67 pass, 4 skip, 0 failremoveDuplicateConsecutivePointsdoes not incorrectly merge nearby but distinct points in dense schematicsNotes
simplifyPathis called during the post-processing cleanup pipeline, so this fix applies to all traces automatically