fogón

← Basics3D assetfogon/mesa-de-pie-central

Mesa de pie central

by fogonCC09405 blocks
Mesa de pie centralDrag to turn it
// «Mesa de pie central» · gpt-6-sol (medium)
// Pedestal table («Mesa de pie central»).

const cx = 24, cy = 24;

// Four broad, low feet radiating from the central post.
function foot(axis, dir) {
  for (let d = 3; d <= 19; d++) {
    const width = d < 8 ? 4 : d < 14 ? 3 : 2;
    const height = d < 7 ? 5 : d < 12 ? 4 : 3;
    for (let w = -width; w <= width; w++) {
      for (let z = 0; z < height; z++) {
        const x = axis === "x" ? cx + dir * d : cx + w;
        const y = axis === "y" ? cy + dir * d : cy + w;
        const edge = Math.abs(w) === width;
        const color = z === height - 1
          ? edge ? "#a96932" : rand() < 0.13 ? "#d08a45" : "#bc7838"
          : z === 0 ? "#70421f"
          : edge ? "#875027" : "#9c5b2b";
        set(x, y, z, color);
      }
    }
  }

  // Squared, slightly wider end of each foot.
  const ex = axis === "x" ? cx + dir * 18 : cx;
  const ey = axis === "y" ? cy + dir * 18 : cy;
  if (axis === "x") {
    box(ex - 1, ey - 3, 0, ex + 1, ey + 3, 2, "#925329");
    box(ex - 1, ey - 2, 3, ex + 1, ey + 2, 3, "#bd7939");
  } else {
    box(ex - 3, ey - 1, 0, ex + 3, ey + 1, 2, "#925329");
    box(ex - 2, ey - 1, 3, ex + 2, ey + 1, 3, "#bd7939");
  }
}
foot("x", -1);
foot("x", 1);
foot("y", -1);
foot("y", 1);

// Stepped plinth where the feet meet.
box(20, 20, 4, 28, 28, 5, "#75431f");
box(19, 19, 6, 29, 29, 7, "#a4602b");
box(20, 20, 8, 28, 28, 9, "#c07a38");
box(21, 21, 10, 27, 27, 10, "#8b5025");

// Chunky, fluted central column.
box(21, 21, 11, 27, 27, 25, "#925429");
box(22, 20, 11, 23, 20, 25, "#b77739");
box(25, 20, 11, 26, 20, 25, "#b77739");
box(21, 22, 11, 21, 23, 25, "#b67636");
box(21, 25, 11, 21, 26, 25, "#b67636");
box(22, 21, 11, 22, 21, 25, "#d08b46");
box(26, 21, 11, 26, 21, 25, "#a96530");
box(23, 20, 13, 23, 20, 23, "#d18b46");
box(25, 20, 13, 25, 20, 23, "#d18b46");
box(24, 27, 12, 24, 27, 24, "#78441f");

// Collar and the support beneath the tabletop.
box(20, 20, 24, 28, 28, 25, "#895026");
box(19, 19, 26, 29, 29, 27, "#a7622d");
box(20, 20, 28, 28, 28, 28, "#ca8340");

// Thick round wooden top, with a stepped beveled edge.
for (let z = 27; z <= 32; z++) {
  const radius = [16.5, 17.5, 18.3, 18.7, 18.3, 17.3][z - 27];
  for (let x = 4; x <= 44; x++) {
    for (let y = 4; y <= 44; y++) {
      const dx = x - cx, dy = y - cy;
      const r = Math.sqrt(dx * dx + dy * dy);
      if (r > radius) continue;

      let color;
      if (z === 27) color = "#75431f";
      else if (z === 28) color = r > radius - 1.2 ? "#8c5025" : "#9b5929";
      else if (z === 29) color = r > radius - 1.1 ? "#975525" : "#ae692f";
      else if (z === 30) color = r > radius - 1.3 ? "#ad672b" : "#c7803b";
      else if (z === 31) color = r > radius - 1.5 ? "#cd8139" : "#dc9650";
      else {
        const plank = Math.floor((y - 7) / 8);
        const shades = ["#e5a05a", "#e9a45d", "#dda057", "#eba760", "#e2a05b"];
        color = shades[Math.max(0, Math.min(4, plank))];
        if (r > radius - 1.2) color = "#cf8540";
        else if (rand() < 0.035) color = "#f0ae66";
      }
      set(x, y, z, color);
    }
  }
}

// Broken, recessed-looking joins between the long tabletop boards.
for (const y of [17, 25, 33]) {
  for (let x = 9; x <= 39; x++) {
    const r = Math.hypot(x - cx, y - cy);
    if (r < 15.3 && (x % 11 < 8)) {
      set(x, y, 32, rand() < 0.35 ? "#c98643" : "#d6924d");
    }
  }
}

// Short, irregular wood-grain marks, kept within the pale tabletop.
for (let i = 0; i < 95; i++) {
  const x = 10 + Math.floor(rand() * 29);
  const y = 10 + Math.floor(rand() * 29);
  if (Math.hypot(x - cx, y - cy) > 14.7) continue;
  const length = 1 + Math.floor(rand() * 4);
  const color = rand() < 0.65 ? "#c88745" : "#f1b16b";
  for (let j = 0; j < length; j++) {
    if (Math.hypot(x + j - cx, y - cy) < 15.2) set(x + j, y, 32, color);
  }
}

// A few darker flecks on the exposed edge emphasize its layered thickness.
for (let i = 0; i < 105; i++) {
  const a = rand() * Math.PI * 2;
  const x = Math.round(cx + Math.cos(a) * 18.2);
  const y = Math.round(cy + Math.sin(a) * 18.2);
  const z = rand() < 0.55 ? 29 : 30;
  if (get(x, y, z)) set(x, y, z, rand() < 0.5 ? "#80491f" : "#e09a50");
}