although as a Springer book it's a bit pricey =( (I'll be trying to add rational B splines and NURBS to the primer soon..ish... there's a few other topics that still need expanding first)
This is a very nice tutorial. One small point. Coordinates are expressed in a "X/Y" format which was very confusing to me because I was thinking of them as ratios. It might be better to print them the commonly used tuple convention (X,Y)
The tutorial doesn't work for me. It provides a thorough explanation of the polynomials, but it fails to explain the very basics of how the curves are laid out on the plane.
It does a nice work of explaining how a circle is drawn, but its explanation of how x and y are calculated for a Bézier curve doesn't make sense to me: "Bézier curves use the "binomial polynomial" for both x and y." If the same function on "t" is used for both x and y, they would always have the same value, and the "curve" is always a diagonal with 45 degrees. What am I missing? I can't infer it from the tutorial.
Also, it introduces the idea of a "control point" and starts using it, but never manages to define what it is, or how it is represented in the equation or graphically. It merely labels some curves as "P1", "P2"... in the graphs and telss that these somehow change the shape of the curves, and tells us that they have an associated linear "wi" weight; but again, the way in which the (x1, y1) pairs are connected to the binomial and polynomial term is never spelled out, and left as an exercise to the reader.
Things are further complicated by the mysterious "strength" parameter "S" in the graphs, which is also unexplained, never used again, and appears right when we're trying to understand the difficult concept of a control point to further confuse things. I had followed the tutorial quite well up to that point, but that section lost me completely.
Haven't read the article, but I do know a bit about these curves. Bézier curves do indeed use the "binomial polynomial" for both x and y. That polynomial defines how the control points are used (with t) to calculate the point on the curve.
So for the simplest example, a linear Bézier curve, the curve is a straight line from the first control point to the second.
Are there any creative tools that would make use of quadratic Bezier curves? While cubic Beziers are easier to tweak, it is much easier to draw smooth shapes with quadratic Beziers. They seem to be also easier to implement (only one control point), not sure why major vector and pixel graphics editors don't support them.
Ideally I would prefer to have an option to draw paths with either quadratic or cubic Bezier segments, but edit paths normalised to cubic Bezier segments.
Only OpenType with TrueType outlines (the common .ttf file) do - lines and quadratic curves is all you get. OpenType fonts with CFF/Type2 outlines (the equally common .otf files) use cubic curves instead, with an insanely rich instruction language for much better shape control.
Quadratic curves get very "pointy" with increased curvature, so you're trading "easy to draw a single smooth curve" (fairly meaningless in vector work) for "a genuine hassle to line up the consecutive curves that you'll need for more complex curve shapes" (pretty much the meat of vector work).
Of course, I say "complex" but and those aren't actually all that complex at all: you'll already need two quadratic curves just for a quarter circle (and by extension any quarter ellipse), for instance. While it sounds appealing, once you can actually draw quadratic curves you end up needing so many of them that refining your shapes (which takes up the majority of time for curve work if you're playing human data processor) becomes an incredibly hard job.
The most obvious example of a common technology that uses quadratics is OpenType fonts with TrueType outlines, which only uses straight lines and quadratic Bezier curves, although most tools I know of will give you cubics there, too, and simply save to a correct quadratic representation upon export/font generation.
Outside of those, you can use visual programming languages like Processing for your own purposes if you absolutely need them.
I used quadratic curves to render strokes in TabletDraw, although that's not user level.
Another advantage of quadratic curves is that they can be converted to a parabolic function plus a rotation. That opens the door for all sorts of optimization that is much harder with cubic bezier curves, which are not guaranteed to be functions.
Not entirely true, but not entirely false either: the quadratic has degenerate cases where it can't be represented by a single quadratic polynomial, and regardless of the order, each dimension in a nth order Bezier curve is guaranteed to be a plain old nth order polynomial function.
Most properties for the cubic curve as a whole come from evaluating each dimension independently, which still allows for a fair number of optimizations, and we can classify cubics in a few canonical forms that let us do even more optimizations ("a geometric characterization of parametric cubic curves" by Stone and DeRose is a good read on that)
So a cautionary note: finding the angle necessary to turn a quadratic curve into a parabola (for unbalanced curves) can cost as much as using an optimized canonical cubic, where the user's input only defines the linear transform that you throw at the graphics context to make sure the curve you then draw matches the curve the user expected.
Is it some sort of coincidence that both Bezier and Casteljau were working for car companies?
Renault & Citroen feels like they were design powerhouses in this context, with numerical industrial design.
The curves were like compressed specifications, instead of being "make it look like this" with a sculpted model. That said, cars from the same era built by aerodynamics engineers also resulted in beautiful curves (like a Jaguar E Type).
Of course it’s not a coincidence. Car companies were one of the first places where it was reasonable to do computer-aided design, back when computers were rare and expensive.
Sheetmetal fabrication is hard, and knowing what you can and can not make out of a single sheet is not obvious. For that reason car companies were very early in the game to use computers to gain an edge over their competitors by making others 'impossible' shapes with repeatable accuracy and resulting material thickness. Deformation results in variable material thickness and if you want to input curves into a computer (so your numerically controlled mill can make the tool-and-die used to stamp the part) then it helps if you can do so easily. That's where the Bezier curves (and splines) come in, they allow you to specify a complex curve using only a few points.
I used them extensively for a computer program that cut sails for sailing vessels, the problems are roughly similar (only you can't really deform cloth all that much so you're going to end up cutting panels, the end result looks much the same as a 2 dimensionally deformed sheet of metal though).
3d Beziers have been a thing for a long time already though! In modelling, NURBS surfaces are typically used (the non-uniform rational B-spline, where the rational B-spline part is a "rationalised" bezier, which is a whole section that I've not had the time to write yet...)
I think what the parent comment was saying is that the smoothing algorithm used in subdivision modeling is very similar to bezier. Actually, subdivision surfaces are very similar to B-splines [1], but are much more convenient to use than NURBS -- which require the modeler to maintain consistent rows of control points throughout the model. ILM's use of patch modeling in films like Jurassic Park are incredible examples of working around these constraints. (I believe they side-stepped the continuity issue with their proprietary "enveloping" software which allowed them to blend discontinuous B-spline patch surfaces together.)
Love this post btw -- extremely impressive / educational.
This is amazingly exhaustive, and for those still hungry, there's always the Nurbs Book http://www.springer.com/computer/image+processing/book/978-3...
although as a Springer book it's a bit pricey =( (I'll be trying to add rational B splines and NURBS to the primer soon..ish... there's a few other topics that still need expanding first)
Yeah, I used it while in college thanks to their library.
This is a very nice tutorial. One small point. Coordinates are expressed in a "X/Y" format which was very confusing to me because I was thinking of them as ratios. It might be better to print them the commonly used tuple convention (X,Y)
nice, file it and I'll see how easily I can get on that.
The tutorial doesn't work for me. It provides a thorough explanation of the polynomials, but it fails to explain the very basics of how the curves are laid out on the plane.
It does a nice work of explaining how a circle is drawn, but its explanation of how x and y are calculated for a Bézier curve doesn't make sense to me: "Bézier curves use the "binomial polynomial" for both x and y." If the same function on "t" is used for both x and y, they would always have the same value, and the "curve" is always a diagonal with 45 degrees. What am I missing? I can't infer it from the tutorial.
Also, it introduces the idea of a "control point" and starts using it, but never manages to define what it is, or how it is represented in the equation or graphically. It merely labels some curves as "P1", "P2"... in the graphs and telss that these somehow change the shape of the curves, and tells us that they have an associated linear "wi" weight; but again, the way in which the (x1, y1) pairs are connected to the binomial and polynomial term is never spelled out, and left as an exercise to the reader.
Things are further complicated by the mysterious "strength" parameter "S" in the graphs, which is also unexplained, never used again, and appears right when we're trying to understand the difficult concept of a control point to further confuse things. I had followed the tutorial quite well up to that point, but that section lost me completely.
Haven't read the article, but I do know a bit about these curves. Bézier curves do indeed use the "binomial polynomial" for both x and y. That polynomial defines how the control points are used (with t) to calculate the point on the curve.
So for the simplest example, a linear Bézier curve, the curve is a straight line from the first control point to the second.
One of my favorite side projects was building a bezier sprite pather for Impact.js game engine (was working on a moth-balled top-down shooter).
https://github.com/dclowd9901/impactjsBezier
This is one of the sites that contributed to that work. So strange to see it appear out of context here.
Are there any creative tools that would make use of quadratic Bezier curves? While cubic Beziers are easier to tweak, it is much easier to draw smooth shapes with quadratic Beziers. They seem to be also easier to implement (only one control point), not sure why major vector and pixel graphics editors don't support them.
Ideally I would prefer to have an option to draw paths with either quadratic or cubic Bezier segments, but edit paths normalised to cubic Bezier segments.
Most fonts are created with quadratic Bezier curves, I think.
Only OpenType with TrueType outlines (the common .ttf file) do - lines and quadratic curves is all you get. OpenType fonts with CFF/Type2 outlines (the equally common .otf files) use cubic curves instead, with an insanely rich instruction language for much better shape control.
Quadratic curves get very "pointy" with increased curvature, so you're trading "easy to draw a single smooth curve" (fairly meaningless in vector work) for "a genuine hassle to line up the consecutive curves that you'll need for more complex curve shapes" (pretty much the meat of vector work).
Of course, I say "complex" but and those aren't actually all that complex at all: you'll already need two quadratic curves just for a quarter circle (and by extension any quarter ellipse), for instance. While it sounds appealing, once you can actually draw quadratic curves you end up needing so many of them that refining your shapes (which takes up the majority of time for curve work if you're playing human data processor) becomes an incredibly hard job.
The most obvious example of a common technology that uses quadratics is OpenType fonts with TrueType outlines, which only uses straight lines and quadratic Bezier curves, although most tools I know of will give you cubics there, too, and simply save to a correct quadratic representation upon export/font generation.
Outside of those, you can use visual programming languages like Processing for your own purposes if you absolutely need them.
I used quadratic curves to render strokes in TabletDraw, although that's not user level.
Another advantage of quadratic curves is that they can be converted to a parabolic function plus a rotation. That opens the door for all sorts of optimization that is much harder with cubic bezier curves, which are not guaranteed to be functions.
Not entirely true, but not entirely false either: the quadratic has degenerate cases where it can't be represented by a single quadratic polynomial, and regardless of the order, each dimension in a nth order Bezier curve is guaranteed to be a plain old nth order polynomial function.
Most properties for the cubic curve as a whole come from evaluating each dimension independently, which still allows for a fair number of optimizations, and we can classify cubics in a few canonical forms that let us do even more optimizations ("a geometric characterization of parametric cubic curves" by Stone and DeRose is a good read on that)
So a cautionary note: finding the angle necessary to turn a quadratic curve into a parabola (for unbalanced curves) can cost as much as using an optimized canonical cubic, where the user's input only defines the linear transform that you throw at the graphics context to make sure the curve you then draw matches the curve the user expected.
Is it some sort of coincidence that both Bezier and Casteljau were working for car companies?
Renault & Citroen feels like they were design powerhouses in this context, with numerical industrial design.
The curves were like compressed specifications, instead of being "make it look like this" with a sculpted model. That said, cars from the same era built by aerodynamics engineers also resulted in beautiful curves (like a Jaguar E Type).
Of course it’s not a coincidence. Car companies were one of the first places where it was reasonable to do computer-aided design, back when computers were rare and expensive.
As were airplanes manufacturers, where first visual ~workstations were designed.
Sheetmetal fabrication is hard, and knowing what you can and can not make out of a single sheet is not obvious. For that reason car companies were very early in the game to use computers to gain an edge over their competitors by making others 'impossible' shapes with repeatable accuracy and resulting material thickness. Deformation results in variable material thickness and if you want to input curves into a computer (so your numerically controlled mill can make the tool-and-die used to stamp the part) then it helps if you can do so easily. That's where the Bezier curves (and splines) come in, they allow you to specify a complex curve using only a few points.
I used them extensively for a computer program that cut sails for sailing vessels, the problems are roughly similar (only you can't really deform cloth all that much so you're going to end up cutting panels, the end result looks much the same as a 2 dimensionally deformed sheet of metal though).
Reminds me of the picture here http://blog.martindoms.com/2012/04/25/splines-and-curves-par...
How people designed curved surface thanks to material tension and knots.
Combine this with what we learned from Pixar about smoothing surfaces and it appears that Pixar has adapted the Bezier curve to 3D.
I'm always a little geeked-out by unification like this. :D
3d Beziers have been a thing for a long time already though! In modelling, NURBS surfaces are typically used (the non-uniform rational B-spline, where the rational B-spline part is a "rationalised" bezier, which is a whole section that I've not had the time to write yet...)
I think what the parent comment was saying is that the smoothing algorithm used in subdivision modeling is very similar to bezier. Actually, subdivision surfaces are very similar to B-splines [1], but are much more convenient to use than NURBS -- which require the modeler to maintain consistent rows of control points throughout the model. ILM's use of patch modeling in films like Jurassic Park are incredible examples of working around these constraints. (I believe they side-stepped the continuity issue with their proprietary "enveloping" software which allowed them to blend discontinuous B-spline patch surfaces together.)
Love this post btw -- extremely impressive / educational.
1: http://graphics.pixar.com/library/Geri/paper.pdf
That's a nice paper. Filed!