fogón

← Casa completaObjeto 3Dfogon/jaula-de-pajaro

Jaula de pájaro

de fogonCC04213 bloques
Jaula de pájaroArrastrá para girarlo
// «Jaula de pájaro» · gpt-6-sol (medium)
// A birdcage: a domed golden wire cage with thin vertical bars, a ring on top, a perch inside with a small yellow canary, and a seed dish, standing on a tall slim stand.

const walnut = "#795033";
const woodLight = "#ae7645";
const woodDark = "#60402e";
const gold = "#e7b956";
const goldLight = "#ffe09a";
const goldDark = "#b78335";
const cream = "#fff0ce";

// A broad, low wooden foot and a turned, slender pedestal.
box(12, 22, 0, 36, 26, 1, walnut);
box(22, 12, 0, 26, 36, 1, walnut);
box(15, 23, 2, 33, 25, 2, woodLight);
box(23, 15, 2, 25, 33, 2, woodLight);
for (const [x, y] of [[12, 24], [36, 24], [24, 12], [24, 36]]) {
  sphere(x, y, 1, 2, woodLight);
}
cylinder(24, 24, 3, 4, 3, walnut);
cylinder(24, 24, 6, 3, 11, walnut);
cylinder(24, 24, 7, 4, 2, woodLight);
cylinder(24, 24, 17, 3, 3, walnut);
cylinder(24, 24, 19, 5, 2, woodLight);
for (let z = 7; z <= 16; z += 3) {
  cylinder(24, 24, z, 3.4, 1, woodLight);
}
for (const [x, y] of [[15, 24], [33, 24], [24, 15], [24, 33]]) {
  line(24, 24, 17, x, y, 21, 1, walnut);
}

// Solid, gently rounded cage tray.
for (let z = 21; z <= 24; z++) {
  const radius = z === 21 ? 11.5 : 13;
  for (let x = 10; x <= 38; x++) {
    for (let y = 10; y <= 38; y++) {
      if ((x - 24) ** 2 + (y - 24) ** 2 <= radius ** 2) {
        const edge = (x - 24) ** 2 + (y - 24) ** 2 > (radius - 2) ** 2;
        set(x, y, z, edge ? (z === 24 ? goldLight : goldDark) : (z === 24 ? "#d9ae66" : woodLight));
      }
    }
  }
}
for (let i = 0; i < 64; i++) {
  const a = i * Math.PI * 2 / 64;
  set(24 + 11.5 * Math.cos(a), 24 + 11.5 * Math.sin(a), 24, cream);
}

// Perch, seed dish, and scattered seeds inside the cage.
line(15, 24, 28, 33, 24, 28, 1, woodLight);
set(15, 24, 28, woodDark);
set(33, 24, 28, woodDark);
ellipsoid(18, 20, 25, 4, 3, 1, "#b7cfc5");
ellipsoid(18, 20, 26, 3, 2, 1, cream);
box(16, 19, 27, 20, 21, 27, "#f5d6a4");
for (const [x, y] of [[17, 19], [19, 20], [18, 21], [20, 19]]) {
  set(x, y, 28, "#b88a4c");
}

// The canary is its own gently hopping part.
part("canary", [26, 22, 29]);
ellipsoid(26, 22, 31, 3, 2, 2, "#ffd858");
ellipsoid(26, 19, 31, 2, 1, 1, "#f5b940");
line(24, 23, 30, 21, 25, 29, 1, "#eab342");
set(21, 25, 28, "#ffd858");
sphere(28, 20, 33, 2, "#ffe476");
set(29, 18, 34, "#292b31");
set(30, 18, 32, "#ed9242");
set(31, 18, 32, "#f7ba55");
for (const x of [25, 27]) {
  set(x, 22, 29, "#aa7440");
  set(x, 23, 28, "#aa7440");
}
animate("canary", { type: "bob", axis: "z", amplitude: 1, speed: 3 });
part("body");

// Twenty slim upright bars bend inward to form the dome.
const bars = 20;
const domeRadius = {
  35: 12.7, 36: 12.2, 37: 11.3, 38: 10.2,
  39: 8.7, 40: 6.7, 41: 4.2, 42: 1.8
};
for (let i = 0; i < bars; i++) {
  const a = i * Math.PI * 2 / bars;
  const shade = Math.sin(a) < -0.15 ? goldLight : gold;
  for (let z = 25; z <= 42; z++) {
    const r = z <= 34 ? 13 : domeRadius[z];
    set(24 + r * Math.cos(a), 24 + r * Math.sin(a), z, shade);
  }
}

// Continuous hoops tie the fine bars together.
function hoop(z, r, color) {
  for (let i = 0; i < 144; i++) {
    const a = i * Math.PI * 2 / 144;
    set(24 + r * Math.cos(a), 24 + r * Math.sin(a), z, color);
  }
}
hoop(25, 13, goldLight);
hoop(34, 13, gold);
hoop(38, 10.2, goldLight);
hoop(41, 4.2, gold);
sphere(24, 24, 42, 2, goldDark);
set(24, 22, 42, goldLight);

// Hanging ring, standing vertically above the crown.
for (let i = 0; i < 72; i++) {
  const a = i * Math.PI * 2 / 72;
  set(24 + 2.3 * Math.cos(a), 24, 43 + 2.3 * Math.sin(a), goldLight);
}
set(24, 23, 45, cream);