I made some test with current master brach (same code as alpha4), and this is the result:

As you can see it's not perfect, but there are improvements over the images you have attached
I added a patch in master branch code, and the result is:

All are polylines. Red are original drawn from left to right
Yellow are original drawn from right to left.
And white resulting polylines from offset