fogón

← Nature3D assetfogon/helecho

Helecho

by fogonCC02931 blocks
HelechoDrag to turn it
// «Helecho» · gpt-6-sol (medium)
// A fern: about eight long arching bright green fronds with small leaflets on both sides, spreading out from a center like a fountain, low to the ground.

// A low, fountain-shaped fern with eight arching fronds.
const cx = 24, cy = 24;
const dark = "#268b2e";
const stem = "#329d30";
const mid = "#49bd30";
const bright = "#67d83b";
const sun = "#86e653";

// Small root crown, tucked beneath the leaves.
ellipsoid(cx, cy, 1, 3.5, 3.5, 1.5, "#75512d");
ellipsoid(cx, cy, 2, 2.7, 2.7, 1.5, dark);

for (let f = 0; f < 8; f++) {
  const angle = f * Math.PI / 4 + 0.08;
  const dx = Math.cos(angle), dy = Math.sin(angle);
  const sx = -dy, sy = dx;
  const reach = [19, 18, 20, 18, 19, 18, 20, 18][f];

  function point(t) {
    const r = reach * t;
    return {
      x: cx + dx * r,
      y: cy + dy * r,
      z: 4 + 13 * Math.sin(Math.PI * t) - 0.7 * t
    };
  }

  // Draw the central rib first, so the leaflets grow around it.
  for (let i = 0; i < 32; i++) {
    const a = point(i / 32), b = point((i + 1) / 32);
    line(a.x, a.y, a.z, b.x, b.y, b.z,
      i < 19 ? 0.8 : 0.45, i < 24 ? stem : mid);
  }

  // Paired, tapered leaflets, angled slightly toward the frond tip.
  for (let k = 0; k < 9; k++) {
    const t = 0.14 + k * 0.094;
    const base = point(t);
    const fullness = Math.sin(Math.PI * (k + 1) / 10);
    const length = 2.5 + 3.1 * fullness;

    for (const side of [-1, 1]) {
      for (let j = 0; j <= 11; j++) {
        const u = j / 11;
        const width = (0.35 + 1.45 * fullness) *
          Math.pow(Math.sin(Math.PI * u), 0.7);

        for (let v = -width; v <= width + 0.01; v += 0.65) {
          const across = side * length * u + v;
          const forward = length * u * 0.36;
          const x = base.x + sx * across + dx * forward;
          const y = base.y + sy * across + dy * forward;
          const z = base.z - 1.55 * u - 0.2 * Math.abs(v);
          const shade = rand();

          set(x, y, z - 1, shade < 0.24 ? dark : stem);
          set(x, y, z,
            shade < 0.12 ? mid : shade > 0.83 ? sun : bright);
        }
      }
    }
  }

  // Visible bright ridge along each arch.
  for (let i = 3; i < 32; i++) {
    const p = point(i / 32);
    set(p.x, p.y, p.z + 0.4, i % 5 === 0 ? sun : mid);
  }
}

// Fresh little shoots at the heart of the plant.
ellipsoid(cx, cy, 4, 2.2, 2.2, 2, mid);
set(cx, cy, 6, sun);
set(cx + 1, cy, 5, bright);
set(cx, cy - 1, 5, bright);