Multi-color Modular Truchet

初出 1704 · Sébastien Truchet — Generalization of Truchet tiles (Sébastien Truchet, 1704; multi-tile sets popularized by Cyril Stanley Smith, 1987). · 年表 ↗

コミュニティ・通称 名称 — Truchet タイル系(Truchet, 1704)の変種の記述的名称。複合的な記述ラベルで独立したエポニムではない。

ひとことで Truchet を多テンプレート化したパターン: 四角・三角・扇 (1/4 円) を 4 回転×複数バリアントで組み合わせ、フラットな複数色で塗り分けるバウハウス/ミッドセンチュリー風タイリング。Harvey Rayner (patterndotco) などのスタイル。

Multi-color Modular Truchet · Open in new tab ↗ · Motion begins only when you press Run.

コード

上のデモの実際のスケッチ(サンドボックスで再現可能)。これで全部です。

truchet-multitile/index.html
const SEED = Math.floor(Math.random()*1e9);

const PALETTES = [
  // Bauhaus / patterndotco-ish
  ['#fafaf2', '#1ecbb0', '#e8253a', '#0d1b2a'],
  // Mid-century warm
  ['#f5e9d3', '#e8a87c', '#c38d9e', '#41b3a3'],
  // Memphis bright
  ['#fdfcdc', '#ffd166', '#ef476f', '#073b4c'],
  // Bauhaus primaries
  ['#f4f1de', '#e07a5f', '#3d405b', '#81b29a'],
  // Mono navy + crimson
  ['#f5f1e6', '#d62828', '#003049', '#fcbf49'],
];

function setup() {
  randomSeed(SEED);
  const s = Math.min(windowWidth, windowHeight);
  createCanvas(s, s);
  noStroke();

  const palette = PALETTES[Math.floor(random(PALETTES.length))];
  background(palette[0]);

  // Each cell: pick (bg, fg) from palette, then a tile template + rotation.
  // 7 templates × 4 rotations = 28 distinct visible tiles.
  const N = 12;
  const cs = width / N;

  for (let i = 0; i < N; i++) {
    for (let j = 0; j < N; j++) {
      const x = i * cs;
      const y = j * cs;

      // Pick two distinct colors. p5's shuffle() returns a new shuffled
      // array by default — capture the return value.
      const cs2 = shuffle(palette);
      const bg = cs2[0];
      const fg = cs2[1];

      // Background square
      fill(bg);
      rect(x, y, cs, cs);

      // Foreground tile template (1..6; 0 means "no overlay")
      const t = Math.floor(random(7));
      if (t === 0) continue;
      const rot = Math.floor(random(4));

      fill(fg);
      push();
      translate(x + cs / 2, y + cs / 2);
      rotate(rot * HALF_PI);
      translate(-cs / 2, -cs / 2);

      switch (t) {
        case 1: {
          // Quarter disc filling top-left 3/4 corner (arc, center at top-left)
          arc(0, 0, cs * 2, cs * 2, 0, HALF_PI);
          break;
        }
        case 2: {
          // Diagonal half (top-left triangle)
          triangle(0, 0, cs, 0, 0, cs);
          break;
        }
        case 3: {
          // Two opposite quarter discs (top-left + bottom-right corners)
          arc(0, 0, cs * 2, cs * 2, 0, HALF_PI);
          arc(cs, cs, cs * 2, cs * 2, PI, PI + HALF_PI);
          break;
        }
        case 4: {
          // Half rectangle (top half)
          rect(0, 0, cs, cs / 2);
          break;
        }
        case 5: {
          // Small quarter disc in the top-right corner (1/2 size)
          arc(cs, 0, cs, cs, HALF_PI, PI);
          break;
        }
        case 6: {
          // Eye shape: two big quarter arcs from top-right + bottom-left
          arc(cs, 0, cs * 2, cs * 2, HALF_PI, PI);
          arc(0, cs, cs * 2, cs * 2, -HALF_PI, 0);
          break;
        }
      }
      pop();
    }
  }
}

デモのソースを開く ↗

仕組み

基本の Truchet(1 タイル・ランダム向き)を豊かなセットに拡張する:(1) 辺の同じ接続点でモチーフが接するテンプレート群(角から角の三角、辺中点を結ぶ四分円弧など)を定義し、どのタイルもきれいに接合させる、(2) 各セルでテンプレートと 4 回転(+反転)の 1 つを選ぶ(多くは重み付き、時に近傍が繋がるよう制約)、(3) 小パレットから各領域をフラットに塗り分け、前景/背景をタイルごとに入れ替えて多様性を倍増。全バリアントが辺の接続点を共有するため、局所選択が連続する組み合わさった曲線・リボン・市松模様を構成する。

パラメータ

系譜

関連
Truchet Tiles、Geometric / Hexagonal Tiling、Wave Function Collapse

よく組み合わされるアルゴリズム

このアルゴリズムを使う作品 (7)

70s Pop Ghost Bonus Pack 👻
daniel-catt
70s Pop Series One
daniel-catt
Divisions
michael-connolly
Machine Comics
roni-block
Placement
cooper-jamieson
Squares
martin-grasser
Trossets
anna-carreras

最終更新 2026-07-16