GithubHelp home page GithubHelp logo

Comments (2)

portnov avatar portnov commented on May 27, 2024 1

I can suggest a method which allows you to estimate this deviation, not exactly, but it can be enough:

  • for each segment of your piecewise line, cut a corresponding segment from interpolated curve — i.e. find control points of the curve which is identical to your interpolation curve, but starts and ends at the end points of linear segment (there are methods for this in geomdl).
  • now, you have a set of pairs: a linear segment and corresponding piece of the curve. Now you can apply the property of nurbs curves known as "strong convex hull property": all points of the curve lie inside the convex hull built on it's control points. So, if you calculate the distance from each control point of curve's segment to linear segment (there are obvious enough formulas), and find the maximum of such distances, you will know that your curve segment derives from linear segment not more than for this maximum.
  • then you just find the maximum of such maximum distances across all segments.

Nurbs maths will guarantee that the curve never derives from your piecewise linear line more than for the value you find that way, but the deviation obviously can be less than it.

from nurbs-python.

carlos-adir avatar carlos-adir commented on May 27, 2024

I don't think there's already an algorithm that do it. So, I would do it by myself:

  1. Find a region where you know the deviation is. Like, at u between two scalars ui and uj.
  2. Get the tangent vector from the linear piecewise, the D vector.
  3. Get the tangent vector V(u) from the extrapoled curve.
  4. Your point at extrapoled curve is the one such V(u) = D. You can search it by binary search
  5. Once gotten the u, compute the minimal distance of P(u) (extrapoled) from the linear one. It's what you need.

from nurbs-python.

Related Issues (20)

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.