// Prints the sampled parameters of a range of clips without rendering them. // node --experimental-strip-types scripts/show-samples.ts [--seed S] [--start I] [--count N] import { drawSample } from "./generate.ts"; const argv = process.argv.slice(2); const arg = (n: string, d: string) => { const k = argv.indexOf(`--${n}`); return k >= 0 ? argv[k + 1] : d; }; const seed = parseInt(arg("seed", "1")), start = parseInt(arg("start", "0")), count = parseInt(arg("count", "8")); for (let i = start; i < start + count; i++) { const s = drawSample(seed, i); const p = s.params; console.log(s.id, `E ${(p.E / 1e9).toFixed(0)} rho ${p.rho.toFixed(0)} h ${(p.h * 1e3).toFixed(2)} L ${(p.Lx * 100).toFixed(0)}x${(p.Ly * 100).toFixed(0)} v ${p.strikeVelocity.toFixed(2)} grid ${s.nx}x${s.ny} scale ${(s.shapeScale * 1e3).toFixed(2)}mm p2p ${(s.peakToPeak * 1e3).toFixed(1)} slope ${s.maxSlope.toFixed(3)} sig0 ${p.sigma0.toFixed(2)} sig1 ${p.sigma1.toExponential(1)} mass ${(p.rho * p.h * p.Lx * p.Ly).toFixed(2)} kg`); }