fogón

← Level pieces 23D assetfogon/nivel-sierra-giratoria

Sierra giratoria

by fogonCC05088 blocks
Sierra giratoriaDrag to turn it
// «Sierra giratoria» · gpt-6-sol (medium)
// A spinning saw blade trap: a dark grey steel base block 48 long on x, 10 deep, 6 tall (z 0..5) with yellow-black hazard stripes on its front, with a slot on top. Rising from the slot, a big circular saw blade standing upright facing -y, radius 18, 2 blocks thick (axis y), centered at x 24, z 22, light silver steel with a darker inner ring, a red hub and 12 sharp triangular teeth around the rim.

// Fixed steel base: a full 48-block modular length.
box(0, 19, 0, 47, 28, 5, "#515c65");
box(0, 20, 5, 47, 28, 5, "#808c95");
box(0, 19, 0, 47, 19, 0, "#303941");
box(0, 28, 1, 47, 28, 4, "#444e57");

// Diagonal hazard stripes across the front.
for (let x = 0; x < 48; x++) {
  for (let z = 1; z <= 4; z++) {
    const yellow = Math.floor((x + z * 2) / 5) % 2 === 0;
    set(x, 19, z, yellow ? "#ffd33d" : "#252b32");
  }
}
box(0, 19, 5, 47, 19, 5, "#a0abb2");

// Recessed blade slot, with bright steel edges.
box(5, 21, 5, 42, 26, 5, "#202a32");
box(5, 20, 5, 42, 20, 5, "#b2bec6");
box(5, 27, 5, 42, 27, 5, "#a1adb6");
box(4, 20, 5, 4, 27, 5, "#c0cad0");
box(43, 20, 5, 43, 27, 5, "#9aa6ae");

part("sierra", [24, 24, 22]);

// Two-block-thick upright steel disc.
for (let x = 5; x <= 43; x++) {
  for (let z = 3; z <= 41; z++) {
    const d = Math.hypot(x - 24, z - 22);
    if (d > 18) continue;

    let face = z > 22 ? "#e8f0f3" : "#d3dfe5";
    if (d > 16.3) face = "#b7c5cd";
    else if (d > 11 && d < 11.8) face = "#f7fbfa";
    if (d >= 8 && d <= 10.6) face = "#87969f";
    if (d < 7.8) face = "#dbe7eb";

    set(x, 23, z, face);
    set(x, 24, z, d > 16.3 ? "#85949e" : "#aebdc6");
  }
}

// Twelve swept, pointed teeth. Each is a filled triangle joined to the rim.
function insideTriangle(x, z, a, b, c) {
  const cross = (p, q, r) =>
    (q.x - p.x) * (r.z - p.z) - (q.z - p.z) * (r.x - p.x);
  const p = { x, z };
  const u = cross(a, b, p), v = cross(b, c, p), w = cross(c, a, p);
  return (u >= 0 && v >= 0 && w >= 0) ||
         (u <= 0 && v <= 0 && w <= 0);
}
for (let i = 0; i < 12; i++) {
  const angle = i * Math.PI / 6;
  const point = (r, a) => ({
    x: 24 + r * Math.cos(a),
    z: 22 + r * Math.sin(a)
  });
  const a = point(16.8, angle - 0.18);
  const b = point(16.8, angle + 0.18);
  const tip = point(21.2, angle + 0.11);

  for (let x = 2; x <= 46; x++) {
    for (let z = 0; z <= 44; z++) {
      if (!insideTriangle(x, z, a, b, tip)) continue;
      set(x, 23, z, "#edf4f5");
      set(x, 24, z, "#a5b4bd");
    }
  }
}

// Eight small dark ventilation ports emphasize the spinning disc.
for (let i = 0; i < 8; i++) {
  const angle = (i + 0.5) * Math.PI / 4;
  const cx = 24 + 13.7 * Math.cos(angle);
  const cz = 22 + 13.7 * Math.sin(angle);
  for (let x = Math.floor(cx - 2); x <= Math.ceil(cx + 2); x++) {
    for (let z = Math.floor(cz - 2); z <= Math.ceil(cz + 2); z++) {
      if ((x - cx) ** 2 + (z - cz) ** 2 <= 2.1) {
        set(x, 23, z, "#596973");
      }
    }
  }
}

// Raised red hub and its bright central fastener.
for (let x = 19; x <= 29; x++) {
  for (let z = 17; z <= 27; z++) {
    const d = Math.hypot(x - 24, z - 22);
    if (d <= 4.5) set(x, 22, z, "#a5323c");
    if (d <= 3.5) set(x, 22, z, z >= 22 ? "#f3524e" : "#d6383e");
    if (d <= 1.5) set(x, 21, z, "#ffe199");
  }
}

animate("sierra", { type: "spin", axis: "y", speed: 6 });