@creatica/engine
v0.1.0
Published
Headless, deterministic renderer for Creatica's procedural SVG background generators.
Readme
@creatica/engine
Headless, deterministic renderer for the 58 generators in core/structures.
import { renderSvg, renderPng, listStructures } from '@creatica/engine';
const { svg, seed } = await renderSvg({ structure: 'wave', seed: 'x', width: 1200, height: 630, palette: { colors: ['#000', '#f0f'] }, shape: { numRows: 4 } });
const png = renderPng(svg, { width: 2400 });- DOM via
svgdom(pinned 0.1.19; newer versions reject svg.js'sxmlnshandling). - Determinism:
withSeed()reseeds the shared PRNG and swapsMath.randomfor the render, covering every generator without editing them. svg.js's global id counter is normalised in the output. yarn smokerenders every structure twice and asserts byte-identical output per seed.- Built with tsup; the bundle inlines
core/and a few CJS-era libs, and stubs the editor-only React imports.
