This commit is contained in:
heyshawtyy committed 2026-11-09 22:37:44 +05:00
1 parent fd5e92d0f5
commit 9f898c04dd
415 files changed
+6241617 -633464

No files matched your search

+15
View File
@@ -0,0 +1,15 @@
// Превью любого генератора без Blockbench: node tools/bbshop/preview.js <generator.js> <out.png> [scratch] [yaw] [pitch]
// Генератор пересобирает свои файлы как обычно; все его модели рисуются в ряд.
const path = require('path');
const [gen, out, scratch = require('os').tmpdir(), yaw = 30, pitch = 25] = process.argv.slice(2);
process.argv[2] = scratch;
const { Model } = require('./lib');
const { render } = require('./render');
require(path.resolve(gen));
let x = 0; const items = [];
for (const m of Model.all) {
let mn = 1e9, mx = -1e9; for (const c of m.cubes) { mn = Math.min(mn, c.from[0]); mx = Math.max(mx, c.to[0]); }
items.push({ model: m, offset: [x - mn, 0, 0] }); x += mx - mn + 1.5;
}
render(items, out, { yaw: +yaw, pitch: +pitch });
console.log('preview:', out);