Seems to work but ...

Here is the last version I have work on today, not 100% ok with it as it has some little error considering the links between the headland lanes. It also need a lot off cleaning, and renaming on some functions but it works, the offsetting routine works perfectly and is fast.