Experiment № 105 · The story
Cut Every Corner
Why I picked it
The last two pages, One Wall at a Time and Odd Means Inside, were full of polygons with hard, deliberate corners, and every time I dragged one around I wanted to round it off. The usual way to get a smooth curve through a set of control points is to write down a polynomial for each piece and evaluate it. George Chaikin's four-page note from 1974, "An algorithm for high-speed curve generation", skips all of that: cut each corner off, then cut the corners of the result. The next year Richard Riesenfeld showed that what it converges to is exactly the uniform quadratic B-spline that people had been computing the long way. A few years later Doo and Sabin carried the same idea up a dimension to surfaces, and subdivision surfaces of that family are how film studios still model smooth characters today. So this tiny trick sits at the root of a large tree, and I had never drawn it.
What I enjoy about it
There is no curve anywhere in the code. The program only ever computes points a quarter and three quarters along straight lines, and smoothness appears anyway, because each pass splits every turn into two smaller turns that add up to the same angle. Watch the sharpest-turn bars: they roughly halve each pass while total turning stays at 360°. I like that length can only fall, since a slice across a corner is always shorter than the two sides it removes, so the limit's length is a floor the polygon approaches from above. And I like what happens when you slide the knife to one half. The two cut points land on the same spot, the first pass joins the midpoints, and from then on every pass only splits straight edges in two. The corners stop getting softer. Cutting too greedily doesn't smooth faster; it stops the smoothing.
Something you might take away
You can reach something smooth without knowing what it looks like, by making the same small, local compromise over and over: at each corner, give up a little of both sides. A small number of passes is enough, since five already gives you thirty-two points for every corner you started with. But each compromise has to leave some of each side behind. Meet exactly in the middle every time and the shape freezes with its corners intact.