fogón

← Basics3D assetfogon/silla-plegable

Silla plegable

by fogonCC04417 blocks
Silla plegableDrag to turn it
// «Silla plegable» · gpt-6-sol (medium)
// Folding chair («Silla plegable»).

// Folding chair: golden wooden slats on a blue-gray steel frame.
const steelDark = "#34434b";
const steel = "#536771";
const steelLight = "#72858b";
const steelEdge = "#27343b";
const woodEdge = "#a96830";
const woodSide = "#c17d36";
const woodTop = ["#dda04c", "#e5aa55", "#edb660"];

function rail(x0, y0, z0, x1, y1, z1, r = 1) {
  line(x0, y0, z0, x1, y1, z1, r + 0.35, steelDark);
  line(x0, y0, z0 + 0.5, x1, y1, z1 + 0.5, r - 0.15, steel);
}

// Four wide, flat shoes on the floor.
for (const x of [9, 39]) {
  for (const y of [7, 38]) {
    box(x - 3, y - 3, 0, x + 3, y + 3, 1, steelEdge);
    box(x - 2, y - 2, 2, x + 2, y + 2, 2, steelDark);
    box(x - 2, y - 2, 2, x + 1, y - 2, 2, steel);
  }
}

// The crossed folding legs, one X at each side.
for (const x of [9, 39]) {
  rail(x, 7, 3, x, 29, 20);
  rail(x, 38, 3, x, 12, 20);
  set(x, 21, 12, steelEdge);
  set(x - 1, 21, 12, steelLight);
  set(x + 1, 21, 12, steelLight);
}

// Low lateral tie between the rear legs.
rail(10, 35, 8, 38, 35, 8, 0.65);

// Steel seat perimeter and under-seat crosspieces.
for (const x of [9, 39]) rail(x, 9, 20, x, 31, 20, 0.8);
rail(9, 9, 20, 39, 9, 20, 0.85);
rail(9, 31, 20, 39, 31, 20, 0.85);
rail(10, 19, 19, 38, 19, 19, 0.6);

// Four separate wooden seat boards. Their dark front lips keep the gaps legible.
const seatBoards = [
  [9, 13], [15, 19], [21, 25], [27, 30]
];
for (let b = 0; b < seatBoards.length; b++) {
  const [ya, yb] = seatBoards[b];
  box(11, ya, 20, 37, yb, 20, woodEdge);
  box(11, ya, 21, 37, yb, 21, woodSide);
  box(11, ya, 22, 37, yb, 22, woodTop[b % 3]);
  line(12, ya, 22, 36, ya, 22, 0, "#f2bf70");
  line(12, yb, 21, 36, yb, 21, 0, "#985d2d");

  // Subtle lengthwise grain and small dark fasteners.
  for (let i = 0; i < 10; i++) {
    const gx = 13 + Math.floor(rand() * 23);
    const gy = ya + 1 + Math.floor(rand() * Math.max(1, yb - ya - 1));
    set(gx, gy, 22, rand() < 0.5 ? "#d29240" : "#efb967");
  }
  for (const x of [14, 35]) {
    set(x, ya + 1, 22, "#926638");
    set(x + 1, ya + 1, 22, "#bf873d");
  }
}

// Backrest posts lean gently away from the seat.
for (const x of [9, 39]) {
  rail(x, 29, 20, x, 31, 30, 0.95);
  rail(x, 31, 30, x, 35, 42, 0.95);
  box(x - 1, 34, 41, x + 1, 35, 42, steelDark);
  set(x, 34, 43, steelLight);
}
rail(9, 35, 42, 39, 35, 42, 0.65);

// Two substantial horizontal boards, with a visible gap between them.
// Their front surfaces face -y.
for (const [za, zb, yf, shade] of [
  [29, 33, 30, "#dfa04a"],
  [36, 40, 33, "#e5aa54"]
]) {
  box(11, yf + 1, za, 37, yf + 2, zb, woodEdge);
  box(11, yf, za + 1, 37, yf, zb - 1, shade);
  box(12, yf, zb, 36, yf + 1, zb, "#efbc70");
  line(12, yf - 1, za, 36, yf - 1, za, 0, "#ad6c32");
  line(13, yf - 1, zb - 1, 35, yf - 1, zb - 1, 0, "#f1bd69");

  for (const x of [13, 35]) {
    set(x, yf - 1, za + 2, "#76563c");
    set(x + 1, yf - 1, za + 2, "#b27b3f");
  }
  for (let i = 0; i < 13; i++) {
    const x = 14 + Math.floor(rand() * 21);
    const z = za + 1 + Math.floor(rand() * (zb - za - 1));
    set(x, yf - 1, z, rand() < 0.5 ? "#d18f3f" : "#edb867");
  }
}

// Small exposed hinges and bright catches at the folding joints.
for (const x of [9, 39]) {
  for (const [y, z] of [[12, 20], [29, 20], [30, 28]]) {
    box(x - 1, y - 1, z - 1, x + 1, y + 1, z + 1, steelDark);
    set(x - 1, y - 1, z, steelLight);
  }
}