Chaikin Corner-Cutting
別名: Chaikin's algorithm、corner cutting、corner-cutting subdivision
初出 1974 · George Merrill Chaikin — Introduced by George Chaikin in "An algorithm for high-speed curve generation" (1974). · 年表 ↗
第三者・冠名 名称 — エポニム。Chaikin の 1974 年論文の題名は記述的(「高速曲線生成のアルゴリズム」)で、 「Chaikin のアルゴリズム」は本人ではなく後の細分化曲線文献が与えた名。
ひとことで 曲線を平滑化する細分化法。各反復で制御多角形の各辺を 1/4・3/4 の位置の2点に置き換え「角を切り落とす」。繰り返すと二次一様 B スプラインに収束する。
コード
上のデモの実際のスケッチ(サンドボックスで再現可能)。これで全部です。
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();
}仕組み
各辺 A→B を Q=3/4A+1/4B、R=1/4A+3/4B の2点に置換して多角形を作り直す操作を繰り返す。数回で滑らかになり、極限で二次一様 B スプラインに一致する。軽量で安定。
パラメータ
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.
系譜
このアルゴリズムを使う作品 (1)
参考文献
最終更新 2026-07-16