Skip to main content

GeneratorConfig

Enum GeneratorConfig 

Source
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: CurveFamily

The 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

§axiom: String

The starting string.

§rules: Vec<(char, String)>

Production rules (predecessor, successor).

§angle_deg: f32

Turn angle in degrees for +/-.

§max_depth: u32

Iterations to precompute (1..=max_depth), clamped to lines::MAX_LSYSTEM_DEPTH at load.

§seed: u64

Reserved seed for future stochastic rules; deterministic today.

§

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

§order: u32

Star order n (from the tiling), e.g. 6 or 12. 0 means no interlace at all (tiling = "none"), which the loader accepts only alongside a non-empty rings roster — the ornament drawn alone.

§contact_angle_deg: f32

Contact angle in degrees; variants are precomputed around it.

§rings: Vec<RingSpec>

The [generator] rings roster (ADR-0079): concentric rings of repeated motifs filling the interior the rosette leaves hollow. Empty — the default, and what an absent rings key means — is exactly the pre-Plan-0065 scene.

§

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: AttractorFamily

The 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: f32

How 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: usize

Element count, validated at load into 2..=SPECTRUM_BINS.

§layout: SpectrumLayout

Which figure the elements form.

§easing: Easing

Per-element temporal easing in seconds, applied on the injected real dt — the same Easing the [smoothing] table uses, deliberately reused rather than a second vocabulary (ADR-0035).

§

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

§mesh: (u32, u32)

Requested cells, (x, y), validated at load into MIN_MESH..=MAX_MESH.

§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: u32

The 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

Source

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

Source§

fn clone(&self) -> GeneratorConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GeneratorConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

§

impl<T> WasmNotSend for T
where T: Send,

§

impl<T> WasmNotSendSync for T
where T: WasmNotSend + WasmNotSync,

§

impl<T> WasmNotSync for T
where T: Sync,