My input are two polylines -- I had one polyline and I computed offset of it, similarly to polygons. Here is the useful post: https://stackoverflow.com/questions/1109536/an-algorithm-for-inflating-deflating-offsetting-buffering-polygons
So I have to correct polylines, however the number of vertices (and segments) can vary, consider such polyline:
A\ /D \__/ B C
After offsetting it up ("inside") I could get
A'\ /C' \/ B'
The horizontal segment is gone.
My task is to add in source or target polyline empty segments (i.e. duplicate vertices) in such way that the number of vertices is the same, and that I could iterate over one polyline and can get its counterpart in the other polyline just by index (no computation during "get").
In the case above I should get two polylines -- A, B, C, D (no change here) and A', B', B', C' (B' is duplicated).
I hope my question is clear. Now -- how to add "missing" vertices?