teaching machines

Cutting Corners

December 14, 2019 by . Filed under public, twoville.

I learned recently of Chaikin’s Algorithm, a method for rounding off the corners of a polygon. The algorithm works like this:

  1. Find the midpoints of each line segment in the polygon’s perimeter.
  2. Connect each consecutive pair of midpoints using a quadratic Bezier curve. The midpoints are the curve’s endpoints. The vertex between them is the control point.

Twoville has given me a playground to experiment with algorithms like this. I added a new shape environment called ungon for generating these rounded polygons. Following are a couple of my first tests.

A couple of years ago I experimented with making blobby circuitous random walks with turtle geometry. Chaikin’s algorithm is far simpler.