Bezier Curves and Type Design: A Tutorial
learn.scannerlicker.net
learn.scannerlicker.net
> For more information on inflection points, have a __read here__
If I hadn't seen that sentence, and thought, "what's here?", I wouldn't have even guessed that there were any links in the article.
Thanks for your comment, leeoniya, but I'm not a skilled web designer, and I'm an even worst developer.
Since I did the website on my own and can't afford having someone doing it for me, I'll try to correct it the best I can.
It just might take me a while.
Cheers!
1. stop using the jquery.nicescroll plugin
2. set your ".col3" div to "overflow: auto" instead of "overflow: hidden"
> But if we were to write one to convert quadratic to cubic, the best the program could do is an approximation of the original outline, usually keeping the anchor points it already had, but adding one more control point per anchor.
Isn't quadratic just a special case of cubic? i.e. a cubic curve with C1 == C2. It does add one more control point per curve (so it's bad for the overall size of the drawing) but it's not an approximation, it's the exact same curve. It also seems like a much simpler conversion than the other way around.
Also, this conversion doesn’t seem like something anyone should do by hand (e.g. adding extra control points which don’t change the curve): some algorithm is going to be able to optimize curves to minimize points, convert between curve types, etc. much better than a human is, and much much faster. [Though for all I know some existing software has crappy implementations]
Personally, I’d recommend people use Raph Levien’s Spiro curves to design their fonts (and not use Béziers directly); they make it much much easier to make whatever shape the designer is actually trying to make. (Folks on Hacker News interested in the mathematics of curve drawing should also definitely check out his PhD thesis.) http://www.levien.com/spiro/
Isn't it the other way around? I mean, isn't cubic a special case of quadratic?
Please correct me if I'm wrong (or my references), I want this article to be as accurate as possible!
Thanks!
We can demonstrate this by looking at the equation for a quadratic Bézier:
(1 - t)^2 P_0 + 2(1 - t)t P_1 + t^2 P_2
Now, let's increase the degree. = [ (1 - t)^2 P_0 + 2(1 - t)t P_1 + t^2 P_2 ] * [ 1 - t + t ]
clearly this equation is equal to the above one because 1-t+t == 1 and multiplying by one does nothing. = [ (1 - t)^2 P_0 + 2(1 - t)t P_1 + t^2 P_2 ] * [ (1 - t) + t ]
= (1 - t)^3 P_0 + t(1 - t)^2 P_0 + 2(1 - t)^2t P_1 + 2(1 - t)t^2 P_1 + (1 - t)t^2 P_2 + t^3 P_2
Group by powers of t: = (1 - t)^3 P_0 + t(1 - t)^2 [P_0 + 2*P_1] + (1 - t)t^2 [2P_1 + P_2] + t^3 P_2
Which is exactly a cubic Bezier curve.Thus, all quadratic Beziers can represented cubic ones, but the reverse does not hold, thus quadratics are specializations of cubics.
QED.
This is known as degree elevation.
I'm not very math savvy and I was trying to get this right.
Anyway, thank you very much for making this clear!
Cheers!
In my experience designing tools, artists often prefer predictable over optimal.
Since every DTP program has it's own (or multiple) rasterization algorithms (and the same goes for printers) we have to deal with these too. It's about balance. :)
I would love to see some examples of the bad rasterization this kind of thing fixes. I think that would be an interesting article/addition.
Do you mind if I had your article to mine?
Cheers!
I'm surprised how much performance is a consideration. In CAD the degree of the surfaces are not really a big deal any more, surface degrees of 3 are most common, in some fields you get up to degree 7 or 8. However there are generally a lot fewer surfaces in CAD then there are curves in a page full of fonts.
A couple of comments:
> to convert quadratic to cubic, the best the program could do is an approximation of the original outline
You can convert quadratic to cubic exactly (the algorithm is called degree elevation). Cubic to quadratic must be an approximation, but the artist seems happy with it and designs around it (Bezier endpoint at inflection point, etc). The other comments about file size and computation still hold.
> Since we still need a worldwide network of computers just to find some more pi digits, no perfect circles to anyone
Hmm, you can get perfect circles with rational Beziers, but I don't know if those are supported in fonts. I know they're not supported in svg.