Add TraceSpacingSolver to enforce obstacle margins before simplification #433
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.
Motivation
OBSTACLE_MARGINby moving them away from other nets and obstacles near the end of the port-point pathing pipeline.MIN_SEGMENT_SIZE = 0.5).Description
TraceSpacingSolveratlib/solvers/TraceSpacingSolver/TraceSpacingSolver.tsthat uses a force-directed algorithm to repel points from segments, vias, and obstacles and recomputes vias after movement.minSegmentSize), applies multiplesubstepForceIterationsper step, and exposes parameters such astraceForceStrength,viaForceStrength,obstacleForceStrength,segmentObstacleForceStrength,damping, andmaxPointDisplacementwith sensible defaults.traceSpacingSolver) inAutoroutingPipelineSolver2_PortPointPathingbeforeTraceSimplificationSolver, wired its visualization into the combined pipeline view, and use its output routes downstream when present.tryFinalAcceptanceto avoid blocking the pipeline.Testing
BUN_UPDATE_SNAPSHOTS=1 bun test tests/e2e3.test.tswhich updated the SVG snapshot and passed the test, and the new DRC assertions reported no errors for that board.getDrcErrors) during development to verify gaps were resolved for thee2e3fixture.bun run formatto normalize code style which completed successfully.bunx tsc --noEmitto typecheck the repo which surfaced pre-existing unrelated type errors intests/core1.test.tsx,tests/core2.test.tsx, andtests/core3.test.tsx(these failures are not caused by this change).Codex Task