pub enum GeneratorConfig {
Curve {
family: CurveFamily,
},
LSystem {
axiom: String,
rules: Vec<(char, String)>,
angle_deg: f32,
max_depth: u32,
seed: u64,
},
Star {
order: u32,
contact_angle_deg: f32,
rings: Vec<RingSpec>,
},
Particles {
family: AttractorFamily,
morph_to: Option<IfsFigure>,
density: f32,
tuple_path: Option<(u32, u32)>,
},
Spectrum {
elements: usize,
layout: SpectrumLayout,
easing: Easing,
},
WarpMesh {
mesh: (u32, u32),
milk: Option<Box<MilkBundle>>,
salt: u32,
},
Path {
shape: Option<PathShape>,
morph_to: Option<PathShape>,
},
Field(FieldConfig),
Cellular(CellularConfig),
Plexus(PlexusConfig),
}Expand description
Declarative structural config a scene consumes once at preset load
(ADR-0007): not expressions — the family / grammar / tiling the sampler
or generator builds from. Delivered through the optional
Scene::configure hook, off the hot path. This is
the shared structural-config enum for every scene that has one: the line
scenes’ curve/L-system/star variants, plus the compute-particle attractor
family (Plan 0016) — it lives here rather than in lines/ so lines never has to name a
particles type (Plan 0031 Phase 6).
Variants§
Curve
A parametric curve: which family to sample.
Fields
family: CurveFamilyThe curve family (Maurer rose, …).
LSystem
An L-system: a grammar the generator expands and turtle-walks at load, caching one segment buffer per depth.
Fields
max_depth: u32Iterations to precompute (1..=max_depth), clamped to
lines::MAX_LSYSTEM_DEPTH at load.
Star
A Hankin star pattern: an n-fold star rosette built at load, with a few
contact-angle variants a beat can switch between — and, since ADR-0079,
an optional ring ornament drawn inside it.
Fields
Particles
A GPU compute-particle attractor (Plan 0016): which strange-attractor map
the compute step iterates. Not a line scene — reuses this shared enum so
the family rides the existing configure hook (no new trait method).
Fields
family: AttractorFamilyThe attractor family (De Jong, Clifford, Thomas, Lorenz, or one of the IFS figures).
morph_to: Option<IfsFigure>The figure the bindable morph param travels towards (ADR-0075),
from [particles] morph_to. None — the default — pins the figure,
so morph is inert.
IFS-only, and validated as such at load: morph_to on a map family
is a load error rather than a silent no-op, because the author asked
for something the engine cannot do.
density: f32How much of the tier’s particle budget is actually drawn (ADR-0069)
— a count against the tier’s anchor for a trace and a fraction of
the target-scaled budget for a cloud, the band between them resolved
by active_particles (ADR-0195) —
validated at load into
MIN_PARTICLE_DENSITY..=1.0.
Structural, not bindable: an eased integer count would re-decide the
picture every frame. 1.0 is the whole budget and the default.
tuple_path: Option<(u32, u32)>The tuple path the bindable morph param walks along on a map
family (ADR-0093), as (from, to) roster indices from
[particles] tuple_from / tuple_to. None — the default — means
there is no path and morph is inert, exactly as morph_to does for
the IFS.
Both ends are structural on purpose. The walk’s framing is
measured across it at load, which is thousands of map iterations; a
path whose near end came from the per-frame tuple param would have
to re-measure inside the frame loop every time that param moved.
Map-family-only, and validated as such at load — the IFS reaches its
own figure-to-figure travel through morph_to instead, and a tuple
path on an IFS is a load error rather than a silent no-op.
Spectrum
The spectrum readout’s [spectrum] table (Plan 0034 / ADR-0036): how many
elements the frequency axis is divided into, how they are laid out, and how
fast each one follows its band. All three are structure rather than
expression — they are fixed for as long as the preset is loaded — so they
ride the existing configure hook like every other declarative config.
Fields
elements: usizeElement count, validated at load into
2..=SPECTRUM_BINS.
layout: SpectrumLayoutWhich figure the elements form.
WarpMesh
The warp mesh’s [mesh] table (Plan 0100 / ADR-0113): the grid, in
cells, that the per-vertex program is evaluated over.
Structural for [curve] family’s reason — the vertex and index buffers
are built from it, so an eased grid would rebuild them mid-frame — and
clamped to the tier at both consumers rather than at load, since the
loader does not know which tier will render the preset
(warp_mesh::clamp_grid).
Fields
milk: Option<Box<MilkBundle>>The compiled EEL2 programs a converted preset carries, from a
[milk] table (Plan 0100 Phase 2 / ADR-0113). None — a
hand-authored warp_mesh preset — drives the mesh from the ordinary
[params] and [per_vertex] bindings instead, and executes no VM at
all.
Boxed because it is much the largest thing this enum carries and every other variant would pay for it by value.
salt: u32The salt the bundle’s rand() draws under (ADR-0051).
The preset’s pinned_salt, always — its declared numeric seed, or
0 where it declared seed = "random". So a bundle is a pure
function of its inputs in the live app as well as in the harness,
which is stronger than ADR-0051 requires and costs nothing: per-run
variety is opt-in through seed = "random", and no converted preset
declares one. A hand-written bundle that does gets the pinned
behaviour, and that is stated rather than discovered.
Path
The shape field’s [path] table (ADR-0107): an authored silhouette, as a
closed contour parsed once at load from inline SVG path data.
The one variant here carrying geometry rather than a selector or a
size. It rides configure for the reason every other structural table
does — it is fixed for as long as the preset is loaded — and a
shape_field preset declaring no table gets None and draws the closed
marks roster exactly as it did before paths existed.
Fields
shape: Option<PathShape>The contour, normalized into [-1, 1] and resampled to the arity
[path] samples asked for. None — a shape_field preset that
declares no table — is what makes this config always Some: it
is handed over on every preset switch precisely so configure runs
and clears the outgoing preset’s contour, the same reason the
attractor’s and the spectrum’s configs are unconditional.
morph_to: Option<PathShape>The silhouette the bindable morph param travels towards, from
[path] morph_to. None — the default — pins the figure, so morph
is inert, exactly as the attractor’s own morph_to does.
Already aligned to shape at load: same arity, same winding, and
the cyclic start that minimises total displacement (ADR-0107). The
render layer interpolates the two point lists and re-derives none of
that, which is what keeps an O(N^2) search off the frame.
Field(FieldConfig)
The analytic field’s [field] table (ADR-0180 rule 1): which closed-form
family the pass draws. Always Some for that system, so configure runs
on every preset switch and the outgoing preset’s family never survives
into the incoming one.
Cellular(CellularConfig)
The cellular system’s [cellular] table (ADR-0180 rule 1): which
automaton runs, on how large a grid, and the salt its seeding draws from.
Always Some for that system, so configure runs on every preset switch
and the incoming preset starts from its own seed.
Plexus(PlexusConfig)
The plexus system’s [plexus] table (ADR-0257): the layout, the point
count and the seed. Always Some for that system, so configure runs on
every preset switch and the incoming preset starts from its own points.
Implementations§
Source§impl GeneratorConfig
impl GeneratorConfig
Sourcepub fn element_count(&self) -> usize
pub fn element_count(&self) -> usize
How many elements a per-element binding should be evaluated for under this
config, or 0 when the system has no per-element surface (Plan 0034 Phase
4). Read once at preset load to size the render layer’s scratch.
The count lives here rather than on Scene because it is preset data:
it comes off the [spectrum] table, not out of the scene’s state, and the
renderer already holds the preset.
Trait Implementations§
Source§impl Clone for GeneratorConfig
impl Clone for GeneratorConfig
Source§fn clone(&self) -> GeneratorConfig
fn clone(&self) -> GeneratorConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more