I keep on doing jobs that involve path offsets
I've set out more roads and machine tooling paths than I can count, and now I'm designing font glyphs! So perhaps I can help.
I just implemented my own method, similar to the Tiller-Hanson algorithm. They don't seem too difficult to come up with -- almost not worth tying anyone's name to the algorithm!
The above answer is already pretty good so I'll just describe mine as a variation on Tiller-Hanson.
Let C be the intersection of the red tangents.
Let D, E, F be the points that generate A, B, C when the hull is offset.
Let b and r be tangent points at the left-hand ends.
(b & r for blue and red, and lower case to avoid conflict)
Notice in the diagram that position of A on the line (r, C) is proportionately much less than its blue equivalent, the position of D on the line (b, F).
In other words, the ratio (A - r) : (C - r) has visibly decreased, as this particular offset occurs.
The difference is simply that my ratio stays constant.
For the quadratic case this turns out to be identical to Tiller-Hanson; the control point is simply the intersection, and the ratio remains 1:1 in both algorithms.
In cubic (or greater) cases I believe it has some advantages. The resulting operation on the hull is actually much simpler than a linear offset to implement, and it seems better in many ways that when the curve is offset in the inward direction, the control lines never vanish until the curve itself does.
Of course the two methods share many dangers in common, like most offsetting algorithms. Both methods really require a bit of curve subdivision first, to make them more accurate, and in both, you still have to cope with vanishing path segments. In fact for a cubic or greater order, subdivisions of the curve can vanish too.
I recommend (but have yet to implement) reducing the orders of subdivisions to below that of the whole curve. Yes, it compromises accuracy before it's strictly necessary, but in a computationally very sensible way.
This section will be edited down once I can comment. I haven't been on this particular 'stack' site for long.
I usually try not to respond to other answers but as I already based mine on the above, and called it 'pretty good' I will take issue with three things.
Keep splitting until you're happy.
Well, that sounds dangerous for at least some of us, who have yet to implement a way to deal with vanishing path segments on an inward offset. Subdivisions near the ends of the curve can cause serious problems if they're comparable to the size of the offset.
Perhaps we should mention that not many subdivisions should be necessary to make the curve look "excellent".
You will certainly have to split the original curves at inflexion
points, if any, for example.
No you won't certainly have to, and identifying inflexion points involves square roots; we don't know how performance-critical this code is.
And lastly, at least the first link is poor quality. It opened a rudely obtrusive aspx page that kept opening other tabs and windows! Sorry for the criticism; perhaps it's gone downhill and could be revised; maybe the others are better and it was just bad luck that the first one put me off them all. But I'm sure there's better out there. It was hard to read even when I could keep the focus on it!
Otherwise thankyou. Great diagram, it's concise compared to mine, and has good searchable terms and names that will probably benefit me even after years of thinking I was good at this.