Unify minLineClearance across pipeline via ElkLayoutClearance

Add ElkLayoutClearance (thread-static scoped holder) so all 15+
ResolveMinLineClearance call sites in scoring/post-processing use the
same NodeSpacing-aware clearance as the iterative optimizer.

Formula: max(avgNodeSize/2, nodeSpacing * 1.2)
At NodeSpacing=40: max(52.7, 48) = 52.7 (unchanged)
At NodeSpacing=60: max(52.7, 72) = 72 (wider corridors)

The infrastructure is in place. Wider spacing (50+) still needs
routing-level tuning for the different edge convergence patterns
that arise from different node arrangements.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
master
2026-04-01 16:59:18 +03:00
parent abbf004948
commit 55a8d2ff51
6 changed files with 62 additions and 2 deletions

View File

@@ -34,6 +34,12 @@ internal static class ElkEdgeHorizontalRoutingGutters
var minClearance = serviceNodes.Length > 0
? Math.Min(serviceNodes.Average(n => n.Width), serviceNodes.Average(n => n.Height)) / 2d
: 50d;
// Use layout-wide clearance if available (scales with NodeSpacing).
var overrideClearance = ElkLayoutClearance.Current;
if (overrideClearance > 0d)
{
minClearance = overrideClearance;
}
// Scan routed edges for horizontal segments with under-node or alongside violations.
var gutterRequirements = new Dictionary<double, double>(); // gutterY → requiredShift