Rational Bezier Curve?


credits @hiroshi_jacobs

I would like to add a parameter for B in this formula to change the control point weight.

see: Wikipedia. Rational Bézier curves
pages.mtu.edu
math.stackexchange.com/

((-a+c)*t³)-(3*(-a+b)*t²)+(3*(-a+b)*t)+a

anyone up for the challenge?

like that ?

looking good!
what’s on the right side of the function?

just b replaced by (b*w)

something’s off
zero should be a straight line

no idea it’s just a try

you can try with evaluate curve

I’m after the formula, need it to control a gradient blend.
pages.mtu.edu RB-conics
This seems more like it… I’ll try to apply


not perfect but works for me
(1/((1-t)²+2*(1-t)*t*w+t²))*((1-t)²*a+2*(1-t)*t*w*b+t²*c)

use my example it give you the right weight

You do know that Bezier curves are a subset of Nurbs? Using a Nurbscurve where the cpcount is degree +1 (single span Nurbs) are equivalent to a (rational) Bezier curve… That means a Nurbs curve with 4 cps and degree 3 is automatically a Bezier curve. So why not using native functionality then? Furthermore Bezier curves usually are created by the deCasteljau algorithm, which is recursive. Weighting (=rational) it, just means to give every cp an additional factor of global impact, just as Seghier did.

Thanks Tom,
The output I’m looking for is not the curve.
I have an array of x values and I need to get y values.
Just as you would with graph mapper, which I can’t use because I need to control the curve parametrially.
My current workaround is in fact to use a nurbs curve and intersect it with vertical lines and determine y values of intersections.
This is ok but slow when dealing with massive arrays. Therefore I believe using an equation would speed things up.

Does this help?



rationalBezier.gh (17.7 KB)

1 Like

Haven’t read that. Well are you sure about this? You are using a parametric equation, which doesn’t work in a way like a normal function does. Line-Curve intersection isn’t that costly. What array sizes do we talk about here?

Looks like you where right!