5 ms·
For quadratic beziers, another approach I’ve seen is described here https://microbians.com/math/Gabriel_Suchowolski_Quadratic_bezier_offsetting_with_selective_s
by flaminghero 4y ago
For quadratic beziers, another approach I’ve seen is described here https://microbians.com/math/Gabriel_Suchowolski_Quadratic_bezier_offsetting_with_selective_subdivision.pdf https://microbians.com/math/Gabriel_Suchowolski_Quadratic_be... (similarly here as well https://blend2d.com/research/precise_offset_curves.pdf https://blend2d.com/research/precise_offset_curves.pdf). I’ve used this in the past for a hobby project with very good performance and results.
Since a cubic bezier can always be approximated by quadratics maybe that approach could also be used.
- raphlinus 4y agoYes, and I should probably add those links. Quadratics get you O(n^4) scaling, which is pretty good. Figuring out where to put the control point is easy, there's basically only one place it can go if you want to preserve tangents. Deciding where to subdivide is a little trickier, and Suchowolski's approach looks pretty good to me. You do still need to deal with cusps though. You can of course change curve representations (I did that with the Euler approach), but there are downsides. Just how bad depends on the application. One place where you really want to stay in a cubic representation is in a font or vector graphics editor. If you just want to add a little weight to the font, ideally you don't want the structure to change, or lots of new control points to appear. In other applications it might be fine though.