[TG] Added sorting by ideal path intersections #marginalimprovements
MERGE