Skip to content

armgit / kiln

Public Imported from GitHub
0

Build and revise procedural 3D assets with your coding agent. Local MCP server, CLI and TypeScript engine with rendered review, editable source and GLB export.

10.1 KB
Raw Blame
---
import AssetDownloads from './AssetDownloads.astro';
import { packDelivery } from '../lib/delivery';
import PageHeader from "./PageHeader.astro";
import authorRecords from "../data/foundry-floor-authors.json";
import { modelName, harnessName, groupAssetAttribution } from "../lib/attribution";
import ResponsiveImage from "./ResponsiveImage.astro";
import pack from "../data/packs/foundry-floor.json";
import foundryFloor from "../data/foundry-floor.json";
import sceneMedia from "../data/scene-media.json";
import { bytes, bounds, listOf as list, number } from "../lib/catalog";
import { foundryGalleryHref } from "../lib/gallery";

// Everything on this page is read from src/data/packs/foundry-floor.json, which scripts/stage-foundry-floor.mjs
// writes from the staged scene pack (pack.json, data/assets.json, licenses/ASSET-LICENSE.txt) and the GLBs.
const hasCampus = pack.assets.some(asset => asset.group === "campus");
const foundryCampusPoster = sceneMedia["foundry-floor"].captures.campus.poster;
type Asset = (typeof pack.assets)[number];
type RecordedAsset = Asset & { attribution?: { author:string; requestedEffort:string|null; note?:string }; reviewStatus?:string; lod: (Asset['lod'] & {form?:string}) | null };
const groups = pack.groups.map((group) => ({
  ...group,
  assets: pack.assets.filter((asset) => asset.group === group.id),
}));
const unplaced = pack.assets.filter((asset) => !asset.placedInScene);
const authors = groupAssetAttribution(pack.assets as RecordedAsset[]);
const conventions = [
  ["Frame", pack.conventions.frame],
  ["Far forms", pack.conventions.lod],
  ["Parts hidden at load", pack.conventions.hidden],
  ["Materials", pack.conventions.materials],
  ["Animation clips", pack.conventions.clips],
] as const;
const triangleSplit = (metrics: Asset["metrics"]) =>
  [
    `${number(metrics.trianglesDetailed)} detailed`,
    metrics.trianglesLod1 ? `${number(metrics.trianglesLod1)} lod1` : null,
    metrics.trianglesHidden ? `${number(metrics.trianglesHidden)} hidden at load` : null,
  ]
    .filter(Boolean)
    .join(" / ");
---

<div class="grid items-start gap-6 py-8 lg:grid-cols-2">
  <PageHeader>{pack.name}</PageHeader>
  <p class="lead">
    {pack.assetCount} models for a fictional chip fab: process tools, wafer
    transport and storage, the cleanroom’s floor, ceiling and walls, and the
    people and robots who work there{hasCampus ? ", plus the campus models included in this release." : "."}
  </p>
</div>
{hasCampus && (
  <figure class="mt-4">
    <ResponsiveImage
      image={foundryCampusPoster}
      sizes="(max-width: 767px) calc(100vw - 32px), (max-width: 1279px) calc(100vw - 64px), (max-width: 1439px) calc(100vw - 144px), 1296px"
      eager
      class="block w-full"
    />
    <figcaption class="mt-3 text-caption text-dim">
      The campus buildings assembled from the pack’s head and hall modules,
      with roads, parking and planting. The scene also opens the working fab interior.
    </figcaption>
  </figure>
)}
<div class="mt-4 border-y border-ink py-6">
  <div>
    <p class="max-w-reading">
      The {foundryFloor.name} scene places {pack.placedInScene} of the{" "}
      {pack.assetCount} models.{unplaced.length>0 && <> The {list(unplaced.map((asset) => asset.name.charAt(0).toLowerCase() + asset.name.slice(1)))} are in the pack but not placed.</>}
    </p>
    <a class="text-link mt-2" href={pack.scene.href}>
      View the Foundry Floor scene preview <span aria-hidden="true">→</span>
    </a>
  </div>
</div>
<section class="pt-16" aria-labelledby="inventory">
  <h2 id="inventory">Every model can be used on its own.</h2>
  <p class="mt-4 max-w-reading text-dim">
    Each picture is the delivered GLB, rendered under the review rig from the
    front right, as a plain glTF viewer draws it. The triangle count on each
    card is what that viewer draws; the measured list below splits it.
  </p>
  {groups.map((group) => (
    <section class="pt-10" aria-labelledby={`group-${group.id}`}>
      <h3 id={`group-${group.id}`} class="text-title">{group.title}</h3>
      <div class="mt-6 grid grid-cols-2 gap-x-4 gap-y-10 md:grid-cols-3 md:gap-x-6 lg:grid-cols-4">
        {group.assets.map((asset) => (
          <article class="min-w-0 border-t border-rule">
            <div class="bg-stage">
              <ResponsiveImage
                image={asset.poster}
                sizes="(max-width: 639px) 50vw, (max-width: 1023px) 33vw, 25vw"
                class="aspect-square w-full object-contain"
              />
            </div>
            <h4 class="pt-4 text-lg font-semibold tracking-tight md:text-title">
              {foundryGalleryHref(asset) ? <a class="text-link" href={foundryGalleryHref(asset)}>{asset.name}</a> : asset.name}
            </h4>
            <p class="mt-1 font-mono text-code text-dim">
              {number(asset.metrics.triangles)} triangles
            </p>
            {(asset as RecordedAsset).lod?.form === 'MSFT_lod' && <p class="mt-1 text-caption text-dim">Optional LOD tiers included.</p>}
            <p class="mt-1 font-mono text-code text-dim">
              {bounds(asset.metrics.bounds)} m
            </p>
            {!asset.placedInScene && (
              <p class="mt-2 text-caption text-dim">
                In the pack, not placed in the scene.
              </p>
            )}
            <a class="text-link mt-2" href={asset.runtimeDownload.url}>
              Download GLB<span class="sr-only"> of the {asset.name}</span>{" "}
              <span aria-hidden="true">↓</span>
            </a>
            <p class="font-mono text-code text-dim">
              {bytes(asset.runtimeDownload.bytes)}
            </p>
          </article>
        ))}
      </div>
    </section>
  ))}
