Chaikin Corner-Cutting
also: Chaikin's algorithm, corner cutting, corner-cutting subdivision
First appeared 1974 · George Merrill Chaikin — Introduced by George Chaikin in "An algorithm for high-speed curve generation" (1974). · timeline ↗
third-party / eponym Name — Eponym: Chaikin's 1974 paper is titled descriptively ("An algorithm for high-speed curve generation"); "Chaikin's algorithm" is a name applied by the later subdivision-curve literature, not by Chaikin himself.
In one line A curve-smoothing subdivision scheme. Each refinement pass replaces every edge of a control polygon with two points set a quarter and three-quarters of the way along it, "cutting the corner". Repeated, the polygon converges to a smooth quadratic uniform B-spline.
The code
The actual sketch behind the demo above — sandboxed and reproducible. This is the whole thing.
chaikin/index.html
// Chaikin's corner-cutting (Chaikin, 1974): repeatedly replace every edge's
// endpoints with two points at 1/4 and 3/4 along it. Each pass "cuts the
// corners" of the control polygon; in the limit the sequence converges to a
// quadratic uniform B-spline. Here each refinement level is drawn faintly so
// the angular control polygon visibly relaxes into a smooth curve.
const SEED = Math.floor(Math.random() * 1e9);
const PALETTES = [
['#f4f1eb', '#1d3557', '#e63946'],
['#0d1b2a', '#e0e1dd', '#f4a261'],
['#fdf0d5', '#003049', '#669bbc'],
['#1a181b', '#f6f4f3', '#9d4edd'],
];
let pal, ctrl = [], closed = true;
function chaikin(pts, close) {
const out = [];
const n = pts.length;
const last = close ? n : n - 1;
for (let i = 0; i < last; i++) {
const a = pts[i], b = pts[(i + 1) % n];
out.push({ x: a.x * 0.75 + b.x * 0.25, y: a.y * 0.75 + b.y * 0.25 });
out.push({ x: a.x * 0.25 + b.x * 0.75, y: a.y * 0.25 + b.y * 0.75 });
}
return out;
}
function poly(pts, close, w, col) {
stroke(col); strokeWeight(w); noFill();
beginShape();
for (const p of pts) vertex(p.x, p.y);
if (close) endShape(CLOSE); else endShape();
}
function setup() {
randomSeed(SEED);
const s = Math.min(windowWidth, windowHeight);
createCanvas(s, s);
pal = PALETTES[Math.floor(random(PALETTES.length))];
const cx = width / 2, cy = height / 2, R = s * 0.34, k = Math.floor(random(5, 9));
for (let i = 0; i < k; i++) {
const a = (i / k) * TWO_PI;
const r = R * random(0.45, 1.05);
ctrl.push({ x: cx + Math.cos(a) * r, y: cy + Math.sin(a) * r });
}
background(pal[0]);
// faint control polygon + dots
poly(ctrl, closed, 1, pal[2] + '99');
noStroke(); fill(pal[2]);
for (const p of ctrl) circle(p.x, p.y, 5);
// successive refinements, fading from light to the final dark curve
let cur = ctrl;
for (let level = 1; level <= 6; level++) {
cur = chaikin(cur, closed);
const t = level / 6;
poly(cur, closed, 0.6 + t * 1.8, pal[1] + Math.floor(60 + t * 195).toString(16).padStart(2, '0'));
}
noLoop();
}How it works
Start from a control polygon (open or closed). For every edge from A to B, emit two new points: Q = 3/4·A + 1/4·B and R = 1/4·A + 3/4·B. Replace the whole polygon with the sequence of these new points and repeat. Each pass roughly doubles the point count and rounds off every corner; after only a few iterations the result is visually smooth, and in the limit it is exactly a quadratic uniform B-spline. It is cheap, stable, and needs no basis-function evaluation, which is why it is a staple for quickly smoothing generative paths and plotter strokes.
Parameters
iterations: number — Number of refinement passes; more passes mean a smoother curve.closed: boolean — Whether the control polygon is a closed loop or an open path.
Lineage
Works using this algorithm (1)
References
Last updated 2026-07-16