back

by raphlinus·3y ago·view on hn ↗
It is optimizing for the shape, and the parametrization is not guaranteed to match at all. Whether this is a good thing or a bad thing depends on your application. If you just want the parallel curve, then it's a good thing, as you're putting all possible degrees of freedom into making the curve more accurate (this is why you get O(n^6) scaling). If, say, you wanted to interpolate between the original and the offset, for example adding a grade axis to a variable font, it's a bad thing, as the two curves are not necessarily "interpolation compatible." It's not clear to me which of those you care about :)

I could add a correspondence visualization (I thought about something similar when describing the error measurement technique), but you can also see it pretty clearly by looking at the lengths of the control arms. That's easiest to see when accuracy is set to infinity.

1 comments
Thinking about this a bit more. If you want an interpolation compatible offset, reduce the search to a one dimensional problem by fixing the area. This gives a simple rational formula for the length of one control arm as a function of the other. Then pick the value of that to minimize your error metric, for which least squares is probably the easiest to solve. I expect this will give you O(n^5) scaling.

I'll probably implement this, as it's very likely what you want in the variable font case.