const DefaultParams
DefaultParams is the canonical form of the defaults; it renders exactly like "".
Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.
Package kilim is a Sinopia engine: a flat-woven rug computed cell by cell on a warp grid. Medallions are the stepped ...
Package kilim is a Sinopia engine: a flat-woven rug computed cell by cell on a warp grid. Medallions are the stepped rings of an integer distance field (the grid turns every diagonal into a staircase, as on a loom), the border is a running sawtooth, diamond or stripe band, and "abrash" bands shift a dye lot mid-rug like hand-dyed wool.
It is a port of the kilim prototype (Python). The RNG stream, trait tables and draw order are the prototype's; the deliberate changes are the Weaver's Flaw rule (now visible in every field), the params, and a compact SVG encoding that renders the same pixels. Python's // and % floor towards minus infinity and Go's truncate, so the lattice maths goes through floorDiv/floorMod; kilim_test.gno pins golden vectors produced by the Python reference, and frontend/src/engines/kilim.ts asserts the same ones.
Pure integer maths: no floats, no time, no block data.
DefaultParams is the canonical form of the defaults; it renders exactly like "".
MaxSVGBytes: the largest output over 10,000 default seeds is 8,514 B (Coarse loom: 5,984 B over 2,000 seeds x field); about 2x margin.
1const ParamsSchema = `{"type":"object","properties":{` +
2 `"dyes":{"type":"string","title":"Dyes","enum":["Seeded","Madder & Indigo","Saffron","Walnut & Bone",` +
3 `"Pomegranate","Night Indigo","Steppe","Undyed","Sinopia Earth"],"default":"Seeded"},` +
4 `"field":{"type":"string","title":"Field","enum":["Seeded","Medallion","Triple","Lattice","Banded","Ladder"],` +
5 `"default":"Seeded"},` +
6 `"loom":{"type":"string","title":"Loom","enum":["Fine","Coarse"],"default":"Fine"},` +
7 `"abrash":{"type":"boolean","title":"Abrash dye lots","default":true}}}`ParamsSchema is the Studio form. Studio sends JSON.stringify of the values in this property order; ValidateParams accepts exactly that or "".
Manifest describes the engine. Author and FeeBps are set by the adapter.
Render returns the raw SVG for in.Seed and in.Params.
SVG renders the artwork for a seed under cfg.
Traits returns the eight traits of in.Seed in TraitTypes order. It never renders: seven table draws and a score.
ValidateParams accepts "" (the showcase defaults) and the canonical JSON.
Defaults is the showcase look (params "").
ParseParams accepts "" or the canonical JSON Studio produces, nothing else.
TraitsOf returns the decoded traits for a seed.
1type Config struct {
2 Dyes int // -1: drawn from the seed, else an index into the dye table
3 Field int // -1: drawn from the seed, else an index into the field table
4 Coarse bool // 27 x 41 cells of 26 px instead of 37 x 55 cells of 20 px
5 Abrash bool // false: no dye-lot bands (Abrash "None")
6}Config is a parsed params string.
TraitSet is the decoded properties of a seed under a config.