Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find bezier control-points for curve passing through N points

Considering the following nice solution for finding cubic Bézier control points for a curve passing through 4 points:

How to find control points for a BezierSegment given Start, End, and 2 Intersection Pts in C# - AKA Cubic Bezier 4-point Interpolation

I wonder, if there is a straightforward extension to this for making the Bézier curve pass through N points, for N > 2 and maybe N ≤ 20?

like image 202
jwin68 Avatar asked Oct 10 '11 16:10

jwin68


People also ask

How do you calculate the control point on a Bézier curve?

Any series of 4 distinct points can be converted to a cubic Bézier curve that goes through all 4 points in order. Given the starting and ending point of some cubic Bézier curve, and the points along the curve corresponding to t = 1/3 and t = 2/3, the control points for the original Bézier curve can be recovered.

When the curve passes through the control points it is called as?

A bezier curve is defined by control points.

How many control points are there in Bézier curve?

A quadratic Bezier curve is determined by three control points. A cubic Bezier curve is determined by four control points.

What is the degree of Bézier curve with N 1 data points?

Explanation: The degree of a Bézier curve defined by n+1 control points is n: In each basis function, the exponent of u is i + (n – i) = n. Therefore, the degree of the curve is n.


2 Answers

This is a really old question, but I'm leaving this here for people who have the same question in the future.

@divanov has mentioned that there's no Bezier curve passing through N arbitrary points for N >4.

I think the OP was asking how to compute the control points to join multiple bezier curves to produce a single curve that looks smooth.

This pdf will show you how to compute the control points: http://www.math.ucla.edu/~baker/149.1.02w/handouts/dd_splines.pdf

which I found on this writeup https://developer.squareup.com/blog/smoother-signatures/ from Square about how they render a smooth curve that passes through all the sampled points of a mouse drawn signature.

like image 181
user392870 Avatar answered Oct 14 '22 22:10

user392870


In general, there is no Bezier curve passing through N arbitrary points, where N > 4. One should consider curve fitting to minimize least square error between computed Bezier curve and given N data points. Which is discussed, for example, here.

like image 36
divanov Avatar answered Oct 14 '22 20:10

divanov