News for hackers. Stuff that matters.
Re:Flattening Bézier Curves and Arcs by raphlinus on Thursday April 11, 2024 @09:06PM (#40008478)
It's... ok.

What kurbo does is lower to quadratic Béziers[1], then the analytic solution to nearest for a quadratic Bézier is the solution to a cubic equation[2].

I'm not sure this is the best possible answer, but it's at least pretty good, and certainly better than flattening to lines.

And I'd like for people to get in the habit of checking kurbo; the intent is for it to always have the best in class algorithm.

[1]: https://docs.rs/kurbo/latest/src/kurbo/cubicbez.rs.html#647-...

[2]: https://docs.rs/kurbo/latest/src/kurbo/quadbez.rs.html#297-3...

Re:Flattening Bézier Curves and Arcs by CrimsonCape on Tuesday April 16, 2024 @01:19PM (#40054652)
Thanks for point out kurbo.

Another question(s): What is your opinion of Sederberg's CAGD publication? Has that publication had tangible mapping to your API designs? If so, what percentage of that publication (in your opinion) would be exposed as API in an ideal CAGD API?

I'm sure there's an art to what should be in an API and I have limited understanding of how the math maps to actual needed implementation.