Added a simpler algorithm to increase robustness of projectEdge for line cases.