fogón

← CiudadObjeto 3Dfogon/auto-compacto

Auto compacto

de fogonCC013908 bloques
Auto compactoArrastrá para girarlo
// «Auto compacto» · gpt-6-sol (medium)
// A small cute compact car: a short rounded hatchback in sky blue, longer along y but stubby, big round headlights at the front (-y), dark windows, a little roof rack and four chunky black wheels.

const blue = ["#67c9ed", "#71d2f1", "#5dbce5"];
const paleBlue = "#9de3f5";
const shadowBlue = "#409bc8";
const glass = "#263f51";
const glassLight = "#42677b";
const rubber = "#20262b";
const rubberEdge = "#353a3e";
const silver = "#cbd8d7";
const cream = "#fff1bc";

// Rounded, solid hatchback body. Its long direction is y; the nose faces -y.
for (let z = 5; z <= 14; z++) {
  for (let y = 6; y <= 41; y++) {
    let inset = (y === 6 || y === 41) ? 3 :
                (y === 7 || y === 40) ? 2 : 0;
    if (z >= 13) inset += 1;
    for (let x = 12 + inset; x <= 36 - inset; x++) {
      // Recesses leave room for the four chunky wheels.
      const atWheel = Math.abs(y - 12) <= 5 || Math.abs(y - 35) <= 5;
      if (atWheel && z <= 10 && (x <= 13 || x >= 35)) continue;
      let color = z >= 12 ? paleBlue : z <= 7 ? shadowBlue : blue[0];
      if (z >= 8 && z <= 11 && rand() < 0.12) color = blue[1];
      if (z >= 8 && z <= 11 && rand() < 0.05) color = blue[2];
      set(x, y, z, color);
    }
  }
}

// Rounded nose and tail, with toy-sized bumpers.
box(15, 5, 7, 33, 6, 12, blue[0]);
box(15, 41, 7, 33, 42, 12, blue[2]);
box(15, 4, 5, 33, 5, 6, silver);
box(17, 3, 5, 31, 4, 5, "#e4eae0");
box(15, 42, 5, 33, 43, 6, "#a8bac0");
box(17, 43, 5, 31, 43, 5, silver);

// Low, gently sloped passenger cabin.
for (let z = 15; z <= 22; z++) {
  const step = z - 15;
  const front = 14 + Math.floor(step * 0.95);
  const rear = 39 - Math.floor(step * 0.65);
  const side = step >= 6 ? 18 : step >= 3 ? 16 : 15;
  for (let y = front; y <= rear; y++) {
    for (let x = side; x <= 48 - side; x++) {
      set(x, y, z, z === 22 ? paleBlue : blue[0]);
    }
  }
}

// Dark windshield follows the sloping front face; blue pillars frame it.
for (let z = 17; z <= 20; z++) {
  const y = 14 + Math.floor((z - 15) * 0.95);
  const edge = z >= 18 ? 16 : 15;
  for (let x = edge + 2; x <= 48 - edge - 2; x++)
    set(x, y - 1, z, x < 23 ? glassLight : glass);
}
box(17, 19, 22, 31, 34, 22, paleBlue);

// Side windows, divided by a broad central pillar.
for (let z = 17; z <= 20; z++) {
  const side = z >= 18 ? 16 : 15;
  const frontLimit = 14 + Math.floor((z - 15) * 0.95);
  const backLimit = 39 - Math.floor((z - 15) * 0.65);
  for (const x of [side, 48 - side]) {
    for (let y = Math.max(frontLimit + 2, 19); y <= Math.min(24, backLimit - 1); y++)
      set(x, y, z, y < 22 ? glassLight : glass);
    for (let y = 27; y <= Math.min(35, backLimit - 1); y++)
      set(x, y, z, y < 30 ? glassLight : glass);
  }
}
// Rear window.
for (let z = 17; z <= 20; z++) {
  const y = 39 - Math.floor((z - 15) * 0.65);
  for (let x = 18; x <= 30; x++) set(x, y + 1, z, glass);
}

