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:
@@ -158,6 +158,12 @@ internal static partial class ElkEdgeRouterIterative
|
||||
|
||||
private static double ResolveMinLineClearance(IReadOnlyCollection<ElkPositionedNode> nodes)
|
||||
{
|
||||
var overrideClearance = ElkLayoutClearance.Current;
|
||||
if (overrideClearance > 0d)
|
||||
{
|
||||
return overrideClearance;
|
||||
}
|
||||
|
||||
var serviceNodes = nodes.Where(node => node.Kind is not "Start" and not "End").ToArray();
|
||||
return serviceNodes.Length > 0
|
||||
? Math.Min(serviceNodes.Average(node => node.Width), serviceNodes.Average(node => node.Height)) / 2d
|
||||
|
||||
Reference in New Issue
Block a user