Disambiguate closest boundary segments, could solve #50