// Roof rack: two rails, feet, and bright crossbars.
for (const x of [18, 30]) {
  for (const y of [23, 32]) box(x, y, 23, x + 1, y + 1, 24, "#465b60");
  box(x, 21, 25, x + 1, 34, 25, silver);
  box(x, 21, 26, x + 1, 34, 26, "#738d90");
}
for (const y of [23, 32]) box(19, y, 25, 29, y, 25, "#b3c8c8");

// Big friendly headlights, small amber turn signals, and a smiling grille.
for (const x of [18, 28]) {
  box(x, 4, 9, x + 3, 5, 12, "#f1d58d");
  box(x, 3, 10, x + 3, 4, 11, cream);
  set(x + 1, 3, 11, "#ffffff");
}
box(15, 4, 9, 16, 4, 10, "#ffb248");
box(32, 4, 9, 33, 4, 10, "#ffb248");
box(21, 4, 7, 27, 4, 8, "#344d59");
box(22, 3, 6, 26, 3, 6, "#fff7e4");
set(24, 3, 6, "#efb74e");

// Rear lamps and plate.
for (const x of [15, 31]) {
  box(x, 43, 8, x + 2, 43, 11, "#d94c51");
  box(x, 43, 11, x + 2, 43, 12, "#ffad63");
}
box(22, 43, 7, 26, 43, 8, cream);

// Side door seams, handles, mirrors, and a tiny fileteado-inspired flourish.
for (const x of [11, 37]) {
  box(x, 19, 11, x, 31, 11, paleBlue);
  box(x, 25, 8, x, 25, 14, shadowBlue);
  box(x, 20, 12, x, 22, 12, "#e8f6ed");
  box(x, 29, 12, x, 31, 12, "#e8f6ed");
  box(x, 18, 14, x, 20, 15, blue[2]);
  box(x, 21, 9, x, 24, 9, "#f3c15b");
  box(x, 27, 9, x, 30, 9, "#f3c15b");
  set(x, 25, 9, "#dd6b53");
  set(x, 26, 10, "#f3c15b");
  set(x, 27, 9, "#dd6b53");
}

// Wheel-arch edging remains fixed to the car.
for (const x of [11, 37]) {
  for (const cy of [12, 35]) {
    for (let y = cy - 7; y <= cy + 7; y++) {
      for (let z = 5; z <= 12; z++) {
        const d = Math.hypot(y - cy, z - 5);
        if (d >= 5.8 && d <= 6.8) set(x, y, z, shadowBlue);
      }
    }
  }
}

// Each wheel is a separate spinning part, pivoted precisely on its axle.
for (const cy of [12, 35]) {
  for (const side of ["left", "right"]) {
    const cx = side === "left" ? 10 : 38;
    const name = `wheel_${side}_${cy}`;
    part(name, [cx, cy, 5]);
    for (let x = cx - 2; x <= cx + 2; x++) {
      for (let y = cy - 5; y <= cy + 5; y++) {
        for (let z = 0; z <= 10; z++) {
          const d = Math.hypot(y - cy, z - 5);
          if (d > 5.25) continue;
          const outerFace = x === (side === "left" ? cx - 2 : cx + 2);
          let c = d > 4.35 ? rubber : rubberEdge;
          if (outerFace && d < 3.15) c = silver;
          if (outerFace && d < 2.35) c = "#8caaae";
          if (outerFace && (Math.abs(y - cy) <= 0.6 || Math.abs(z - 5) <= 0.6) && d < 2.5)
            c = "#e4e8de";
          if (outerFace && d < 0.9) c = "#536f79";
          set(x, y, z, c);
        }
      }
    }
    animate(name, { type: "spin", axis: "x", speed: 6 });
  }
}
part("body", [24, 24, 0]);