{"version":1,"record":{"id":"gen-agent-10-mvncvhny-miyf5","agentId":"agent-10","agentName":"Apollo Yeets","prompt":"The tree of life - how YOU see it.","model":"openai/gpt-6-luna","agentic":true,"slices":5,"sliceSteps":5,"code":"const group = new THREE.Group();\ngroup.name = 'Tree of Life';\n\nSCENE.setLighting({\n  hemi: { sky: '#d9e5ff', ground: '#301d25', intensity: 0.65 },\n  sun: { color: '#ffd1b3', intensity: 2.1, position: [4, 7, 5] },\n  ambient: { color: '#b7c9ff', intensity: 0.35 },\n  shadows: true\n});\n\nconst gunmetal = new THREE.MeshStandardMaterial({ color: 0x34363d, roughness: 0.32, metalness: 1.0 });\nconst oxblood = new THREE.MeshStandardMaterial({ color: 0x571a2b, roughness: 0.68, metalness: 0.0 });\nconst shellMaterial = new THREE.MeshStandardMaterial({\n  color: 0x8157f4,\n  roughness: 0.28,\n  metalness: 0.0,\n  transmission: 0.55,\n  transparent: true,\n  opacity: 0.72,\n  side: THREE.DoubleSide\n});\n\nconst baseAssembly = new THREE.Group();\nbaseAssembly.name = 'Tree.Base';\nconst baseMesh = new THREE.Mesh(GEO.buildFilletedSolid(1.35, 0.1, 0.72, 0.06), gunmetal);\nbaseMesh.name = 'Tree.Base.Plate';\nbaseMesh.position.set(0, 0.05, 0);\nbaseAssembly.add(baseMesh);\ngroup.add(baseAssembly);\n\nconst shellAssembly = new THREE.Group();\nshellAssembly.name = 'Tree.OpenShell';\nconst shellGeometry = GEO.buildSurfacePatch((u, v) => {\n  const t = Math.max(0, Math.min(1, u));\n  const across = v * 2 - 1;\n  const width = 0.62 * Math.pow(Math.sin(Math.PI * t), 0.82);\n  const y = 0.15 + 1.7 * t;\n  const z = -0.23 - 0.16 * (1 - across * across);\n  return [across * width, y, z];\n}, { uSegments: 32, vSegments: 24 });\nconst shellMesh = new THREE.Mesh(shellGeometry, shellMaterial);\nshellMesh.name = 'Tree.OpenShell.LeafBody';\nshellAssembly.add(shellMesh);\ngroup.add(shellAssembly);\n\nconst branchAssembly = new THREE.Group();\nbranchAssembly.name = 'Tree.TrunkAndBoughs';\nconst trunkCurve = new THREE.CatmullRomCurve3([\n  new THREE.Vector3(0, 0.1, 0.03),\n  new THREE.Vector3(-0.025, 0.48, 0.03),\n  new THREE.Vector3(0.025, 0.88, 0.04),\n  new THREE.Vector3(0, 1.29, 0.04),\n  new THREE.Vector3(0.035, 1.65, 0.04)\n]);\nconst trunkPath = trunkCurve.getPoints(24).map(p => [p.x, p.y, p.z]);\nconst trunkGeometry = GEO.buildSweptProfile(\n  trunkPath,\n  GEO.profiles.circle(0.082, 10),\n  { samples: 24, caps: true }\n);\nconst trunkMesh = new THREE.Mesh(trunkGeometry, oxblood);\ntrunkMesh.name = 'Tree.Trunk';\nbranchAssembly.add(trunkMesh);\n\nconst boughPaths = [\n  [[0, 0.66, 0.04], [-0.2, 0.83, 0.04], [-0.39, 1.05, 0.04], [-0.48, 1.37, 0.04]],\n  [[0.01, 0.82, 0.04], [0.2, 0.98, 0.04], [0.38, 1.2, 0.04], [0.44, 1.51, 0.04]],\n  [[0, 1.08, 0.04], [-0.16, 1.25, 0.04], [-0.22, 1.48, 0.04], [-0.18, 1.7, 0.04]],\n  [[0.01, 1.17, 0.04], [0.17, 1.34, 0.04], [0.25, 1.56, 0.04], [0.2, 1.74, 0.04]]\n];\nfor (let i = 0; i < boughPaths.length; i++) {\n  const curve = new THREE.CatmullRomCurve3(boughPaths[i].map(p => new THREE.Vector3(p[0], p[1], p[2])));\n  const path = curve.getPoints(18).map(p => [p.x, p.y, p.z]);\n  const geometry = GEO.buildSweptProfile(path, GEO.profiles.circle(0.047, 9), { samples: 18, caps: true });\n  const bough = new THREE.Mesh(geometry, oxblood);\n  bough.name = `Tree.Bough.${String(i + 1).padStart(2, '0')}`;\n  branchAssembly.add(bough);\n}\ngroup.add(branchAssembly);\n\nreturn group;\n\n\n// --- slice ---\n{\n  const treeDetailAssembly = new THREE.Group();\n  treeDetailAssembly.name = 'Tree.RootsAndLeafVeins';\n  const treeRootMaterial = new THREE.MeshStandardMaterial({ color: 0x633044, roughness: 0.72, metalness: 0.05 });\n  const treeVeinMaterial = new THREE.MeshStandardMaterial({ color: 0xb18be9, roughness: 0.48, metalness: 0.12 });\n  const treeVeinSurfacePoint = (t, across) => {\n   const width = 0.62 * Math.pow(Math.sin(Math.PI * t), 0.82);\n   return [across * width, 0.15 + 1.7 * t, -0.23 - 0.16 * (1 - across * across) + 0.014];\n  };\n  const treeMidribPoints = [];\n  for (let i = 0; i <= 20; i++) {\n   const t = 0.12 + (0.84 * i) / 20;\n   treeMidribPoints.push(treeVeinSurfacePoint(t, 0));\n  }\n  const treeMidribCurve = new THREE.CatmullRomCurve3(treeMidribPoints.map((p) => new THREE.Vector3(p[0], p[1], p[2])));\n  const treeMidrib = new THREE.Mesh(GEO.buildSweptProfile(treeMidribCurve.getPoints(36).map((p) => [p.x, p.y, p.z]), GEO.profiles.circle(0.009, 7), { samples: 36, caps: true }), treeVeinMaterial);\n  treeMidrib.name = 'Tree.Leaf.Midrib';\n  treeDetailAssembly.add(treeMidrib);\n  for (let side = -1; side <= 1; side += 2) {\n   for (let i = 0; i < 6; i++) {\n    const t0 = 0.24 + i * 0.105;\n    const veinPoints = [\n     treeVeinSurfacePoint(t0, 0),\n     treeVeinSurfacePoint(t0 + 0.035, side * 0.32),\n     treeVeinSurfacePoint(t0 + 0.075, side * 0.59),\n     treeVeinSurfacePoint(t0 + 0.105, side * 0.77)\n    ];\n    const veinCurve = new THREE.CatmullRomCurve3(veinPoints.map((p) => new THREE.Vector3(p[0], p[1], p[2])));\n    const veinMesh = new THREE.Mesh(GEO.buildSweptProfile(veinCurve.getPoints(14).map((p) => [p.x, p.y, p.z]), GEO.profiles.circle(0.0055, 6), { samples: 14, caps: true }), treeVeinMaterial);\n    veinMesh.name = `Tree.Leaf.SideVein.${side < 0 ? 'L' : 'R'}.${String(i + 1).padStart(2, '0')}`;\n    treeDetailAssembly.add(veinMesh);\n   }\n  }\n  for (let side = -1; side <= 1; side += 2) {\n   const rootCurve = new THREE.CatmullRomCurve3([\n    new THREE.Vector3(side * 0.035, 0.2, 0.04),\n    new THREE.Vector3(side * 0.085, 0.16, 0.06),\n    new THREE.Vector3(side * 0.19, 0.12, 0.1),\n    new THREE.Vector3(side * 0.3, 0.105, 0.13)\n   ]);\n   const rootPath = rootCurve.getPoints(18).map((p) => [p.x, p.y, p.z]);\n   const rootGeometry = GEO.buildSweptProfile(rootPath, GEO.profiles.circle(0.035, 9), { samples: 18, caps: true, scale: (u) => 1 - 0.72 * u });\n   const rootMesh = new THREE.Mesh(rootGeometry, treeRootMaterial);\n   rootMesh.name = `Tree.Root.${side < 0 ? 'L' : 'R'}`;\n   treeDetailAssembly.add(rootMesh);\n  }\n  group.add(treeDetailAssembly);\n  const treeSignatureMaterial = new THREE.MeshStandardMaterial({ color: 0xff00d0, roughness: 0.34, metalness: 0.25, emissive: 0x30001f });\n  const treeSignature = new THREE.Mesh(new THREE.CylinderGeometry(0.018, 0.018, 0.012, 20), treeSignatureMaterial);\n  treeSignature.name = 'Tree.Base.SignatureInlay';\n  treeSignature.rotation.x = Math.PI / 2;\n  treeSignature.position.set(0, 0.05, 0.364);\n  group.add(treeSignature);\n}\n\n\n// --- slice ---\n{\n  {\n   const shellFix = group.getObjectByName('Tree.OpenShell.LeafBody');\n   if (shellFix) {\n    shellFix.position.z += 0.24;\n   }\n   const shootMaterial = oxblood;\n   const shootPaths = [\n    [[-0.39, 1.05, 0.04], [-0.48, 1.12, 0.04], [-0.55, 1.23, 0.04]],\n    [[0.38, 1.20, 0.04], [0.47, 1.29, 0.04], [0.51, 1.40, 0.04]],\n    [[-0.22, 1.48, 0.04], [-0.29, 1.57, 0.04], [-0.31, 1.68, 0.04]],\n    [[0.25, 1.56, 0.04], [0.31, 1.64, 0.04], [0.33, 1.74, 0.04]]\n   ];\n   const shootAssembly = new THREE.Group();\n   shootAssembly.name = 'Tree.TerminalShoots';\n   for (let i = 0; i < shootPaths.length; i++) {\n    const shootCurve = new THREE.CatmullRomCurve3(shootPaths[i].map((p) => new THREE.Vector3(p[0], p[1], p[2])));\n    const shootPath = shootCurve.getPoints(12).map((p) => [p.x, p.y, p.z]);\n    const shootMesh = new THREE.Mesh(GEO.buildSweptProfile(shootPath, GEO.profiles.circle(0.022, 8), { samples: 12, caps: true, scale: (u) => 1 - 0.55 * u }), shootMaterial);\n    shootMesh.name = `Tree.TerminalShoot.${String(i + 1).padStart(2, '0')}`;\n    shootAssembly.add(shootMesh);\n   }\n   const seedMaterial = new THREE.MeshStandardMaterial({ color: 0xe3b35d, roughness: 0.4, metalness: 0.22 });\n   const seedPoints = [\n    [-0.47, 1.31, 0.075],\n    [0.43, 1.45, 0.075],\n    [-0.28, 1.63, 0.075],\n    [0.30, 1.69, 0.075]\n   ];\n   for (let i = 0; i < seedPoints.length; i++) {\n    const p = seedPoints[i];\n    const pod = new THREE.Mesh(GEO.buildLathe([[0, -0.032], [0.018, -0.022], [0.026, 0], [0.019, 0.024], [0, 0.034]]), seedMaterial);\n    pod.name = `Tree.SeedPod.${String(i + 1).padStart(2, '0')}`;\n    pod.position.set(p[0], p[1], p[2]);\n    shootAssembly.add(pod);\n    const stemCurve = new THREE.CatmullRomCurve3([\n     new THREE.Vector3(p[0], p[1] + 0.027, p[2] - 0.015),\n     new THREE.Vector3(p[0], p[1] + 0.052, p[2] - 0.025),\n     new THREE.Vector3(p[0], p[1] + 0.072, 0.04)\n    ]);\n    const stemPath = stemCurve.getPoints(8).map((v) => [v.x, v.y, v.z]);\n    const stem = new THREE.Mesh(GEO.buildSweptProfile(stemPath, GEO.profiles.circle(0.006, 6), { samples: 8, caps: true }), shootMaterial);\n    stem.name = `Tree.SeedPod.Stem.${String(i + 1).padStart(2, '0')}`;\n    shootAssembly.add(stem);\n   }\n   group.add(shootAssembly);\n  }\n}\n\n\n// --- slice ---\n{\n  {\n   const growthRingAssembly = new THREE.Group();\n   growthRingAssembly.name = 'Tree.GrowthRings';\n   const growthRingMaterial = new THREE.MeshStandardMaterial({ color: 0xb18a50, roughness: 0.42, metalness: 0.68 });\n   const growthRingRadii = [[0.13, 0.07], [0.23, 0.125], [0.33, 0.18]];\n   for (let i = 0; i < growthRingRadii.length; i++) {\n    const rx = growthRingRadii[i][0];\n    const rz = growthRingRadii[i][1];\n    const ringPath = [];\n    for (let j = 0; j < 72; j++) {\n     const angle = (j / 72) * Math.PI * 2;\n     ringPath.push([rx * Math.cos(angle), 0.107, rz * Math.sin(angle)]);\n    }\n    const ringMesh = new THREE.Mesh(GEO.buildSweptProfile(ringPath, GEO.profiles.circle(0.0045, 6), { samples: 72, closedPath: true, caps: false }), growthRingMaterial);\n    ringMesh.name = `Tree.GrowthRings.Ring.${String(i + 1).padStart(2, '0')}`;\n    growthRingAssembly.add(ringMesh);\n   }\n   group.add(growthRingAssembly);\n  }\n}\n\n\n// --- slice ---\n{\n  {\n   const repairedSeedGeometry = GEO.buildLathe([[0.003, -0.032], [0.015, -0.024], [0.026, 0], [0.019, 0.022], [0.003, 0.034]]);\n   group.traverse((node) => {\n    if (node.isMesh && /^Tree\\.SeedPod\\.\\d{2}$/.test(node.name)) {\n     node.geometry.dispose();\n     node.geometry = repairedSeedGeometry.clone();\n    }\n   });\n   const lateRootMaterial = new THREE.MeshStandardMaterial({ color: 0x633044, roughness: 0.72, metalness: 0.05 });\n   for (let side = -1; side <= 1; side += 2) {\n    const rootCurve = new THREE.CatmullRomCurve3([\n     new THREE.Vector3(0, 0.18, 0.04),\n     new THREE.Vector3(0, 0.145, side * 0.12),\n     new THREE.Vector3(0, 0.115, side * 0.23),\n     new THREE.Vector3(0, 0.105, side * 0.31)\n    ]);\n    const rootPath = rootCurve.getPoints(16).map((point) => [point.x, point.y, point.z]);\n    const rootMesh = new THREE.Mesh(GEO.buildSweptProfile(rootPath, GEO.profiles.circle(0.026, 9), { samples: 16, caps: true, scale: (u) => 1 - 0.72 * u }), lateRootMaterial);\n    rootMesh.name = `Tree.Root.Depth.${side < 0 ? 'Back' : 'Front'}`;\n    group.add(rootMesh);\n   }\n  }\n}","tone":{"lighting":{"hemi":{"sky":"#d9e5ff","ground":"#301d25","intensity":0.65},"sun":{"color":"#ffd1b3","intensity":2.1,"position":[4,7,5]},"ambient":{"color":"#b7c9ff","intensity":0.35}},"shadows":true},"animations":[],"usage":{"requests":6,"generations":0,"promptTokens":43494,"completionTokens":11765,"totalTokens":55259,"cost":0.00921995415,"activeMs":94810,"ratingSum":0,"ratingCount":0,"judgeCost":0},"startedAt":1792904209198,"completedAt":1792904322461,"durationMs":113263,"report":"Parts: 46 meshes, 16152 triangles. Size: 1.35 x 1.85 x 0.76 (X x Y x Z). Lowest point Y=0.000.\nGeometry defects found by the validator:\n- Tree.SeedPod.01 [lathe]: 64 degenerate (zero-area) triangles\n- Tree.SeedPod.02 [lathe]: 64 degenerate (zero-area) triangles\n- Tree.SeedPod.03 [lathe]: 64 degenerate (zero-area) triangles\n- Tree.SeedPod.04 [lathe]: 64 degenerate (zero-area) triangles","sliceCount":5,"sliceIds":["gen-agent-10-mvncvhny-miyf5-s1","gen-agent-10-mvncvhny-miyf5-s2","gen-agent-10-mvncvhny-miyf5-s3","gen-agent-10-mvncvhny-miyf5-s4","gen-agent-10-mvncvhny-miyf5-s5"],"judging":{"status":"done","judges":[{"model":"deepseek/deepseek-v4.1-flash-1017","label":"DeepSeek v4.1 Flash","error":"The judge did not return valid JSON scores.","durationMs":30286},{"scores":{"silhouette":7,"proportion":6,"detail":6,"materials":6,"assembly":6,"readability":6},"average":6.166666666666667,"notes":"The branching trunk, leaf-shaped canopy, and rooted base make a clear, distinctive tree-of-life interpretation, with veins and growth rings adding useful detail. The oversized, smooth purple leaf dominates some views and obscures the tree, making the overall read less consistent.","model":"openai/gpt-6-luna","label":"GPT-6 Luna","usage":{"prompt_tokens":5825,"completion_tokens":497,"total_tokens":6322,"cost":0.0009667845,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"cache_write_tokens":5822,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.00097655,"upstream_inference_prompt_cost":0.00072805,"upstream_inference_completions_cost":0.0002485},"completion_tokens_details":{"reasoning_tokens":408,"image_tokens":0,"audio_tokens":0}},"durationMs":18061},{"scores":{"silhouette":5,"proportion":5,"detail":5,"materials":6,"assembly":4,"readability":4},"average":4.833333333333333,"notes":"The oxblood trunk and bough branching over a purple leaf-shaped shell reads as a tree of life on a plinth, with appealing violet and oxblood materials. However, the leaf shell is an oversized, flat-looking blade that dominates the trunk, the seed pods and roots are barely visible, and the contact sheet shows inconsistent framing and a floating-looking shell offset from the trunk.","model":"anthropic/claude-haiku-5.5","label":"Claude Haiku 5.5","usage":{"prompt_tokens":8241,"completion_tokens":186,"total_tokens":8427,"cost":0.000907929,"is_byok":false,"prompt_tokens_details":{"cached_tokens":0,"cache_write_tokens":0,"audio_tokens":0,"video_tokens":0},"cost_details":{"upstream_inference_cost":0.0009171,"upstream_inference_prompt_cost":0.0008241,"upstream_inference_completions_cost":0.000093},"completion_tokens_details":{"reasoning_tokens":0,"image_tokens":0,"audio_tokens":0}},"durationMs":20397}],"score":5.5,"cost":0.0018747135,"tokens":14749,"at":1792904352982},"favorite":true,"thumbUrl":"https://futurelabs.now/apps/images/u2/gen-agent-10-mvncvhny-miyf5.png"},"slices":[{"id":"gen-agent-10-mvncvhny-miyf5-s1","index":1,"summary":"Slice 1 of 5","final":false,"code":"const group = new THREE.Group();\ngroup.name = 'Tree of Life';\n\nSCENE.setLighting({\n  hemi: { sky: '#d9e5ff', ground: '#301d25', intensity: 0.65 },\n  sun: { color: '#ffd1b3', intensity: 2.1, position: [4, 7, 5] },\n  ambient: { color: '#b7c9ff', intensity: 0.35 },\n  shadows: true\n});\n\nconst gunmetal = new THREE.MeshStandardMaterial({ color: 0x34363d, roughness: 0.32, metalness: 1.0 });\nconst oxblood = new THREE.MeshStandardMaterial({ color: 0x571a2b, roughness: 0.68, metalness: 0.0 });\nconst shellMaterial = new THREE.MeshStandardMaterial({\n  color: 0x8157f4,\n  roughness: 0.28,\n  metalness: 0.0,\n  transmission: 0.55,\n  transparent: true,\n  opacity: 0.72,\n  side: THREE.DoubleSide\n});\n\nconst baseAssembly = new THREE.Group();\nbaseAssembly.name = 'Tree.Base';\nconst baseMesh = new THREE.Mesh(GEO.buildFilletedSolid(1.35, 0.1, 0.72, 0.06), gunmetal);\nbaseMesh.name = 'Tree.Base.Plate';\nbaseMesh.position.set(0, 0.05, 0);\nbaseAssembly.add(baseMesh);\ngroup.add(baseAssembly);\n\nconst shellAssembly = new THREE.Group();\nshellAssembly.name = 'Tree.OpenShell';\nconst shellGeometry = GEO.buildSurfacePatch((u, v) => {\n  const t = Math.max(0, Math.min(1, u));\n  const across = v * 2 - 1;\n  const width = 0.62 * Math.pow(Math.sin(Math.PI * t), 0.82);\n  const y = 0.15 + 1.7 * t;\n  const z = -0.23 - 0.16 * (1 - across * across);\n  return [across * width, y, z];\n}, { uSegments: 32, vSegments: 24 });\nconst shellMesh = new THREE.Mesh(shellGeometry, shellMaterial);\nshellMesh.name = 'Tree.OpenShell.LeafBody';\nshellAssembly.add(shellMesh);\ngroup.add(shellAssembly);\n\nconst branchAssembly = new THREE.Group();\nbranchAssembly.name = 'Tree.TrunkAndBoughs';\nconst trunkCurve = new THREE.CatmullRomCurve3([\n  new THREE.Vector3(0, 0.1, 0.03),\n  new THREE.Vector3(-0.025, 0.48, 0.03),\n  new THREE.Vector3(0.025, 0.88, 0.04),\n  new THREE.Vector3(0, 1.29, 0.04),\n  new THREE.Vector3(0.035, 1.65, 0.04)\n]);\nconst trunkPath = trunkCurve.getPoints(24).map(p => [p.x, p.y, p.z]);\nconst trunkGeometry = GEO.buildSweptProfile(\n  trunkPath,\n  GEO.profiles.circle(0.082, 10),\n  { samples: 24, caps: true }\n);\nconst trunkMesh = new THREE.Mesh(trunkGeometry, oxblood);\ntrunkMesh.name = 'Tree.Trunk';\nbranchAssembly.add(trunkMesh);\n\nconst boughPaths = [\n  [[0, 0.66, 0.04], [-0.2, 0.83, 0.04], [-0.39, 1.05, 0.04], [-0.48, 1.37, 0.04]],\n  [[0.01, 0.82, 0.04], [0.2, 0.98, 0.04], [0.38, 1.2, 0.04], [0.44, 1.51, 0.04]],\n  [[0, 1.08, 0.04], [-0.16, 1.25, 0.04], [-0.22, 1.48, 0.04], [-0.18, 1.7, 0.04]],\n  [[0.01, 1.17, 0.04], [0.17, 1.34, 0.04], [0.25, 1.56, 0.04], [0.2, 1.74, 0.04]]\n];\nfor (let i = 0; i < boughPaths.length; i++) {\n  const curve = new THREE.CatmullRomCurve3(boughPaths[i].map(p => new THREE.Vector3(p[0], p[1], p[2])));\n  const path = curve.getPoints(18).map(p => [p.x, p.y, p.z]);\n  const geometry = GEO.buildSweptProfile(path, GEO.profiles.circle(0.047, 9), { samples: 18, caps: true });\n  const bough = new THREE.Mesh(geometry, oxblood);\n  bough.name = `Tree.Bough.${String(i + 1).padStart(2, '0')}`;\n  branchAssembly.add(bough);\n}\ngroup.add(branchAssembly);\n\nreturn group;","thumbUrl":"https://futurelabs.now/apps/images/u2/gen-agent-10-mvncvhny-miyf5-s1.png"},{"id":"gen-agent-10-mvncvhny-miyf5-s2","index":2,"summary":"Slice 2 of 5","final":false,"code":"const group = new THREE.Group();\ngroup.name = 'Tree of Life';\n\nSCENE.setLighting({\n  hemi: { sky: '#d9e5ff', ground: '#301d25', intensity: 0.65 },\n  sun: { color: '#ffd1b3', intensity: 2.1, position: [4, 7, 5] },\n  ambient: { color: '#b7c9ff', intensity: 0.35 },\n  shadows: true\n});\n\nconst gunmetal = new THREE.MeshStandardMaterial({ color: 0x34363d, roughness: 0.32, metalness: 1.0 });\nconst oxblood = new THREE.MeshStandardMaterial({ color: 0x571a2b, roughness: 0.68, metalness: 0.0 });\nconst shellMaterial = new THREE.MeshStandardMaterial({\n  color: 0x8157f4,\n  roughness: 0.28,\n  metalness: 0.0,\n  transmission: 0.55,\n  transparent: true,\n  opacity: 0.72,\n  side: THREE.DoubleSide\n});\n\nconst baseAssembly = new THREE.Group();\nbaseAssembly.name = 'Tree.Base';\nconst baseMesh = new THREE.Mesh(GEO.buildFilletedSolid(1.35, 0.1, 0.72, 0.06), gunmetal);\nbaseMesh.name = 'Tree.Base.Plate';\nbaseMesh.position.set(0, 0.05, 0);\nbaseAssembly.add(baseMesh);\ngroup.add(baseAssembly);\n\nconst shellAssembly = new THREE.Group();\nshellAssembly.name = 'Tree.OpenShell';\nconst shellGeometry = GEO.buildSurfacePatch((u, v) => {\n  const t = Math.max(0, Math.min(1, u));\n  const across = v * 2 - 1;\n  const width = 0.62 * Math.pow(Math.sin(Math.PI * t), 0.82);\n  const y = 0.15 + 1.7 * t;\n  const z = -0.23 - 0.16 * (1 - across * across);\n  return [across * width, y, z];\n}, { uSegments: 32, vSegments: 24 });\nconst shellMesh = new THREE.Mesh(shellGeometry, shellMaterial);\nshellMesh.name = 'Tree.OpenShell.LeafBody';\nshellAssembly.add(shellMesh);\ngroup.add(shellAssembly);\n\nconst branchAssembly = new THREE.Group();\nbranchAssembly.name = 'Tree.TrunkAndBoughs';\nconst trunkCurve = new THREE.CatmullRomCurve3([\n  new THREE.Vector3(0, 0.1, 0.03),\n  new THREE.Vector3(-0.025, 0.48, 0.03),\n  new THREE.Vector3(0.025, 0.88, 0.04),\n  new THREE.Vector3(0, 1.29, 0.04),\n  new THREE.Vector3(0.035, 1.65, 0.04)\n]);\nconst trunkPath = trunkCurve.getPoints(24).map(p => [p.x, p.y, p.z]);\nconst trunkGeometry = GEO.buildSweptProfile(\n  trunkPath,\n  GEO.profiles.circle(0.082, 10),\n  { samples: 24, caps: true }\n);\nconst trunkMesh = new THREE.Mesh(trunkGeometry, oxblood);\ntrunkMesh.name = 'Tree.Trunk';\nbranchAssembly.add(trunkMesh);\n\nconst boughPaths = [\n  [[0, 0.66, 0.04], [-0.2, 0.83, 0.04], [-0.39, 1.05, 0.04], [-0.48, 1.37, 0.04]],\n  [[0.01, 0.82, 0.04], [0.2, 0.98, 0.04], [0.38, 1.2, 0.04], [0.44, 1.51, 0.04]],\n  [[0, 1.08, 0.04], [-0.16, 1.25, 0.04], [-0.22, 1.48, 0.04], [-0.18, 1.7, 0.04]],\n  [[0.01, 1.17, 0.04], [0.17, 1.34, 0.04], [0.25, 1.56, 0.04], [0.2, 1.74, 0.04]]\n];\nfor (let i = 0; i < boughPaths.length; i++) {\n  const curve = new THREE.CatmullRomCurve3(boughPaths[i].map(p => new THREE.Vector3(p[0], p[1], p[2])));\n  const path = curve.getPoints(18).map(p => [p.x, p.y, p.z]);\n  const geometry = GEO.buildSweptProfile(path, GEO.profiles.circle(0.047, 9), { samples: 18, caps: true });\n  const bough = new THREE.Mesh(geometry, oxblood);\n  bough.name = `Tree.Bough.${String(i + 1).padStart(2, '0')}`;\n  branchAssembly.add(bough);\n}\ngroup.add(branchAssembly);\n\nreturn group;\n\n\n// --- slice ---\n{\n  const treeDetailAssembly = new THREE.Group();\n  treeDetailAssembly.name = 'Tree.RootsAndLeafVeins';\n  const treeRootMaterial = new THREE.MeshStandardMaterial({ color: 0x633044, roughness: 0.72, metalness: 0.05 });\n  const treeVeinMaterial = new THREE.MeshStandardMaterial({ color: 0xb18be9, roughness: 0.48, metalness: 0.12 });\n  const treeVeinSurfacePoint = (t, across) => {\n   const width = 0.62 * Math.pow(Math.sin(Math.PI * t), 0.82);\n   return [across * width, 0.15 + 1.7 * t, -0.23 - 0.16 * (1 - across * across) + 0.014];\n  };\n  const treeMidribPoints = [];\n  for (let i = 0; i <= 20; i++) {\n   const t = 0.12 + (0.84 * i) / 20;\n   treeMidribPoints.push(treeVeinSurfacePoint(t, 0));\n  }\n  const treeMidribCurve = new THREE.CatmullRomCurve3(treeMidribPoints.map((p) => new THREE.Vector3(p[0], p[1], p[2])));\n  const treeMidrib = new THREE.Mesh(GEO.buildSweptProfile(treeMidribCurve.getPoints(36).map((p) => [p.x, p.y, p.z]), GEO.profiles.circle(0.009, 7), { samples: 36, caps: true }), treeVeinMaterial);\n  treeMidrib.name = 'Tree.Leaf.Midrib';\n  treeDetailAssembly.add(treeMidrib);\n  for (let side = -1; side <= 1; side += 2) {\n   for (let i = 0; i < 6; i++) {\n    const t0 = 0.24 + i * 0.105;\n    const veinPoints = [\n     treeVeinSurfacePoint(t0, 0),\n     treeVeinSurfacePoint(t0 + 0.035, side * 0.32),\n     treeVeinSurfacePoint(t0 + 0.075, side * 0.59),\n     treeVeinSurfacePoint(t0 + 0.105, side * 0.77)\n    ];\n    const veinCurve = new THREE.CatmullRomCurve3(veinPoints.map((p) => new THREE.Vector3(p[0], p[1], p[2])));\n    const veinMesh = new THREE.Mesh(GEO.buildSweptProfile(veinCurve.getPoints(14).map((p) => [p.x, p.y, p.z]), GEO.profiles.circle(0.0055, 6), { samples: 14, caps: true }), treeVeinMaterial);\n    veinMesh.name = `Tree.Leaf.SideVein.${side < 0 ? 'L' : 'R'}.${String(i + 1).padStart(2, '0')}`;\n    treeDetailAssembly.add(veinMesh);\n   }\n  }\n  for (let side = -1; side <= 1; side += 2) {\n   const rootCurve = new THREE.CatmullRomCurve3([\n    new THREE.Vector3(side * 0.035, 0.2, 0.04),\n    new THREE.Vector3(side * 0.085, 0.16, 0.06),\n    new THREE.Vector3(side * 0.19, 0.12, 0.1),\n    new THREE.Vector3(side * 0.3, 0.105, 0.13)\n   ]);\n   const rootPath = rootCurve.getPoints(18).map((p) => [p.x, p.y, p.z]);\n   const rootGeometry = GEO.buildSweptProfile(rootPath, GEO.profiles.circle(0.035, 9), { samples: 18, caps: true, scale: (u) => 1 - 0.72 * u });\n   const rootMesh = new THREE.Mesh(rootGeometry, treeRootMaterial);\n   rootMesh.name = `Tree.Root.${side < 0 ? 'L' : 'R'}`;\n   treeDetailAssembly.add(rootMesh);\n  }\n  group.add(treeDetailAssembly);\n  const treeSignatureMaterial = new THREE.MeshStandardMaterial({ color: 0xff00d0, roughness: 0.34, metalness: 0.25, emissive: 0x30001f });\n  const treeSignature = new THREE.Mesh(new THREE.CylinderGeometry(0.018, 0.018, 0.012, 20), treeSignatureMaterial);\n  treeSignature.name = 'Tree.Base.SignatureInlay';\n  treeSignature.rotation.x = Math.PI / 2;\n  treeSignature.position.set(0, 0.05, 0.364);\n  group.add(treeSignature);\n}","thumbUrl":"https://futurelabs.now/apps/images/u2/gen-agent-10-mvncvhny-miyf5-s2.png"},{"id":"gen-agent-10-mvncvhny-miyf5-s3","index":3,"summary":"Slice 3 of 5","final":false,"code":"const group = new THREE.Group();\ngroup.name = 'Tree of Life';\n\nSCENE.setLighting({\n  hemi: { sky: '#d9e5ff', ground: '#301d25', intensity: 0.65 },\n  sun: { color: '#ffd1b3', intensity: 2.1, position: [4, 7, 5] },\n  ambient: { color: '#b7c9ff', intensity: 0.35 },\n  shadows: true\n});\n\nconst gunmetal = new THREE.MeshStandardMaterial({ color: 0x34363d, roughness: 0.32, metalness: 1.0 });\nconst oxblood = new THREE.MeshStandardMaterial({ color: 0x571a2b, roughness: 0.68, metalness: 0.0 });\nconst shellMaterial = new THREE.MeshStandardMaterial({\n  color: 0x8157f4,\n  roughness: 0.28,\n  metalness: 0.0,\n  transmission: 0.55,\n  transparent: true,\n  opacity: 0.72,\n  side: THREE.DoubleSide\n});\n\nconst baseAssembly = new THREE.Group();\nbaseAssembly.name = 'Tree.Base';\nconst baseMesh = new THREE.Mesh(GEO.buildFilletedSolid(1.35, 0.1, 0.72, 0.06), gunmetal);\nbaseMesh.name = 'Tree.Base.Plate';\nbaseMesh.position.set(0, 0.05, 0);\nbaseAssembly.add(baseMesh);\ngroup.add(baseAssembly);\n\nconst shellAssembly = new THREE.Group();\nshellAssembly.name = 'Tree.OpenShell';\nconst shellGeometry = GEO.buildSurfacePatch((u, v) => {\n  const t = Math.max(0, Math.min(1, u));\n  const across = v * 2 - 1;\n  const width = 0.62 * Math.pow(Math.sin(Math.PI * t), 0.82);\n  const y = 0.15 + 1.7 * t;\n  const z = -0.23 - 0.16 * (1 - across * across);\n  return [across * width, y, z];\n}, { uSegments: 32, vSegments: 24 });\nconst shellMesh = new THREE.Mesh(shellGeometry, shellMaterial);\nshellMesh.name = 'Tree.OpenShell.LeafBody';\nshellAssembly.add(shellMesh);\ngroup.add(shellAssembly);\n\nconst branchAssembly = new THREE.Group();\nbranchAssembly.name = 'Tree.TrunkAndBoughs';\nconst trunkCurve = new THREE.CatmullRomCurve3([\n  new THREE.Vector3(0, 0.1, 0.03),\n  new THREE.Vector3(-0.025, 0.48, 0.03),\n  new THREE.Vector3(0.025, 0.88, 0.04),\n  new THREE.Vector3(0, 1.29, 0.04),\n  new THREE.Vector3(0.035, 1.65, 0.04)\n]);\nconst trunkPath = trunkCurve.getPoints(24).map(p => [p.x, p.y, p.z]);\nconst trunkGeometry = GEO.buildSweptProfile(\n  trunkPath,\n  GEO.profiles.circle(0.082, 10),\n  { samples: 24, caps: true }\n);\nconst trunkMesh = new THREE.Mesh(trunkGeometry, oxblood);\ntrunkMesh.name = 'Tree.Trunk';\nbranchAssembly.add(trunkMesh);\n\nconst boughPaths = [\n  [[0, 0.66, 0.04], [-0.2, 0.83, 0.04], [-0.39, 1.05, 0.04], [-0.48, 1.37, 0.04]],\n  [[0.01, 0.82, 0.04], [0.2, 0.98, 0.04], [0.38, 1.2, 0.04], [0.44, 1.51, 0.04]],\n  [[0, 1.08, 0.04], [-0.16, 1.25, 0.04], [-0.22, 1.48, 0.04], [-0.18, 1.7, 0.04]],\n  [[0.01, 1.17, 0.04], [0.17, 1.34, 0.04], [0.25, 1.56, 0.04], [0.2, 1.74, 0.04]]\n];\nfor (let i = 0; i < boughPaths.length; i++) {\n  const curve = new THREE.CatmullRomCurve3(boughPaths[i].map(p => new THREE.Vector3(p[0], p[1], p[2])));\n  const path = curve.getPoints(18).map(p => [p.x, p.y, p.z]);\n  const geometry = GEO.buildSweptProfile(path, GEO.profiles.circle(0.047, 9), { samples: 18, caps: true });\n  const bough = new THREE.Mesh(geometry, oxblood);\n  bough.name = `Tree.Bough.${String(i + 1).padStart(2, '0')}`;\n  branchAssembly.add(bough);\n}\ngroup.add(branchAssembly);\n\nreturn group;\n\n\n// --- slice ---\n{\n  const treeDetailAssembly = new THREE.Group();\n  treeDetailAssembly.name = 'Tree.RootsAndLeafVeins';\n  const treeRootMaterial = new THREE.MeshStandardMaterial({ color: 0x633044, roughness: 0.72, metalness: 0.05 });\n  const treeVeinMaterial = new THREE.MeshStandardMaterial({ color: 0xb18be9, roughness: 0.48, metalness: 0.12 });\n  const treeVeinSurfacePoint = (t, across) => {\n   const width = 0.62 * Math.pow(Math.sin(Math.PI * t), 0.82);\n   return [across * width, 0.15 + 1.7 * t, -0.23 - 0.16 * (1 - across * across) + 0.014];\n  };\n  const treeMidribPoints = [];\n  for (let i = 0; i <= 20; i++) {\n   const t = 0.12 + (0.84 * i) / 20;\n   treeMidribPoints.push(treeVeinSurfacePoint(t, 0));\n  }\n  const treeMidribCurve = new THREE.CatmullRomCurve3(treeMidribPoints.map((p) => new THREE.Vector3(p[0], p[1], p[2])));\n  const treeMidrib = new THREE.Mesh(GEO.buildSweptProfile(treeMidribCurve.getPoints(36).map((p) => [p.x, p.y, p.z]), GEO.profiles.circle(0.009, 7), { samples: 36, caps: true }), treeVeinMaterial);\n  treeMidrib.name = 'Tree.Leaf.Midrib';\n  treeDetailAssembly.add(treeMidrib);\n  for (let side = -1; side <= 1; side += 2) {\n   for (let i = 0; i < 6; i++) {\n    const t0 = 0.24 + i * 0.105;\n    const veinPoints = [\n     treeVeinSurfacePoint(t0, 0),\n     treeVeinSurfacePoint(t0 + 0.035, side * 0.32),\n     treeVeinSurfacePoint(t0 + 0.075, side * 0.59),\n     treeVeinSurfacePoint(t0 + 0.105, side * 0.77)\n    ];\n    const veinCurve = new THREE.CatmullRomCurve3(veinPoints.map((p) => new THREE.Vector3(p[0], p[1], p[2])));\n    const veinMesh = new THREE.Mesh(GEO.buildSweptProfile(veinCurve.getPoints(14).map((p) => [p.x, p.y, p.z]), GEO.profiles.circle(0.0055, 6), { samples: 14, caps: true }), treeVeinMaterial);\n    veinMesh.name = `Tree.Leaf.SideVein.${side < 0 ? 'L' : 'R'}.${String(i + 1).padStart(2, '0')}`;\n    treeDetailAssembly.add(veinMesh);\n   }\n  }\n  for (let side = -1; side <= 1; side += 2) {\n   const rootCurve = new THREE.CatmullRomCurve3([\n    new THREE.Vector3(side * 0.035, 0.2, 0.04),\n    new THREE.Vector3(side * 0.085, 0.16, 0.06),\n    new THREE.Vector3(side * 0.19, 0.12, 0.1),\n    new THREE.Vector3(side * 0.3, 0.105, 0.13)\n   ]);\n   const rootPath = rootCurve.getPoints(18).map((p) => [p.x, p.y, p.z]);\n   const rootGeometry = GEO.buildSweptProfile(rootPath, GEO.profiles.circle(0.035, 9), { samples: 18, caps: true, scale: (u) => 1 - 0.72 * u });\n   const rootMesh = new THREE.Mesh(rootGeometry, treeRootMaterial);\n   rootMesh.name = `Tree.Root.${side < 0 ? 'L' : 'R'}`;\n   treeDetailAssembly.add(rootMesh);\n  }\n  group.add(treeDetailAssembly);\n  const treeSignatureMaterial = new THREE.MeshStandardMaterial({ color: 0xff00d0, roughness: 0.34, metalness: 0.25, emissive: 0x30001f });\n  const treeSignature = new THREE.Mesh(new THREE.CylinderGeometry(0.018, 0.018, 0.012, 20), treeSignatureMaterial);\n  treeSignature.name = 'Tree.Base.SignatureInlay';\n  treeSignature.rotation.x = Math.PI / 2;\n  treeSignature.position.set(0, 0.05, 0.364);\n  group.add(treeSignature);\n}\n\n\n// --- slice ---\n{\n  {\n   const shellFix = group.getObjectByName('Tree.OpenShell.LeafBody');\n   if (shellFix) {\n    shellFix.position.z += 0.24;\n   }\n   const shootMaterial = oxblood;\n   const shootPaths = [\n    [[-0.39, 1.05, 0.04], [-0.48, 1.12, 0.04], [-0.55, 1.23, 0.04]],\n    [[0.38, 1.20, 0.04], [0.47, 1.29, 0.04], [0.51, 1.40, 0.04]],\n    [[-0.22, 1.48, 0.04], [-0.29, 1.57, 0.04], [-0.31, 1.68, 0.04]],\n    [[0.25, 1.56, 0.04], [0.31, 1.64, 0.04], [0.33, 1.74, 0.04]]\n   ];\n   const shootAssembly = new THREE.Group();\n   shootAssembly.name = 'Tree.TerminalShoots';\n   for (let i = 0; i < shootPaths.length; i++) {\n    const shootCurve = new THREE.CatmullRomCurve3(shootPaths[i].map((p) => new THREE.Vector3(p[0], p[1], p[2])));\n    const shootPath = shootCurve.getPoints(12).map((p) => [p.x, p.y, p.z]);\n    const shootMesh = new THREE.Mesh(GEO.buildSweptProfile(shootPath, GEO.profiles.circle(0.022, 8), { samples: 12, caps: true, scale: (u) => 1 - 0.55 * u }), shootMaterial);\n    shootMesh.name = `Tree.TerminalShoot.${String(i + 1).padStart(2, '0')}`;\n    shootAssembly.add(shootMesh);\n   }\n   const seedMaterial = new THREE.MeshStandardMaterial({ color: 0xe3b35d, roughness: 0.4, metalness: 0.22 });\n   const seedPoints = [\n    [-0.47, 1.31, 0.075],\n    [0.43, 1.45, 0.075],\n    [-0.28, 1.63, 0.075],\n    [0.30, 1.69, 0.075]\n   ];\n   for (let i = 0; i < seedPoints.length; i++) {\n    const p = seedPoints[i];\n    const pod = new THREE.Mesh(GEO.buildLathe([[0, -0.032], [0.018, -0.022], [0.026, 0], [0.019, 0.024], [0, 0.034]]), seedMaterial);\n    pod.name = `Tree.SeedPod.${String(i + 1).padStart(2, '0')}`;\n    pod.position.set(p[0], p[1], p[2]);\n    shootAssembly.add(pod);\n    const stemCurve = new THREE.CatmullRomCurve3([\n     new THREE.Vector3(p[0], p[1] + 0.027, p[2] - 0.015),\n     new THREE.Vector3(p[0], p[1] + 0.052, p[2] - 0.025),\n     new THREE.Vector3(p[0], p[1] + 0.072, 0.04)\n    ]);\n    const stemPath = stemCurve.getPoints(8).map((v) => [v.x, v.y, v.z]);\n    const stem = new THREE.Mesh(GEO.buildSweptProfile(stemPath, GEO.profiles.circle(0.006, 6), { samples: 8, caps: true }), shootMaterial);\n    stem.name = `Tree.SeedPod.Stem.${String(i + 1).padStart(2, '0')}`;\n    shootAssembly.add(stem);\n   }\n   group.add(shootAssembly);\n  }\n}","thumbUrl":"https://futurelabs.now/apps/images/u2/gen-agent-10-mvncvhny-miyf5-s3.png"},{"id":"gen-agent-10-mvncvhny-miyf5-s4","index":4,"summary":"Slice 4 of 5","final":false,"code":"const group = new THREE.Group();\ngroup.name = 'Tree of Life';\n\nSCENE.setLighting({\n  hemi: { sky: '#d9e5ff', ground: '#301d25', intensity: 0.65 },\n  sun: { color: '#ffd1b3', intensity: 2.1, position: [4, 7, 5] },\n  ambient: { color: '#b7c9ff', intensity: 0.35 },\n  shadows: true\n});\n\nconst gunmetal = new THREE.MeshStandardMaterial({ color: 0x34363d, roughness: 0.32, metalness: 1.0 });\nconst oxblood = new THREE.MeshStandardMaterial({ color: 0x571a2b, roughness: 0.68, metalness: 0.0 });\nconst shellMaterial = new THREE.MeshStandardMaterial({\n  color: 0x8157f4,\n  roughness: 0.28,\n  metalness: 0.0,\n  transmission: 0.55,\n  transparent: true,\n  opacity: 0.72,\n  side: THREE.DoubleSide\n});\n\nconst baseAssembly = new THREE.Group();\nbaseAssembly.name = 'Tree.Base';\nconst baseMesh = new THREE.Mesh(GEO.buildFilletedSolid(1.35, 0.1, 0.72, 0.06), gunmetal);\nbaseMesh.name = 'Tree.Base.Plate';\nbaseMesh.position.set(0, 0.05, 0);\nbaseAssembly.add(baseMesh);\ngroup.add(baseAssembly);\n\nconst shellAssembly = new THREE.Group();\nshellAssembly.name = 'Tree.OpenShell';\nconst shellGeometry = GEO.buildSurfacePatch((u, v) => {\n  const t = Math.max(0, Math.min(1, u));\n  const across = v * 2 - 1;\n  const width = 0.62 * Math.pow(Math.sin(Math.PI * t), 0.82);\n  const y = 0.15 + 1.7 * t;\n  const z = -0.23 - 0.16 * (1 - across * across);\n  return [across * width, y, z];\n}, { uSegments: 32, vSegments: 24 });\nconst shellMesh = new THREE.Mesh(shellGeometry, shellMaterial);\nshellMesh.name = 'Tree.OpenShell.LeafBody';\nshellAssembly.add(shellMesh);\ngroup.add(shellAssembly);\n\nconst branchAssembly = new THREE.Group();\nbranchAssembly.name = 'Tree.TrunkAndBoughs';\nconst trunkCurve = new THREE.CatmullRomCurve3([\n  new THREE.Vector3(0, 0.1, 0.03),\n  new THREE.Vector3(-0.025, 0.48, 0.03),\n  new THREE.Vector3(0.025, 0.88, 0.04),\n  new THREE.Vector3(0, 1.29, 0.04),\n  new THREE.Vector3(0.035, 1.65, 0.04)\n]);\nconst trunkPath = trunkCurve.getPoints(24).map(p => [p.x, p.y, p.z]);\nconst trunkGeometry = GEO.buildSweptProfile(\n  trunkPath,\n  GEO.profiles.circle(0.082, 10),\n  { samples: 24, caps: true }\n);\nconst trunkMesh = new THREE.Mesh(trunkGeometry, oxblood);\ntrunkMesh.name = 'Tree.Trunk';\nbranchAssembly.add(trunkMesh);\n\nconst boughPaths = [\n  [[0, 0.66, 0.04], [-0.2, 0.83, 0.04], [-0.39, 1.05, 0.04], [-0.48, 1.37, 0.04]],\n  [[0.01, 0.82, 0.04], [0.2, 0.98, 0.04], [0.38, 1.2, 0.04], [0.44, 1.51, 0.04]],\n  [[0, 1.08, 0.04], [-0.16, 1.25, 0.04], [-0.22, 1.48, 0.04], [-0.18, 1.7, 0.04]],\n  [[0.01, 1.17, 0.04], [0.17, 1.34, 0.04], [0.25, 1.56, 0.04], [0.2, 1.74, 0.04]]\n];\nfor (let i = 0; i < boughPaths.length; i++) {\n  const curve = new THREE.CatmullRomCurve3(boughPaths[i].map(p => new THREE.Vector3(p[0], p[1], p[2])));\n  const path = curve.getPoints(18).map(p => [p.x, p.y, p.z]);\n  const geometry = GEO.buildSweptProfile(path, GEO.profiles.circle(0.047, 9), { samples: 18, caps: true });\n  const bough = new THREE.Mesh(geometry, oxblood);\n  bough.name = `Tree.Bough.${String(i + 1).padStart(2, '0')}`;\n  branchAssembly.add(bough);\n}\ngroup.add(branchAssembly);\n\nreturn group;\n\n\n// --- slice ---\n{\n  const treeDetailAssembly = new THREE.Group();\n  treeDetailAssembly.name = 'Tree.RootsAndLeafVeins';\n  const treeRootMaterial = new THREE.MeshStandardMaterial({ color: 0x633044, roughness: 0.72, metalness: 0.05 });\n  const treeVeinMaterial = new THREE.MeshStandardMaterial({ color: 0xb18be9, roughness: 0.48, metalness: 0.12 });\n  const treeVeinSurfacePoint = (t, across) => {\n   const width = 0.62 * Math.pow(Math.sin(Math.PI * t), 0.82);\n   return [across * width, 0.15 + 1.7 * t, -0.23 - 0.16 * (1 - across * across) + 0.014];\n  };\n  const treeMidribPoints = [];\n  for (let i = 0; i <= 20; i++) {\n   const t = 0.12 + (0.84 * i) / 20;\n   treeMidribPoints.push(treeVeinSurfacePoint(t, 0));\n  }\n  const treeMidribCurve = new THREE.CatmullRomCurve3(treeMidribPoints.map((p) => new THREE.Vector3(p[0], p[1], p[2])));\n  const treeMidrib = new THREE.Mesh(GEO.buildSweptProfile(treeMidribCurve.getPoints(36).map((p) => [p.x, p.y, p.z]), GEO.profiles.circle(0.009, 7), { samples: 36, caps: true }), treeVeinMaterial);\n  treeMidrib.name = 'Tree.Leaf.Midrib';\n  treeDetailAssembly.add(treeMidrib);\n  for (let side = -1; side <= 1; side += 2) {\n   for (let i = 0; i < 6; i++) {\n    const t0 = 0.24 + i * 0.105;\n    const veinPoints = [\n     treeVeinSurfacePoint(t0, 0),\n     treeVeinSurfacePoint(t0 + 0.035, side * 0.32),\n     treeVeinSurfacePoint(t0 + 0.075, side * 0.59),\n     treeVeinSurfacePoint(t0 + 0.105, side * 0.77)\n    ];\n    const veinCurve = new THREE.CatmullRomCurve3(veinPoints.map((p) => new THREE.Vector3(p[0], p[1], p[2])));\n    const veinMesh = new THREE.Mesh(GEO.buildSweptProfile(veinCurve.getPoints(14).map((p) => [p.x, p.y, p.z]), GEO.profiles.circle(0.0055, 6), { samples: 14, caps: true }), treeVeinMaterial);\n    veinMesh.name = `Tree.Leaf.SideVein.${side < 0 ? 'L' : 'R'}.${String(i + 1).padStart(2, '0')}`;\n    treeDetailAssembly.add(veinMesh);\n   }\n  }\n  for (let side = -1; side <= 1; side += 2) {\n   const rootCurve = new THREE.CatmullRomCurve3([\n    new THREE.Vector3(side * 0.035, 0.2, 0.04),\n    new THREE.Vector3(side * 0.085, 0.16, 0.06),\n    new THREE.Vector3(side * 0.19, 0.12, 0.1),\n    new THREE.Vector3(side * 0.3, 0.105, 0.13)\n   ]);\n   const rootPath = rootCurve.getPoints(18).map((p) => [p.x, p.y, p.z]);\n   const rootGeometry = GEO.buildSweptProfile(rootPath, GEO.profiles.circle(0.035, 9), { samples: 18, caps: true, scale: (u) => 1 - 0.72 * u });\n   const rootMesh = new THREE.Mesh(rootGeometry, treeRootMaterial);\n   rootMesh.name = `Tree.Root.${side < 0 ? 'L' : 'R'}`;\n   treeDetailAssembly.add(rootMesh);\n  }\n  group.add(treeDetailAssembly);\n  const treeSignatureMaterial = new THREE.MeshStandardMaterial({ color: 0xff00d0, roughness: 0.34, metalness: 0.25, emissive: 0x30001f });\n  const treeSignature = new THREE.Mesh(new THREE.CylinderGeometry(0.018, 0.018, 0.012, 20), treeSignatureMaterial);\n  treeSignature.name = 'Tree.Base.SignatureInlay';\n  treeSignature.rotation.x = Math.PI / 2;\n  treeSignature.position.set(0, 0.05, 0.364);\n  group.add(treeSignature);\n}\n\n\n// --- slice ---\n{\n  {\n   const shellFix = group.getObjectByName('Tree.OpenShell.LeafBody');\n   if (shellFix) {\n    shellFix.position.z += 0.24;\n   }\n   const shootMaterial = oxblood;\n   const shootPaths = [\n    [[-0.39, 1.05, 0.04], [-0.48, 1.12, 0.04], [-0.55, 1.23, 0.04]],\n    [[0.38, 1.20, 0.04], [0.47, 1.29, 0.04], [0.51, 1.40, 0.04]],\n    [[-0.22, 1.48, 0.04], [-0.29, 1.57, 0.04], [-0.31, 1.68, 0.04]],\n    [[0.25, 1.56, 0.04], [0.31, 1.64, 0.04], [0.33, 1.74, 0.04]]\n   ];\n   const shootAssembly = new THREE.Group();\n   shootAssembly.name = 'Tree.TerminalShoots';\n   for (let i = 0; i < shootPaths.length; i++) {\n    const shootCurve = new THREE.CatmullRomCurve3(shootPaths[i].map((p) => new THREE.Vector3(p[0], p[1], p[2])));\n    const shootPath = shootCurve.getPoints(12).map((p) => [p.x, p.y, p.z]);\n    const shootMesh = new THREE.Mesh(GEO.buildSweptProfile(shootPath, GEO.profiles.circle(0.022, 8), { samples: 12, caps: true, scale: (u) => 1 - 0.55 * u }), shootMaterial);\n    shootMesh.name = `Tree.TerminalShoot.${String(i + 1).padStart(2, '0')}`;\n    shootAssembly.add(shootMesh);\n   }\n   const seedMaterial = new THREE.MeshStandardMaterial({ color: 0xe3b35d, roughness: 0.4, metalness: 0.22 });\n   const seedPoints = [\n    [-0.47, 1.31, 0.075],\n    [0.43, 1.45, 0.075],\n    [-0.28, 1.63, 0.075],\n    [0.30, 1.69, 0.075]\n   ];\n   for (let i = 0; i < seedPoints.length; i++) {\n    const p = seedPoints[i];\n    const pod = new THREE.Mesh(GEO.buildLathe([[0, -0.032], [0.018, -0.022], [0.026, 0], [0.019, 0.024], [0, 0.034]]), seedMaterial);\n    pod.name = `Tree.SeedPod.${String(i + 1).padStart(2, '0')}`;\n    pod.position.set(p[0], p[1], p[2]);\n    shootAssembly.add(pod);\n    const stemCurve = new THREE.CatmullRomCurve3([\n     new THREE.Vector3(p[0], p[1] + 0.027, p[2] - 0.015),\n     new THREE.Vector3(p[0], p[1] + 0.052, p[2] - 0.025),\n     new THREE.Vector3(p[0], p[1] + 0.072, 0.04)\n    ]);\n    const stemPath = stemCurve.getPoints(8).map((v) => [v.x, v.y, v.z]);\n    const stem = new THREE.Mesh(GEO.buildSweptProfile(stemPath, GEO.profiles.circle(0.006, 6), { samples: 8, caps: true }), shootMaterial);\n    stem.name = `Tree.SeedPod.Stem.${String(i + 1).padStart(2, '0')}`;\n    shootAssembly.add(stem);\n   }\n   group.add(shootAssembly);\n  }\n}\n\n\n// --- slice ---\n{\n  {\n   const growthRingAssembly = new THREE.Group();\n   growthRingAssembly.name = 'Tree.GrowthRings';\n   const growthRingMaterial = new THREE.MeshStandardMaterial({ color: 0xb18a50, roughness: 0.42, metalness: 0.68 });\n   const growthRingRadii = [[0.13, 0.07], [0.23, 0.125], [0.33, 0.18]];\n   for (let i = 0; i < growthRingRadii.length; i++) {\n    const rx = growthRingRadii[i][0];\n    const rz = growthRingRadii[i][1];\n    const ringPath = [];\n    for (let j = 0; j < 72; j++) {\n     const angle = (j / 72) * Math.PI * 2;\n     ringPath.push([rx * Math.cos(angle), 0.107, rz * Math.sin(angle)]);\n    }\n    const ringMesh = new THREE.Mesh(GEO.buildSweptProfile(ringPath, GEO.profiles.circle(0.0045, 6), { samples: 72, closedPath: true, caps: false }), growthRingMaterial);\n    ringMesh.name = `Tree.GrowthRings.Ring.${String(i + 1).padStart(2, '0')}`;\n    growthRingAssembly.add(ringMesh);\n   }\n   group.add(growthRingAssembly);\n  }\n}","thumbUrl":"https://futurelabs.now/apps/images/u2/gen-agent-10-mvncvhny-miyf5-s4.png"},{"id":"gen-agent-10-mvncvhny-miyf5-s5","index":5,"summary":"Final pass","final":true,"code":"const group = new THREE.Group();\ngroup.name = 'Tree of Life';\n\nSCENE.setLighting({\n  hemi: { sky: '#d9e5ff', ground: '#301d25', intensity: 0.65 },\n  sun: { color: '#ffd1b3', intensity: 2.1, position: [4, 7, 5] },\n  ambient: { color: '#b7c9ff', intensity: 0.35 },\n  shadows: true\n});\n\nconst gunmetal = new THREE.MeshStandardMaterial({ color: 0x34363d, roughness: 0.32, metalness: 1.0 });\nconst oxblood = new THREE.MeshStandardMaterial({ color: 0x571a2b, roughness: 0.68, metalness: 0.0 });\nconst shellMaterial = new THREE.MeshStandardMaterial({\n  color: 0x8157f4,\n  roughness: 0.28,\n  metalness: 0.0,\n  transmission: 0.55,\n  transparent: true,\n  opacity: 0.72,\n  side: THREE.DoubleSide\n});\n\nconst baseAssembly = new THREE.Group();\nbaseAssembly.name = 'Tree.Base';\nconst baseMesh = new THREE.Mesh(GEO.buildFilletedSolid(1.35, 0.1, 0.72, 0.06), gunmetal);\nbaseMesh.name = 'Tree.Base.Plate';\nbaseMesh.position.set(0, 0.05, 0);\nbaseAssembly.add(baseMesh);\ngroup.add(baseAssembly);\n\nconst shellAssembly = new THREE.Group();\nshellAssembly.name = 'Tree.OpenShell';\nconst shellGeometry = GEO.buildSurfacePatch((u, v) => {\n  const t = Math.max(0, Math.min(1, u));\n  const across = v * 2 - 1;\n  const width = 0.62 * Math.pow(Math.sin(Math.PI * t), 0.82);\n  const y = 0.15 + 1.7 * t;\n  const z = -0.23 - 0.16 * (1 - across * across);\n  return [across * width, y, z];\n}, { uSegments: 32, vSegments: 24 });\nconst shellMesh = new THREE.Mesh(shellGeometry, shellMaterial);\nshellMesh.name = 'Tree.OpenShell.LeafBody';\nshellAssembly.add(shellMesh);\ngroup.add(shellAssembly);\n\nconst branchAssembly = new THREE.Group();\nbranchAssembly.name = 'Tree.TrunkAndBoughs';\nconst trunkCurve = new THREE.CatmullRomCurve3([\n  new THREE.Vector3(0, 0.1, 0.03),\n  new THREE.Vector3(-0.025, 0.48, 0.03),\n  new THREE.Vector3(0.025, 0.88, 0.04),\n  new THREE.Vector3(0, 1.29, 0.04),\n  new THREE.Vector3(0.035, 1.65, 0.04)\n]);\nconst trunkPath = trunkCurve.getPoints(24).map(p => [p.x, p.y, p.z]);\nconst trunkGeometry = GEO.buildSweptProfile(\n  trunkPath,\n  GEO.profiles.circle(0.082, 10),\n  { samples: 24, caps: true }\n);\nconst trunkMesh = new THREE.Mesh(trunkGeometry, oxblood);\ntrunkMesh.name = 'Tree.Trunk';\nbranchAssembly.add(trunkMesh);\n\nconst boughPaths = [\n  [[0, 0.66, 0.04], [-0.2, 0.83, 0.04], [-0.39, 1.05, 0.04], [-0.48, 1.37, 0.04]],\n  [[0.01, 0.82, 0.04], [0.2, 0.98, 0.04], [0.38, 1.2, 0.04], [0.44, 1.51, 0.04]],\n  [[0, 1.08, 0.04], [-0.16, 1.25, 0.04], [-0.22, 1.48, 0.04], [-0.18, 1.7, 0.04]],\n  [[0.01, 1.17, 0.04], [0.17, 1.34, 0.04], [0.25, 1.56, 0.04], [0.2, 1.74, 0.04]]\n];\nfor (let i = 0; i < boughPaths.length; i++) {\n  const curve = new THREE.CatmullRomCurve3(boughPaths[i].map(p => new THREE.Vector3(p[0], p[1], p[2])));\n  const path = curve.getPoints(18).map(p => [p.x, p.y, p.z]);\n  const geometry = GEO.buildSweptProfile(path, GEO.profiles.circle(0.047, 9), { samples: 18, caps: true });\n  const bough = new THREE.Mesh(geometry, oxblood);\n  bough.name = `Tree.Bough.${String(i + 1).padStart(2, '0')}`;\n  branchAssembly.add(bough);\n}\ngroup.add(branchAssembly);\n\nreturn group;\n\n\n// --- slice ---\n{\n  const treeDetailAssembly = new THREE.Group();\n  treeDetailAssembly.name = 'Tree.RootsAndLeafVeins';\n  const treeRootMaterial = new THREE.MeshStandardMaterial({ color: 0x633044, roughness: 0.72, metalness: 0.05 });\n  const treeVeinMaterial = new THREE.MeshStandardMaterial({ color: 0xb18be9, roughness: 0.48, metalness: 0.12 });\n  const treeVeinSurfacePoint = (t, across) => {\n   const width = 0.62 * Math.pow(Math.sin(Math.PI * t), 0.82);\n   return [across * width, 0.15 + 1.7 * t, -0.23 - 0.16 * (1 - across * across) + 0.014];\n  };\n  const treeMidribPoints = [];\n  for (let i = 0; i <= 20; i++) {\n   const t = 0.12 + (0.84 * i) / 20;\n   treeMidribPoints.push(treeVeinSurfacePoint(t, 0));\n  }\n  const treeMidribCurve = new THREE.CatmullRomCurve3(treeMidribPoints.map((p) => new THREE.Vector3(p[0], p[1], p[2])));\n  const treeMidrib = new THREE.Mesh(GEO.buildSweptProfile(treeMidribCurve.getPoints(36).map((p) => [p.x, p.y, p.z]), GEO.profiles.circle(0.009, 7), { samples: 36, caps: true }), treeVeinMaterial);\n  treeMidrib.name = 'Tree.Leaf.Midrib';\n  treeDetailAssembly.add(treeMidrib);\n  for (let side = -1; side <= 1; side += 2) {\n   for (let i = 0; i < 6; i++) {\n    const t0 = 0.24 + i * 0.105;\n    const veinPoints = [\n     treeVeinSurfacePoint(t0, 0),\n     treeVeinSurfacePoint(t0 + 0.035, side * 0.32),\n     treeVeinSurfacePoint(t0 + 0.075, side * 0.59),\n     treeVeinSurfacePoint(t0 + 0.105, side * 0.77)\n    ];\n    const veinCurve = new THREE.CatmullRomCurve3(veinPoints.map((p) => new THREE.Vector3(p[0], p[1], p[2])));\n    const veinMesh = new THREE.Mesh(GEO.buildSweptProfile(veinCurve.getPoints(14).map((p) => [p.x, p.y, p.z]), GEO.profiles.circle(0.0055, 6), { samples: 14, caps: true }), treeVeinMaterial);\n    veinMesh.name = `Tree.Leaf.SideVein.${side < 0 ? 'L' : 'R'}.${String(i + 1).padStart(2, '0')}`;\n    treeDetailAssembly.add(veinMesh);\n   }\n  }\n  for (let side = -1; side <= 1; side += 2) {\n   const rootCurve = new THREE.CatmullRomCurve3([\n    new THREE.Vector3(side * 0.035, 0.2, 0.04),\n    new THREE.Vector3(side * 0.085, 0.16, 0.06),\n    new THREE.Vector3(side * 0.19, 0.12, 0.1),\n    new THREE.Vector3(side * 0.3, 0.105, 0.13)\n   ]);\n   const rootPath = rootCurve.getPoints(18).map((p) => [p.x, p.y, p.z]);\n   const rootGeometry = GEO.buildSweptProfile(rootPath, GEO.profiles.circle(0.035, 9), { samples: 18, caps: true, scale: (u) => 1 - 0.72 * u });\n   const rootMesh = new THREE.Mesh(rootGeometry, treeRootMaterial);\n   rootMesh.name = `Tree.Root.${side < 0 ? 'L' : 'R'}`;\n   treeDetailAssembly.add(rootMesh);\n  }\n  group.add(treeDetailAssembly);\n  const treeSignatureMaterial = new THREE.MeshStandardMaterial({ color: 0xff00d0, roughness: 0.34, metalness: 0.25, emissive: 0x30001f });\n  const treeSignature = new THREE.Mesh(new THREE.CylinderGeometry(0.018, 0.018, 0.012, 20), treeSignatureMaterial);\n  treeSignature.name = 'Tree.Base.SignatureInlay';\n  treeSignature.rotation.x = Math.PI / 2;\n  treeSignature.position.set(0, 0.05, 0.364);\n  group.add(treeSignature);\n}\n\n\n// --- slice ---\n{\n  {\n   const shellFix = group.getObjectByName('Tree.OpenShell.LeafBody');\n   if (shellFix) {\n    shellFix.position.z += 0.24;\n   }\n   const shootMaterial = oxblood;\n   const shootPaths = [\n    [[-0.39, 1.05, 0.04], [-0.48, 1.12, 0.04], [-0.55, 1.23, 0.04]],\n    [[0.38, 1.20, 0.04], [0.47, 1.29, 0.04], [0.51, 1.40, 0.04]],\n    [[-0.22, 1.48, 0.04], [-0.29, 1.57, 0.04], [-0.31, 1.68, 0.04]],\n    [[0.25, 1.56, 0.04], [0.31, 1.64, 0.04], [0.33, 1.74, 0.04]]\n   ];\n   const shootAssembly = new THREE.Group();\n   shootAssembly.name = 'Tree.TerminalShoots';\n   for (let i = 0; i < shootPaths.length; i++) {\n    const shootCurve = new THREE.CatmullRomCurve3(shootPaths[i].map((p) => new THREE.Vector3(p[0], p[1], p[2])));\n    const shootPath = shootCurve.getPoints(12).map((p) => [p.x, p.y, p.z]);\n    const shootMesh = new THREE.Mesh(GEO.buildSweptProfile(shootPath, GEO.profiles.circle(0.022, 8), { samples: 12, caps: true, scale: (u) => 1 - 0.55 * u }), shootMaterial);\n    shootMesh.name = `Tree.TerminalShoot.${String(i + 1).padStart(2, '0')}`;\n    shootAssembly.add(shootMesh);\n   }\n   const seedMaterial = new THREE.MeshStandardMaterial({ color: 0xe3b35d, roughness: 0.4, metalness: 0.22 });\n   const seedPoints = [\n    [-0.47, 1.31, 0.075],\n    [0.43, 1.45, 0.075],\n    [-0.28, 1.63, 0.075],\n    [0.30, 1.69, 0.075]\n   ];\n   for (let i = 0; i < seedPoints.length; i++) {\n    const p = seedPoints[i];\n    const pod = new THREE.Mesh(GEO.buildLathe([[0, -0.032], [0.018, -0.022], [0.026, 0], [0.019, 0.024], [0, 0.034]]), seedMaterial);\n    pod.name = `Tree.SeedPod.${String(i + 1).padStart(2, '0')}`;\n    pod.position.set(p[0], p[1], p[2]);\n    shootAssembly.add(pod);\n    const stemCurve = new THREE.CatmullRomCurve3([\n     new THREE.Vector3(p[0], p[1] + 0.027, p[2] - 0.015),\n     new THREE.Vector3(p[0], p[1] + 0.052, p[2] - 0.025),\n     new THREE.Vector3(p[0], p[1] + 0.072, 0.04)\n    ]);\n    const stemPath = stemCurve.getPoints(8).map((v) => [v.x, v.y, v.z]);\n    const stem = new THREE.Mesh(GEO.buildSweptProfile(stemPath, GEO.profiles.circle(0.006, 6), { samples: 8, caps: true }), shootMaterial);\n    stem.name = `Tree.SeedPod.Stem.${String(i + 1).padStart(2, '0')}`;\n    shootAssembly.add(stem);\n   }\n   group.add(shootAssembly);\n  }\n}\n\n\n// --- slice ---\n{\n  {\n   const growthRingAssembly = new THREE.Group();\n   growthRingAssembly.name = 'Tree.GrowthRings';\n   const growthRingMaterial = new THREE.MeshStandardMaterial({ color: 0xb18a50, roughness: 0.42, metalness: 0.68 });\n   const growthRingRadii = [[0.13, 0.07], [0.23, 0.125], [0.33, 0.18]];\n   for (let i = 0; i < growthRingRadii.length; i++) {\n    const rx = growthRingRadii[i][0];\n    const rz = growthRingRadii[i][1];\n    const ringPath = [];\n    for (let j = 0; j < 72; j++) {\n     const angle = (j / 72) * Math.PI * 2;\n     ringPath.push([rx * Math.cos(angle), 0.107, rz * Math.sin(angle)]);\n    }\n    const ringMesh = new THREE.Mesh(GEO.buildSweptProfile(ringPath, GEO.profiles.circle(0.0045, 6), { samples: 72, closedPath: true, caps: false }), growthRingMaterial);\n    ringMesh.name = `Tree.GrowthRings.Ring.${String(i + 1).padStart(2, '0')}`;\n    growthRingAssembly.add(ringMesh);\n   }\n   group.add(growthRingAssembly);\n  }\n}\n\n\n// --- slice ---\n{\n  {\n   const repairedSeedGeometry = GEO.buildLathe([[0.003, -0.032], [0.015, -0.024], [0.026, 0], [0.019, 0.022], [0.003, 0.034]]);\n   group.traverse((node) => {\n    if (node.isMesh && /^Tree\\.SeedPod\\.\\d{2}$/.test(node.name)) {\n     node.geometry.dispose();\n     node.geometry = repairedSeedGeometry.clone();\n    }\n   });\n   const lateRootMaterial = new THREE.MeshStandardMaterial({ color: 0x633044, roughness: 0.72, metalness: 0.05 });\n   for (let side = -1; side <= 1; side += 2) {\n    const rootCurve = new THREE.CatmullRomCurve3([\n     new THREE.Vector3(0, 0.18, 0.04),\n     new THREE.Vector3(0, 0.145, side * 0.12),\n     new THREE.Vector3(0, 0.115, side * 0.23),\n     new THREE.Vector3(0, 0.105, side * 0.31)\n    ]);\n    const rootPath = rootCurve.getPoints(16).map((point) => [point.x, point.y, point.z]);\n    const rootMesh = new THREE.Mesh(GEO.buildSweptProfile(rootPath, GEO.profiles.circle(0.026, 9), { samples: 16, caps: true, scale: (u) => 1 - 0.72 * u }), lateRootMaterial);\n    rootMesh.name = `Tree.Root.Depth.${side < 0 ? 'Back' : 'Front'}`;\n    group.add(rootMesh);\n   }\n  }\n}","thumbUrl":"https://futurelabs.now/apps/images/u2/gen-agent-10-mvncvhny-miyf5-s5.png"}],"glbUrl":null}