|
|
|
|
|
by raphlinus
802 days ago
|
|
Cool to see! The tweak suggested in the blog post when you're near the vertex of the parabola is valid, and the implementation that was in Vello did something very similar. This is also the flatten algorithm that's in kurbo[1], and the code for that is probably the most accessible source for the ideas. However, if approaching this again I'd suggest placing a subdivision point at the vertex, which will also handle the degenerate colinear case; I now have reason to believe that the error metric that all this is based on works for monotonic curvature, and can fail otherwise. I say "was" as the new version in Vello is much more sophisticated, and handles both flattening and stroke expansion, all on the GPU. A paper is in the works, and I'll post it to HN when it's ready. [1]: https://docs.rs/kurbo/latest/kurbo/struct.BezPath.html#metho... |
|
Aside from seeming like a good solution, would you go that route?