Circle Packing
単一の起源作品はない。円充填は古典幾何学(古代のアポロニウスのギャスケット、 1643年のデカルトの円定理)であり、生成芸術における形(重なりのない円を成長・棄却で 詰め、しばしば画像で重み付けする)は、年代を特定できる「最初」ではなく、コーディング・ コミュニティに散在するパターンである。
コミュニティ・通称 名称 — 命名・エポニムではなく記述的なカテゴリ名。用語の単一の命名者は確認されていない。
ひとことで 重なりなく円をランダムに詰める。サイズ可変・最近接探索 + 棄却法で実装されることが多い。
コード
上のデモの実際のスケッチ(サンドボックスで再現可能)。これで全部です。
circle-packing/index.html
const SEED = Math.floor(Math.random()*1e9);
function setup() {
randomSeed(SEED);
const s = Math.min(windowWidth, windowHeight);
createCanvas(s, s);
background('#f0ede4');
noFill();
strokeWeight(1.5);
// Random-rejection circle packing.
// For each attempt: sample a radius from a heavy-tail distribution,
// sample a center, accept if it overlaps none of the previously placed.
const placed = [];
const MAX_PLACED = 320;
const MAX_ATTEMPTS = 40000;
const palette = ['#1a1a1a', '#c1502e', '#1f4068', '#e2a829', '#3a7d44'];
let attempts = 0;
while (placed.length < MAX_PLACED && attempts < MAX_ATTEMPTS) {
attempts++;
// bias toward smaller radii
const u = random();
const r = lerp(s * 0.004, s * 0.08, u * u * u);
const x = random(r, width - r);
const y = random(r, height - r);
let ok = true;
for (let i = 0; i < placed.length; i++) {
const c = placed[i];
const dx = x - c.x, dy = y - c.y;
if (dx*dx + dy*dy < (r + c.r) * (r + c.r)) { ok = false; break; }
}
if (!ok) continue;
stroke(palette[(placed.length) % palette.length]);
circle(x, y, r * 2);
placed.push({ x, y, r });
}
}仕組み
よくある「成長」法:(1) ランダム位置に候補円を置き(既存円と重なる/領域外なら棄却)、(2) 採用した円を毎フレーム少しずつ拡大し、他の円か境界に接した瞬間に停止、(3) 残った隙間へ候補を追加し続け、領域が埋まるか試行回数を使い切るまで繰り返す。空間グリッドや最近接構造で重なり判定を高速化。画像の明度で円サイズを重み付けすれば点描/肖像になり、位置緩和で密な詰め込み(アポロニウス的)も作れる。
パラメータ
minRadius: number — Smallest allowed circle radius.maxRadius: number — Largest radius attempted before a candidate is shrunk to fit.maxAttempts: number — Random placements tried before the algorithm stops filling the space.padding: number — Minimum gap enforced between neighbouring circles.
系譜
よく組み合わされるアルゴリズム
- HSL / Hue Cycle · 2 作品
- Perlin / Simplex Noise · 2 作品
- Bezier / Catmull-Rom Splines · 2 作品
- Poisson Disk Sampling · 2 作品
- Particle System · 2 作品
- Polygon Mosaic · 2 作品
- 3D Mesh / Geometry · 1 作品
- Marching Squares / Contours · 1 作品
- Fragment Shader (GLSL) · 1 作品
- Physics Simulation · 1 作品
- Modular Assembly / Parametric Character · 1 作品
- Plotter-style Hatching · 1 作品
このアルゴリズムを使う作品 (12)
Breathe You
raregonzo
Coalition
generative-artworks
Daisies
natthakit-susanthitanon-nsmag
Figments
amber-vittoria
Octo Garden
rich-lord
Organized Disruption
joshua-davis
Paramecircle
alexander-reben
Pizza 1o1
kala
Proscenium
remnynt
Scatter Process[or]
kelly-milligan
Structures
hevey
Thereidoscope
daim-aggott-honsch
最終更新 2026-07-16