docs(elksharp): document post-routing visual quality pipeline
Add AGENTS.md sections for the four late-stage post-processing steps (SpreadOuterCorridors, CollapseOrthogonalBacktracks, ExtendShortApproachSegments, ReduceLineNodeProximity) and the SVG bridge gap detection corner radius rationale. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -48,6 +48,18 @@
|
||||
- Under-node alongside detection extends the standard gap > 0.5px check to include flush edges (gap >= -4px and <= 0.5px for bottom, same for top). This catches edges "glued" to node boundaries.
|
||||
- Target-join spread pushes convergent approach lanes apart by minClearance - currentGap + 8px (half applied to each edge). The spread runs as a final winner refinement step and uses weighted score comparison (Score.Value) for promotion.
|
||||
|
||||
## Post-routing visual quality pipeline
|
||||
The following steps run at the end of `ElkSharpLayeredLayoutEngine` after `Optimize()` returns, in order:
|
||||
- `SpreadOuterCorridors`: enforces minimum gap between adjacent above-graph corridors. Splits shared-Y lanes when edges have overlapping X ranges (>40px overlap). Pushes End-bound corridors below all repeat-return corridors into a separate visual tier.
|
||||
- `CollapseOrthogonalBacktracks`: detects and removes U-turn loops (right-left-right backtracks) in non-corridor edges. Only accepts if the collapsed path introduces no new shared lane violations.
|
||||
- `ExtendShortApproachSegments`: extends short final approach segments to half the average node width (~101px). Shifts the penultimate vertical bend point, capped at 80% of feasible horizontal space. Skips diagonal gateway approaches.
|
||||
- `ReduceLineNodeProximity`: pushes edge segments away from non-source/non-target nodes when within minClearance. Validates no new crossings, shared lanes, or target-join violations.
|
||||
|
||||
These steps are additive cosmetic passes — they never regress hard routing defects (node crossings, under-node, shared lane, boundary slot, target join, gateway source exit, backtracking).
|
||||
|
||||
## SVG bridge gap detection
|
||||
The SVG renderer uses a 12px corner radius for bridge gap (crossing cut) detection via `EnumerateEffectiveSegments`. This is intentionally smaller than the visual 40px corner radius to ensure crossings on shorter segments near bends are still detected and drawn with the visual cut effect.
|
||||
|
||||
## Testing
|
||||
- Run the targeted workflow renderer test project for ElkSharp changes.
|
||||
- Add regression tests for geometry-sensitive behavior before broad refactors.
|
||||
|
||||
Reference in New Issue
Block a user