web interface
This commit is contained in:
24
tools/qft-perspfloor.mjs
Normal file
24
tools/qft-perspfloor.mjs
Normal file
@@ -0,0 +1,24 @@
|
||||
/* qft-perspfloor.mjs — sweep the straight-lined perspective floor grid.
|
||||
Usage: node tools/qft-perspfloor.mjs [size] */
|
||||
import { writeFileSync, mkdirSync } from 'node:fs';
|
||||
import { perspFloorSVG } from '../src/qft/perspgrid.js';
|
||||
const SIZE = +(process.argv[2] || 1400);
|
||||
const OUT = 'output/qft/perspfloor';
|
||||
mkdirSync(OUT, { recursive: true });
|
||||
const D = Math.PI / 180;
|
||||
const S = [
|
||||
{ name: '01_floor-1pt', label: 'one-point floor to horizon', o: { pitch: 30 * D, persp: 1.0, dist: 3.0, nx: 16, nz: 24, originY: 0.34 } },
|
||||
{ name: '02_floor-shallow', label: 'shallow pitch · distant horizon', o: { pitch: 16 * D, persp: 1.1, dist: 3.2, nx: 18, nz: 28, originY: 0.42 } },
|
||||
{ name: '03_floor-2pt', label: 'two-point (yaw 22°)', o: { pitch: 28 * D, yaw: 22 * D, persp: 1.1, dist: 2.8, nx: 16, nz: 22, originY: 0.32 } },
|
||||
{ name: '04_steep-tile', label: 'steeper · tighter tiles', o: { pitch: 46 * D, persp: 1.2, dist: 2.4, nx: 14, nz: 20, originY: 0.2 } },
|
||||
{ name: '05_dense-fine', label: 'dense fine grid', o: { pitch: 26 * D, persp: 1.0, dist: 3.0, nx: 26, nz: 38, originY: 0.36, stroke: 1.0, strokeFar: 0.3 } },
|
||||
{ name: '06_gentle-ripple', label: 'gentle floor ripple (still straight-ish)', o: { pitch: 28 * D, persp: 1.0, dist: 3.0, nx: 16, nz: 24, originY: 0.34, rippleAmp: 0.5, rippleFreqI: 0.5, rippleFreqK: 0.35 } },
|
||||
{ name: '07_teal-zoom', label: 'teal · zoomed in', o: { pitch: 24 * D, persp: 1.0, dist: 2.6, scale: 1.3, nx: 16, nz: 26, originY: 0.34, hue: 0.5, hue2: 0.55, sat: 0.34 } },
|
||||
{ name: '08_2pt-shifted', label: 'two-point · shifted VP', o: { pitch: 22 * D, yaw: -28 * D, persp: 1.15, dist: 2.6, nx: 18, nz: 24, originX: 0.2, originY: 0.3 } },
|
||||
];
|
||||
console.log(`perspfloor sweep (${S.length}) → ${OUT}/`);
|
||||
for (const v of S) { writeFileSync(`${OUT}/${v.name}.svg`, perspFloorSVG(SIZE, { ...v.o, mode: 'solid' })); console.log(` ${v.name} — ${v.label}`); }
|
||||
writeFileSync(`${OUT}/m.html`, `<!DOCTYPE html><html><head><meta charset="utf-8">
|
||||
<style>html,body{margin:0;background:#222}.grid{display:grid;grid-template-columns:repeat(2,1fr);gap:8px;padding:10px;width:2100px}figure{margin:0;position:relative;background:#fff;overflow:hidden}img{width:100%;display:block}figcaption{position:absolute;left:0;bottom:0;right:0;padding:6px 10px;font:13px ui-monospace,monospace;color:#fff;background:linear-gradient(transparent,#000d)}</style></head><body>
|
||||
<div class="grid">${S.map(v => `<figure><img src="${v.name}.svg"><figcaption>${v.label}</figcaption></figure>`).join('')}</div></body></html>`);
|
||||
console.log(`-> ${OUT}/m.html`);
|
||||
Reference in New Issue
Block a user