Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v2 source pure

Package giornate (v2, "Wall Scenes") is a Sinopia signature engine: a fresco wall with a real scene on it (a processi...

Overview

Package giornate (v2, "Wall Scenes") is a Sinopia signature engine: a fresco wall with a real scene on it (a procession, a gathering, an encounter at a city gate, an Annunciation, a lone saint or a landscape), caught mid-work. A fresco is painted on wet plaster one day-patch (giornata) at a time, from the top of the wall down. Finished patches show the scene in pigment; the rest of the wall still shows the same scene as the red-ochre sinopia underdrawing on the rough arriccio plaster, with its squaring grid, compass-drawn haloes and hatching. Where the painted plaster has fallen away (lacunae) the sinopia shows through again, as it does on real walls.

Every element of the scene is defined once in <defs> and drawn twice with <use>: filled in the painted layer, outlined in the sinopia layer. That keeps figure-heavy walls small.

Everything is integer maths (a 64-step quarter-sine table, truncating division), so the TypeScript twin in frontend/src/engines/giornatev2.ts is byte-identical. Two RNG streams come from the seed: seed+"|traits" decides the traits (cheap, no geometry: Traits never renders) and seed+"|art" draws the picture, so art draws never shift traits.

Constants 1

const MaxSVGBytes

1const MaxSVGBytes = 28672
source

MaxSVGBytes: see docs/engines/giornate-v2.md for the measured sizes.

Functions 8

func Manifest

1func Manifest() engine.Manifest
source

Manifest describes the engine. Author and FeeBps are set by the adapter.

func Render

1func Render(in engine.Input) string
source

Render returns the raw SVG for in.Seed under in.Params. Core validates params before every render; invalid params panic.

func SVG

1func SVG(seed string) string
source

SVG renders a seed with the default (showcase) params.

func SVGWith

1func SVGWith(seed, ps string) string
source

SVGWith renders a seed under params as a standalone SVG document.

func Traits

1func Traits(in engine.Input) []engine.Trait
source

Traits returns the eight traits of in.Seed under in.Params. It never renders: one 7-draw RNG pass and a few table walks.

func ValidateParams

1func ValidateParams(s string) error
source

ValidateParams accepts "" and the canonical params JSON only.

func TraitsOf

1func TraitsOf(seed string) TraitSet
source

TraitsOf decodes a seed with the default params.

func TraitsWith

1func TraitsWith(seed, ps string) TraitSet
source

TraitsWith decodes a seed under params; invalid params panic.

Types 1

type TraitSet

struct
1type TraitSet struct {
2	Scene, Pigments, Sky, Completion, Giornate, Drawing, Condition string
3	Score                                                          int
4	Rarity                                                         string
5
6	pig, scene, sky, stage, gio, draw, cond int // table indices actually used
7}
source

TraitSet is a decoded seed. The SVG builder and the trait list read the same struct, so picture and metadata cannot disagree.

Dependencies

Source Files 2