According to the rules the minimum distance is 10 cm (to any edge of the field, not to other lines).
It is up to the field designer to make the layout of the line feasible. We are thinking of writing guidelines for the designer to avoid such situations that you are thinking about.
I would recommend to not have closer to 10 cm to any other line as well, and count the gap as a "imaginary line", i.e.not closer than 10 cm between a line and a gap.
// Fredrik Löfgren, TC and OC member 2016 / 2017