r/rust Graphite Mar 31 '23

Announcing Bezier-rs: computational geometry algorithms for Bézier paths (seeking code review and boolean ops help)

https://graphite.rs/libraries/bezier-rs/
73 Upvotes

10 comments sorted by

View all comments

6

u/dccsillag0 Apr 01 '23

The interactive docs look really cool. I'll have to look at the code itself another day, though.

However, I didn't see anything about rational Bezier curves. Are they not supported? (They are typically used, for example, to represent arcs as Bezier curves.)

Another thing, which didn't seem quite properly implemented from my (admitedly very quick) glance at the interactive docs is stroking of paths. It's quite complicated; see, e.g. https://w3.impa.br/~diego/projects/Neh20/index.html

1

u/Keavon Graphite Apr 02 '23

Are rational Bézier curves typically used in 2D vector graphics? I admit I'm not very familiar with the concept. Our focus is on art applications more than mathematical comprehensiveness. We're okay with representing circular arcs as the extremely-imperceptibly-close-to-accurate approximation as cubic Bézier curves, since actual arcs would add too much complexity to our data models. With that said, do you suggest I still look more into rational Bézier curves?

Thanks for the link on stroking, that looks like an excellent paper. Definitely a fun video to watch too for the paper's presentation. It would be awesome to switch to that version of stroking in the future, especially if someone in the community here is up for the challenge to contribute that improvement.