feat(elksharp): A* node proximity cost, increased layer spacing, bridge gap curve awareness, post-pipeline clearance enforcement
Three-layer edge-node clearance improvement: 1. A* proximity cost with correct coordinates: pass original (uninflated) node bounds to ComputeNodeProximityCost so the pathfinder penalizes edges near real node boundaries, not the inflated obstacle margin. Weight=800, clearance=40px. Grid lines added at clearance distance from real nodes. 2. Default LayerSpacing increased from 60 to 80, adaptive multiplier floor raised from 0.92 to 1.0, giving wider routing corridors between node rows. 3. Post-pipeline EnforceMinimumNodeClearance: final unconditional pass pushes horizontal segments within 8px of node tops (12px push) or within minClearance of node bottoms (full clearance push). Also: bridge gap detection now uses curve-aware effective segments (same preprocessing + corner pull-back as BuildRoundedEdgePath) so gaps only appear at genuine visual crossings. Collector trunks and same-group edges excluded from gap detection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -20,6 +20,7 @@ internal static partial class ElkEdgeRouterIterative
|
||||
baseObstacleMargin,
|
||||
Math.Max(strategy.MinLineClearance + 4d, strategy.RoutingParams.Margin));
|
||||
var obstacles = BuildObstacles(nodes, obstacleMargin);
|
||||
var originalNodeBounds = BuildOriginalNodeBounds(nodes);
|
||||
var graphMinY = nodes.Length > 0 ? nodes.Min(n => n.Y) : 0d;
|
||||
var graphMaxY = nodes.Length > 0 ? nodes.Max(n => n.Y + n.Height) : 0d;
|
||||
var nodesById = nodes.ToDictionary(n => n.Id, StringComparer.Ordinal);
|
||||
@@ -74,6 +75,7 @@ internal static partial class ElkEdgeRouterIterative
|
||||
startPoint,
|
||||
adjustedEndPoint,
|
||||
obstacles,
|
||||
originalNodeBounds,
|
||||
edge.SourceNodeId ?? "",
|
||||
edge.TargetNodeId ?? "",
|
||||
strategy.RoutingParams,
|
||||
|
||||
Reference in New Issue
Block a user