fix: implement coordinate snapping and path simplification to ensure …#280
Open
MaelProgramming wants to merge 1 commit into
Open
fix: implement coordinate snapping and path simplification to ensure …#280MaelProgramming wants to merge 1 commit into
MaelProgramming wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Author
Contributor
|
@MaelProgramming based on your video seems broken no? Also why are there no tests or snapshots? |
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.
This PR addresses issue #34 regarding misaligned or "jittery" traces in the schematic.
Key Changes:
Fuzzy Snapping: Implemented a snapToGrid function with a 0.01 tolerance to force points onto integer coordinates when the offset is negligible.
Path Simplification: Integrated simplifyPath into the solver pipeline to remove redundant points on straight segments.
Direct Injection: The fix is applied in SchematicTraceLinesSolver right when the path is validated, ensuring all rendered traces are perfectly orthogonal.
Visual Validation
The fix has been validated using React Cosmos with the SchematicTraceLinesSolver02 fixture. As shown in the attached video, the traces are now perfectly straight and the pixel offsets from #34 are gone.
Checklist
[x] TypeScript Build OK (pnpm run build).
[x] Biome Formatting OK (pnpm run format).
[x] Visually verified via Cosmos fixtures.
/claim #34