Slicing Bezier Surfaces

(fatih-erikli-potato.github.io)

13 points | by fatih-erikli-cg 3 days ago ago

2 comments

  • vintagedave 2 hours ago

    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.

    • quchen an hour ago

      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.