#!/usr/bin/env node // Generates teaching/cases/production-line-reference.html: a Z-up three.js // viewer with a 27-model selector. GLBs are served from the line-models symlink. import fs from "node:fs"; import path from "node:path"; import { fileURLToPath } from "node:url"; const here = path.dirname(fileURLToPath(import.meta.url)); const webRoot = path.resolve(here, "../.."); const models = JSON.parse(fs.readFileSync(path.join(webRoot, "public", "line", "models.json"), "utf8")).models; const outFile = path.join(webRoot, "teaching", "cases", "production-line-reference.html"); const esc = value => String(value ?? "").replace(/&/g, "&").replace(//g, ">").replace(/"/g, """); const html = ` 生产线参考模型 · 27 个 GLB

生产线参考模型

加载中…

左键旋转 · 滚轮缩放 · 右键平移

`; fs.writeFileSync(outFile, html); console.log(JSON.stringify({ ok: true, outFile, models: models.length }));