</section>
<section class="pt-16" aria-labelledby="measured">
  <h2 id="measured">Measured from the files.</h2>
  <p class="mt-4 max-w-reading text-dim">
    Sizes and triangle counts are read from each delivered GLB and agree with
    the interior asset map where it provides measurements. {hasCampus && "Campus measurements are read directly from their sealed GLBs."} The table splits detailed geometry, lower tiers and scene-hidden parts. Optional MSFT_lod tiers are outside the default scene; legacy visible lod1 groups remain visible in an ordinary loader. Each card counts only what that loader actually draws.
  </p>
  <section class="mt-6 overflow-x-auto" tabindex="0" aria-label="Foundry Floor model measurements">
    <table class="w-full border-collapse text-left text-caption">
      <caption class="sr-only">Dimensions, triangles, materials and clips in each delivered GLB</caption>
      <thead><tr class="border-y border-ink"><th scope="col" class="p-3">Model</th><th scope="col" class="p-3">Bounds (m)</th><th scope="col" class="p-3">Triangles</th><th scope="col" class="p-3">Materials / clips</th></tr></thead>
      <tbody>{pack.assets.map((asset) => (
        <tr class="border-b border-rule"><th scope="row" class="p-3 font-semibold">{asset.name}</th><td class="p-3 font-mono">{bounds(asset.metrics.bounds)}</td><td class="p-3 font-mono">{triangleSplit(asset.metrics)}</td><td class="p-3">{asset.metrics.materials} / {asset.metrics.clips.length}</td></tr>
      ))}</tbody>
    </table>
  </section>
  <p class="mt-3 font-mono text-code text-dim">Length × height × width, in metres.</p>
</section>
<section class="pt-16" aria-labelledby="downloads"><h2 id="downloads">Download the assets</h2><AssetDownloads runtime={packDelivery('foundry-floor').runtime} editable={packDelivery('foundry-floor').editable} /></section>
<section class="pt-16" aria-labelledby="conventions">
  <h2 id="conventions">File and scene conventions.</h2>
  <dl class="mt-8 border-t border-ink">
    {conventions.map(([term, text]) => (
      <div class="grid gap-2 border-b border-rule py-5 lg:grid-cols-12">
        <dt class="font-semibold lg:col-span-3">{term}</dt>
        <dd class="max-w-reading lg:col-span-9">{text}</dd>
      </div>
    ))}
  </dl>
  <p class="mt-4 max-w-reading text-caption text-dim">{pack.conventions.source}</p>
</section>
<section class="pt-16" aria-labelledby="authorship">
  <h2 id="authorship">Recorded authorship</h2>
  <p class="mt-5 max-w-reading">
    The licence binds each model to its saved revision. The author inputs record
    the requested model, effort and harness below. Effort is not independently confirmed.
  </p>
  <dl class="mt-8 border-t border-ink">
    {authors.map((assets) => { const author = assets[0]!.author; const attribution = authorRecords[author as keyof typeof authorRecords]; const recorded = assets[0]!.attribution; const notes=recorded?.note?.replace(/ Owner review is pending\.$/, ''); return (
      <div class="grid gap-2 border-b border-rule py-4 lg:grid-cols-12">
        <dt class="font-semibold lg:col-span-4">{list(assets.map((asset) => asset.name))}</dt>
        <dd class="max-w-reading lg:col-span-8">{recorded ? `${recorded.author.replace(" · claude ", " · Claude Code ").replace(" · agy ", " · Antigravity CLI (agy) ").replace(" · codex ", " · Codex ")}. Requested effort: ${recorded.requestedEffort ?? "not recorded"}. Independently confirmed: not recorded.${notes ? ` ${notes}` : ""}` : attribution ? `${modelName(attribution.requestedModel)} through ${harnessName(attribution.harness)}. Requested effort: ${attribution.requestedEffort}. Independently confirmed: not recorded.` : "Model and effort not recorded in the staged author inputs."}</dd>
      </div>
    ); })}
  </dl>
</section>
<section class="pt-16" aria-labelledby="license">
  <h2 id="license">Keep the licence boundary intact.</h2>
  <p class="mt-5 max-w-reading" data-verbatim>{pack.licenseScope}</p>
  <p class="mt-4 max-w-reading">{pack.licenceNote}</p>
  <p class="mt-4 max-w-reading">
    Keep the licence text with the models. It names every model, the saved
    revision and the SHA-256 of the GLB it covers.
  </p>
  <div class="mt-2 flex flex-wrap gap-x-6">
    <a class="text-link" href={pack.licence.url}>
      Read the pack’s licence text ({bytes(pack.licence.bytes)})
    </a>
    <a class="text-link" href="https://creativecommons.org/publicdomain/zero/1.0/">
      CC0-1.0 dedication <span aria-hidden="true">↗</span>
    </a>
  </div>
  <p class="mt-8 max-w-reading text-caption text-dim">{foundryFloor.notice}</p>
</section>