From 719d61982953caf61c0df7776347e13105a2e8b2 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 22 Oct 2022 12:53:57 +0200 Subject: Add asset rendering scripts. --- tools/gencyl.js | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 tools/gencyl.js (limited to 'tools/gencyl.js') diff --git a/tools/gencyl.js b/tools/gencyl.js new file mode 100644 index 0000000..bae34b9 --- /dev/null +++ b/tools/gencyl.js @@ -0,0 +1,51 @@ +// physical cylinders are diameter 15mm x 10mm +// at 75dpi => 44px x 29px +// stickers: 42x28 +// image: 44x? - outline at 1 to 2 - start at 1.5 + +const fs = require('fs') + +function print_lord(output, side, label) { + let image = fs.readFileSync(label).toString('base64') + let svg = [] + let bd = '#222' + let f = 'url(#g)' + svg.push('') + svg.push('') + + if (1) { + svg.push('') + if (side === 'russian') { + svg.push('') + svg.push('') + svg.push('') + bd = '#555' + } else { + svg.push('') + svg.push('') + svg.push('') + bd = '#111' + } + svg.push('') + } else { + if (side === 'russian') { + f = '#ddd' + bd = '#222' + } else { + f = '#555' + bd = '#222' + } + } + + svg.push(``) + svg.push(``) + svg.push(``) + + svg.push('') + fs.writeFileSync(output, svg.join("\n") + "\n") +} + +for (let i = 1; i <= 7; ++i) { + print_lord(`images/lord_teutonic_${i}.svg`, "teutonic", `tools/output150/lord_teutonic_${i}_3d.png`) + print_lord(`images/lord_russian_${i}.svg`, "russian", `tools/output150/lord_russian_${i}_3d.png`) +} -- cgit v1.2.3