fix: remove duplicate consecutive points causing extra trace lines in post-processing#189
Open
LuSrodri wants to merge 2 commits intotscircuit:mainfrom
Open
fix: remove duplicate consecutive points causing extra trace lines in post-processing#189LuSrodri wants to merge 2 commits intotscircuit:mainfrom
LuSrodri wants to merge 2 commits intotscircuit:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Problem\n\nExtra zero-length trace segments appear in the schematic output when
_applyBestRoute()splices a rerouted segment into an existing trace path. The splice produces duplicate consecutive coordinates at the junction (the last point of the left slice equals the first point ofbestRoute), which renders as a tiny extra line artifact.\n\nsimplifyPath()also lacked protection: if duplicate consecutive points reached the collinear-merge pass, the direction test would see a zero-length segment and behave incorrectly.\n\n## Fix\n\nAddedremoveDuplicateConsecutivePoints()tosimplifyPath.ts(also exported for direct use):\n-simplifyPathnow calls it as a pre-pass before the collinear-merge loops, so zero-length segments are stripped regardless of origin.\n-UntangleTraceSubsolver._applyBestRoutewraps the spliced path withremoveDuplicateConsecutivePointsat the splice site, fixing the root cause.\n\n## Files\n\n| File | Change |\n|------|--------|\n|lib/solvers/TraceCleanupSolver/simplifyPath.ts| Added exportedremoveDuplicateConsecutivePoints; call it at start ofsimplifyPath|\n|lib/solvers/TraceCleanupSolver/sub-solver/UntangleTraceSubsolver.ts| Import and applyremoveDuplicateConsecutivePointsin_applyBestRoute|\n|tests/functions/simplifyPath.test.ts| New unit tests forremoveDuplicateConsecutivePointsand updatedsimplifyPathbehaviour |\n\n/claim #78