Skip to content

fix(post-processing): eliminate duplicate and extraneous trace lines (#78) - #837

Open
gcoinstash-cmd wants to merge 1 commit into
tscircuit:mainfrom
gcoinstash-cmd:fix/extra-trace-lines-post-processing
Open

fix(post-processing): eliminate duplicate and extraneous trace lines (#78)#837
gcoinstash-cmd wants to merge 1 commit into
tscircuit:mainfrom
gcoinstash-cmd:fix/extra-trace-lines-post-processing

Conversation

@gcoinstash-cmd

Copy link
Copy Markdown

Description

Implements robust post-processing path simplification in simplifyPath to eliminate redundant intermediate collinear segments and deduplicate consecutive identical vertices.

Fixes #78
/claim #78

Key Changes

  • Point Deduplication: Added pointsEqual with epsilon tolerance (1e-6) to prune consecutive duplicate points.
  • Collinear Pruning: Added isCollinear using cross-product checks across orthogonal and arbitrary angle segments.
  • Fixed-Point Iteration: Implemented an iterative reduction loop to prune cascading collinear points across complex multi-turn routes.
  • Test Suite: Created tests/solvers/TraceCleanupSolver/simplifyPath.test.ts covering zigzag routes, collinear diagonals, and edge cases.

Verification

  • All 193 unit tests passed (0 failures).

@vercel

vercel Bot commented Aug 19, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
schematic-trace-solver Ready Ready Preview Aug 19, 2026 10:40pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix extra trace lines in post-processing step

1 participant