Find bezier control-points for curve passing through N points
Asked Answered
M

2

20

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?

Marge answered 10/10, 2011 at 16:24 Comment(0)
R
26

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.

Retrorocket answered 26/8, 2013 at 19:4 Comment(1)
Updated link: developer.squareup.com/blog/smoother-signaturesDrusi
R
2

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.

Reuven answered 19/8, 2012 at 18:18 Comment(1)
Yes there is. You can always find a Bezier curve (in fact an infinite number of them) of degree N-1 that interpolates N given points. Your answer is correct for cubic (degree 3) Bezier curves.Oecology

© 2022 - 2024 — McMap. All rights reserved.