merge_edge is only meant to be used when the new combined curve covers the exact same path as the old curve. If you are using line segments as your curves, this means the three vertices involved (the middle vertex is the one to be deleted) are collinear.
Can merge_edge be abused to remove edges that bend? Yes, sort of, if you are very careful:
- You must verify that the new combined edge does not cross any other edges, and will be in the same face as the existing two edges. This limits how much you can move an edge by combining. Basically merge_edge can't change topology!
- The two half-edges being merged must go in the same direction! Otherwise, the half-edge direction flag could be wrong after the merge.