Fixes #78
When UntangleTraceSubsolver._applyBestRoute() reroutes L-shaped corners, it concatenates path segments:
const newTracePath = [
...originalTrace.tracePath.slice(0, p2Index),
...bestRoute,
...originalTrace.tracePath.slice(p2Index + 1),
]
This can produce duplicate consecutive points at the junctions (where the old path meets the rerouted segment), which render as zero-length extra trace line segments in the schematic output.
UntangleTraceSubsolver: Added removeDuplicateConsecutivePoints() after path concatenation in _applyBestRoute() to strip duplicate junction pointssimplifyPath: Enhanced with duplicate consecutive point preprocessing before the existing collinear point removalThose PRs applied the full simplifyPath (including collinear removal) in _applyBestRoute(), which changed the timing of path simplification relative to downstream minimizeTurns and balanceZShapes — causing the example29 snapshot to change. This was seen as a regression.
This PR applies only duplicate point removal in _applyBestRoute(), which is the minimal fix needed. Collinear simplification still happens at the correct time downstream. Zero existing snapshots change.
simplifyPath covering duplicates, collinear points, and combined casesexample_issue78): NE555 timer circuit with J1 connector and maxMspPairDistance=6, verifying all trace paths are clean (no duplicates, no collinear intermediate points)/claim #78
🤖 Generated with Claude Code
AI Disclosure: This PR was developed using Claude Code (claude-opus-4-6). All code was reviewed and tested before submission.
makaiachildress-web
@makaiachildress-web
tscircuit
@tscircuit