- The math for Bezier curves is usually a bit beyond me, but this seems to use a simple lerp (linear interpolation) to split. Why is that valid? I had expected something like moving along the curve and calculating new points and control points (weights?) to get a curve that is a subset of the curve but matching exactly? My possibly incorrect thought was that these are non-linear, therefore, how is lerp suitable?
Or does this retain the original curves but only evaluate a subset, thus, lerp makes complete sense as a simple linear progression along the curve? The curves stay the same, we are evaluating a subset to get the slice?
> It takes the t value between 0 and 1, and returns two bezier curves, one is the half that splitted at t, the other one is other half. Two of them shapes the given bezier curve.
My apologies to the author for finding this unclear -- I am not clear though :D
Also: what an awesome blog post. Interesting topic, straightforward, short, code, diagrams, clearly not AI. Thankyou to the author.
- Here’s an interactive picture of how the splitting with lerps works: https://pomax.github.io/bezierinfo/#splitting
Did you ever doodle parabolas on graph paper by drawing straight lines? That’s one way to see why you can form nonlinear curves using only lerps. (For example https://mathcraft.wonderhowto.com/how-to/create-parabolic-cu...)
Your thought is correct - this does (in a sense) move along the curve to produce new control points, and the subset does match the curve exactly. And the new control points are non-linear too! (The inner ones, anyway.) Pay attention to how the new control points are chosen - to split you take one control point from each level of the lerp tree.
- That is a really neat demo to play with. With some thinking, I can intuit and see visually in that what you mean by 'each level of the lerp tree'. Thankyou :)
- I hope it helps, Bézier curves are so simple and fun.
I found a picture of the ‘lerp tree’ that might help even more: https://www.researchgate.net/figure/De-Casteljau-algorithm-t...
The cool part about this is that you can see the control points of the two split curves in this diagram. The original control points are the bottom edge of the triangle. The left split is the left edge of the triangle, and the right split is the right edge of the triangle.
- Bezier curve are just nested lerps! A bezier curve of degree 1 is lerp, what we usually call "bezier curve" is of degree 3.
It's a mathematical property that bezier curves (degree n) can be split exactly into two bezier curves (degree n), which is known as deCasteljau's algorithm:
https://en.wikipedia.org/wiki/De_Casteljau%27s_algorithm
That page also features some pretty animations on the "lerpy" part - Bezier curves are really simple, it's just that for some reason they are often presented with lots of math jargon that's completely over the top.
This is also used to efficiently draw bezier curves: subdivide them until they're visually straight lines, then plot those.
- Wow! That animation for 'second order Bezier curve' was illuminating -- I have never seen something so clear explaining these. Thankyou!
- For a bit more on the lerp aspect see:
https://www.youtube.com/watch?v=jvPPXbo87ds
I am a bit bummed since from the title I was expecting a technique for 3D surfaces w/ multiple Béziers (at least 3, one for each plane) --- if someone knows of a good text on that, I'd be glad to learn of it.
- This is over an hour so will take some time to watch, but I recognise the author's name -- Freya Holmér, they are absolutely amazing. Thanks for the link.
- >The math for Bezier curves is usually a bit beyond me, but this seems to use a simple lerp (linear interpolation) to split. Why is that valid?
This can be explained through the bezier's polar form (aka blossom). There's plenty of literature on this. (For instance see slide 40 here[0])
I generally find it interesting that articles on Bezier curves/surfaces usually get upvoted on HN even though they tend to be extremely surface level. Any introductory applied geometry course or textbook will go much deeper within the first chapter or two.
[0] https://resources.mpi-inf.mpg.de/departments/d4/teaching/ss2...
- Thankyou, there's a lot interesting there.
I think for many of us, Bezier curves were our first introduction to curve geometry. They were certainly mine. In the late 90s, early 2000s, Rhino3D came out, and Quake 3 had curved surfaces, and suddenly splines were everywhere. For those of us of that generation, they are somewhat magic and back then I never saw a good explanation how they work -- but 20+ years later, this thread has provided multiple!
- This is just subdivision of Bernstein polynomials. The unifying way of looking at this is via the blossom of the Bezier curve (Bernstein polynomial). You can derive all manner of shifts, change of basis transformations, and so on using the blossom. Subdivision is just a shift of the domain of definition of the original polynomial.
- [dead]