Jump to content

  • Log In with Google      Sign In   
  • Create Account


Evaluating curve points


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
9 replies to this topic

#1 Alessandro   Members   -  Reputation: 294

Like
0Likes
Like

Posted 18 February 2013 - 05:31 PM

Hi folks, I'd like to ask help about evaluating curve points as displayed in the attached image.

I'm be able to discard points if the curve is straight, comparing angles between each vector segment (left part).

 

I'd like to ask how could I evaluate points so that I can build a spline that passes through initial points (blue ones), and adds a number of green points where needed so that I can get a curve instead of a segmented vector.

 

Thanks

Attached Thumbnails

  • curves-problem.jpg


Sponsor:

#2 DT....   Members   -  Reputation: 487

Like
1Likes
Like

Posted 19 February 2013 - 01:08 AM

http://en.wikipedia.org/wiki/Bézier_curve



#3 EWClay   Members   -  Reputation: 659

Like
1Likes
Like

Posted 19 February 2013 - 03:48 AM

Catmull-Rom splines pass through all the control points. I think that's what you need.

#4 cadjunkie   Members   -  Reputation: 1273

Like
0Likes
Like

Posted 05 March 2013 - 01:16 PM

If you don't mind a bit of math, you can always use Newton polynomials to build a n-degree polynomial that interpolates n+1 points. I prefer them over Lagrange polynomials or using Neville's scheme simply because they take O(n^2), whereas Newton takes O(n) + some
preprocessing time.

 

I would post an example on how to do this, but I can't get the equation tags to show the formulas and the explanation text. It does involve building a divided difference table to get a polynomial. You can either build a set of parametric equations to evaluate at any parameter, or you can put that parameter back in the divided difference table and compute it from there (faster for sure).



#5 Álvaro   Crossbones+   -  Reputation: 12337

Like
2Likes
Like

Posted 05 March 2013 - 01:28 PM

My preferred method for this problem is natural cubic splines.



#6 Cornstalks   Crossbones+   -  Reputation: 6974

Like
0Likes
Like

Posted 05 March 2013 - 01:46 PM

My preferred method for this problem is natural cubic splines.

Thanks for posting that! I actually recently did a tweener based on cubic splines, but didn't know that article existed (so I had to do all the boring algebra).

 

@OP: Just to add another spline type into the mix in this thread, there's also Kochanek–Bartels splines (kb splines).


[ I was ninja'd 71 times before I stopped counting a long time ago ] [ f.k.a. MikeTacular ] [ My Blog ] [ SWFer: Gaplessly looped MP3s in your Flash games ]

#7 cadjunkie   Members   -  Reputation: 1273

Like
0Likes
Like

Posted 05 March 2013 - 02:34 PM

Yeah, the natural cubic spline approach is better than mine if you want the curves. This way, you get cubic Bezier curves that are C2 with each other. With Newton polynomials, you'd end up having to convert from polynomial basis to Bernstein basis and then choose a simple knot vector to get it to a NURBS.



#8 incertia   Crossbones+   -  Reputation: 777

Like
0Likes
Like

Posted 18 March 2013 - 09:25 PM

I believe Lagrange Interpolation is also a valid method.
what

#9 Álvaro   Crossbones+   -  Reputation: 12337

Like
0Likes
Like

Posted 19 March 2013 - 11:18 AM

I believe Lagrange Interpolation is also a valid method.

This is a bad idea. Look at this example from the same Wikipedia page you linked.

#10 RobTheBloke   Crossbones+   -  Reputation: 2324

Like
0Likes
Like

Posted 23 March 2013 - 06:33 AM

You'll be wanting a curve fron the hermite family, eg cardinal spline, kochanek-bartels, or catmull-rom.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS