R18 route: untangle ports of edges that cross on their way in
Browse files Landed bygrindlemireas add3f36e · with 5 other reviews See in history
Ports on a shared side are ordered from first-pass sketches, which only
see how each route turns next to its port, so two edges arriving from
opposite directions could get each other's port and cross or swap sides
on a shared line. After nudging, uncross tries each such pair with the
ports swapped and with either edge routed first, re-nudges, and keeps
the least tangled result when the diagram has no more crossings, jogs
or shared lines and no more bends than the crossings saved pay for.
snapshot and restore now copy route points: nudging moves them in
place, which changed saved states.