Hacker News new | ask | show | jobs
by LegionMammal978 311 days ago
That doesn't sound right, nearest-point queries for cubic Béziers take at least a quintic solver, and this library uses a subdivision-based algorithm with Bernstein polynomials that is seemingly designed to work with any degree [0]. (Or at least, it doesn't have any code that complains when the degree is too large.)

[0] https://github.com/GraphiteEditor/Graphite/blob/master/libra...

1 comments

Reference sounds interesting but I’m getting 404 there.
My apologies, it looks like it was switched over [0] to an external root-finder crate poly-cool [1] soon after I wrote my comment. (I should know better than to link to branches directly, but there weren't any useful tags on the repo, so I got lazy. For reference, I was trying to link to [2].)

Curiously, the poly-cool crate appears to use the monomial basis instead of the Bernstein basis that the old version was using.

[0] https://github.com/GraphiteEditor/Graphite/pull/3031

[1] https://crates.io/crates/poly-cool

[2] https://github.com/GraphiteEditor/Graphite/blob/beb1c6ae6489...

Interesting, thanks!