Coder Social home page Coder Social logo

Comments (4)

Twinklebear avatar Twinklebear commented on July 23, 2024

Hi @imgeorgiev , thanks for the question. It sounds like what you want (and what the scipy interpolate library does) is B-Spline approximation, where a curve is fit that goes through the desired control points. If you try this out in scipy and can print the actual control points you'll see that the control points are actually not the points you're trying to interpolate, because the B-Spline curve doesn't go through the control points (besides the start/end if it's clamped). This is why an approximation has to be computed to find the actual curve parameters.

This library just does B-Spline interpolation of a given a set of control points and knots, so the curve has to be known. Computing the approximation is more complicated than just interpolating. What you could do is use the scipy library (or some other library) to compute the approximation, and then hand those control points and knots to this library to do the interpolation. However, if you're trying to make some single app that would compute the curve approximation for some set of control points, then having to go back out to scipy or some other library may not be great.

Let me know if this answers your question

from bspline.

imgeorgiev avatar imgeorgiev commented on July 23, 2024

Yes, thank you! Been struggling to understand this for a while now.

Sadly my application is a semi-realtime one so I'd need everything in Rust, thus using python/scipy is not an option. That being said, the scipy interpolate is just using another Fortran library, so using that through C bindings might be an option. I'll have a look into this.

If I ultimately decide to implement this in Rust, would you be interested if I contributed back to this library or do you think the interpolation application doesn't fit well?

from bspline.

Twinklebear avatar Twinklebear commented on July 23, 2024

That would be cool! If the approximation crate ends up depending on this one we could make them into one, or if it's easy to make them separate but easily compatible with each other, or something like having the approximation crate re-export this one, that might also work well.

There might be some other curve approximation crates for Rust around, there are some other spline/curve ones on crates but I'm not sure if they do approximation or just interpolation.

from bspline.

ctrlcctrlv avatar ctrlcctrlv commented on July 23, 2024

@imgeorgiev I have the same problem as you and offered a commission in #3. If @Twinklebear can't take it and you want to take a crack at it, hit me up. Email in bio.

from bspline.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.