fogón

← Parties and Christmas3D assetfogon/calcetin-navideno

Calcetín navideño

by fogonCC07979 blocks
Calcetín navideñoDrag to turn it
// «Calcetín navideño» · gpt-6-sol (medium)
// A big Christmas stocking hanging from a little golden hook on a short wooden post: red with a white fluffy cuff at the top, a green heel and toe, a white snowflake pattern on the side, and small toys peeking out of the top (a candy cane and a teddy bear head).

const red = "#dd283c", redLight = "#f24750", redDark = "#b91d32";
const green = "#219c62", greenLight = "#39bd77", greenDark = "#147c50";
const cream = "#fff8e9", snow = "#ffffff", shadow = "#dce9e5";
const gold = "#f7c64d", goldLight = "#ffe384", goldDark = "#c88c29";

// Wooden stand and broad, stable base.
box(7, 25, 0, 16, 33, 2, "#875333");
box(8, 26, 2, 15, 32, 3, "#ad7041");
box(10, 27, 3, 14, 31, 41, "#a86a3b");
box(10, 27, 4, 11, 27, 40, "#c28a51");
box(13, 31, 5, 14, 31, 39, "#75482e");
for (let z = 7; z < 39; z += 7) {
  line(11, 26, z, 11, 26, z + 3, 0, "#daa269");
}
box(9, 25, 40, 20, 32, 42, "#996039");
box(10, 25, 42, 20, 31, 43, "#c58a4d");
box(10, 25, 40, 19, 25, 40, "#75482e");

// Little golden hook beneath the end of the beam.
line(18, 23, 40, 21, 23, 40, 1, goldDark);
line(21, 23, 40, 21, 23, 37, 1, gold);
line(21, 23, 37, 19, 23, 37, 1, gold);
set(19, 23, 38, goldLight);
line(18, 22, 41, 20, 22, 41, 0, goldLight);

// Stocking leg: round, slightly tapered, and leaning toward the foot.
for (let z = 12; z <= 36; z++) {
  const t = (z - 12) / 24;
  const cx = 29.5 - 3 * t;
  const rx = 5.2 + 1.6 * t;
  const ry = 5.5 + 0.5 * t;
  for (let x = 19; x <= 36; x++) {
    for (let y = 14; y <= 29; y++) {
      const q = ((x - cx) / rx) ** 2 + ((y - 21) / ry) ** 2;
      if (q <= 1) {
        let c = y <= 17 ? redLight : y >= 26 ? redDark : red;
        if (rand() < 0.055) c = y <= 21 ? "#fa5960" : "#cb2338";
        set(x, y, z, c);
      }
    }
  }
}

// Plump horizontal foot, with a distinctly green heel and toe.
ellipsoid(33, 21, 9, 11, 6, 7, redDark);
ellipsoid(33, 21, 10, 10, 6, 6, red);
ellipsoid(25, 21, 9, 5, 6, 6, greenDark);
ellipsoid(26, 20, 10, 4, 5, 5, green);
ellipsoid(40, 21, 9, 5, 6, 6, green);
ellipsoid(40, 20, 10, 4, 5, 5, greenLight);
for (let x = 30; x <= 37; x++) {
  for (let z = 12; z <= 14; z++) {
    if (get(x, 16, z) && rand() < 0.65) set(x, 16, z, redLight);
  }
}
line(38, 15, 11, 41, 15, 11, 0, "#79d695");

// White snowflake embroidered on the front of the leg.
const flake = (x, z, color = snow) => {
  set(x, 14, z, color);
  set(x, 15, z, color);
};
for (let d = -4; d <= 4; d++) {
  flake(27 + d, 25);
  flake(27, 25 + d);
}
for (let d = -3; d <= 3; d++) {
  flake(27 + d, 25 + d);
  flake(27 + d, 25 - d);
}
for (const [x, z] of [
  [22, 24], [22, 26], [32, 24], [32, 26],
  [26, 20], [28, 20], [26, 30], [28, 30]
]) flake(x, z, cream);
set(27, 13, 25, snow);

// Thick, fluffy cuff with a dark opening for the toys.
ellipsoid(26, 21, 37, 9, 8, 4, shadow);
box(19, 15, 35, 33, 27, 39, cream);
box(21, 17, 40, 31, 25, 40, shadow);
box(23, 19, 40, 30, 24, 40, "#8e2937");
for (let x = 20; x <= 33; x += 3) {
  sphere(x, 15, 35, 2, x % 2 ? snow : cream);
  sphere(x, 16, 39, 2, snow);
  sphere(x, 27, 36, 2, shadow);
}
for (let y = 18; y <= 25; y += 3) {
  sphere(19, y, 37, 2, snow);
  sphere(33, y, 37, 2, cream);
}
line(22, 14, 38, 30, 14, 38, 0, snow);

// Candy cane sticking out on the left, with a curved striped crook.
for (let z = 39; z <= 44; z++) {
  sphere(22, 18, z, 1, z % 3 === 0 ? redLight : cream);
}
for (const [x, z, c] of [
  [22, 45, cream], [23, 46, redLight], [24, 46, cream],
  [25, 46, redLight], [26, 45, cream], [26, 44, redLight]
]) sphere(x, 18, z, 1, c);

// Teddy bear's ears and round head peek above the cuff.
sphere(27, 20, 44, 2, "#b67b48");
sphere(34, 20, 44, 2, "#b67b48");
set(27, 17, 44, "#e8af83");
set(34, 17, 44, "#e8af83");
ellipsoid(30, 21, 43, 4, 3, 3, "#c58a53");
ellipsoid(30, 18, 42, 2, 1, 2, "#efd0a3");
set(28, 17, 44, "#342b30");
set(32, 17, 44, "#342b30");
set(30, 16, 43, "#54363a");
set(29, 16, 41, "#ad6b62");
set(31, 16, 41, "#ad6b62");