hadronized / splines

Interpolation made easy.
https://crates.io/crates/splines
Other
162 stars 34 forks source link

Support for basis changes? #47

Closed virtualritz closed 3 days ago

virtualritz commented 4 years ago

I'm currently implementing a curve widget that will be drawn using skia so I'm limited to drawing cubic Bezier segments.

The user will be able to choose different interpolations. E.g. Catmull-Rom. What I need to do then is to calculate the CVs for a Bezier segment from the CVs of a Catmull-Rom segment. This is called a basis change and quiet trivial.

So I expected some Rust crate to cover this already but I didn't find any. I wonder if this crate would be a good one to offer this functionality, even if behind a feature gate? A basic API would let the user choose a basis (what is called an Interpolation in this crate, I guess) or supply a custom basis matrix. The latter would make it easy to evaluate custom splines via the available methods in this crate. Assuming their basis can be changed to one of those covered by this crate.

hadronized commented 3 days ago

I’m moving the project to sourcehut. Feel free to reopen there if you want to — issues / mailing list. Thank you.