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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user