Skip to main content

IfsFigure

Enum IfsFigure 

Source
pub enum IfsFigure {
    Fern,
    Tree,
    Dragon,
    Sierpinski,
    Spiral,
}
Expand description

Which curated figure the IFS draws.

A small closed set on purpose (ADR-0075). Twenty-four free affine coefficients with a contractivity cliff is close to unauthorable — most random tables are a blob or a diverging cloud — so the preset surface gets five hand-authored figures and a continuous path between them instead.

Variants§

§

Fern

Barnsley’s fern — the canonical organic fractal.

§

Tree

Barnsley’s bare tree: a trunk that forks at ±45° all the way down.

§

Dragon

The Heighway dragon — two maps, and nothing organic about it.

§

Sierpinski

The Sierpinski triangle. Here as a correctness fixture as much as a look: its exact self-similarity makes a wrong implementation obvious at a glance, and it is the least organic thing in a plan whose brief was “organic” (ADR-0075).

§

Spiral

A logarithmic spiral arm with two satellite maps.

Implementations§

Source§

impl IfsFigure

Source

pub const ALL: [Self; 5]

Every curated figure, for the sweeps that must cover the whole roster.

A named constant rather than a literal at each call site: the safety argument is a sweep property (max σ < 1 for every figure, every pair, every lever extreme), and a test that iterates a hand-written list is one forgotten entry away from proving it about four of five figures.

Source

pub fn from_name(name: &str) -> Option<Self>

Parse a [particles] family name, or None if unknown.

Source

pub fn name(self) -> &'static str

The [particles] family name this figure parses from — the inverse of from_name, for diagnostics and for the round-trip test that keeps the two in step.

Source

pub fn table(self) -> IfsTable

The curated table, decomposed — the form everything downstream works in.

Source

pub fn frame(self) -> (f32, [f32; 3])

(world scale, centre) — the projection’s framing for this figure at the reference aspect, as a fallback.

The render path takes its framing from FitLut instead, which follows the morph and knows the target’s aspect. This survives for the two callers that have neither: the seeded scatter, and the CPU transcription of the draw shader that the projection tests run.

The fern is the reason Basis::projection carries a full three-component centre rather than a z-centre: it spans y ∈ [0, 10] and is not origin-centred, so a projection that subtracts nothing puts its root on the bottom edge and its canopy off the top.

Source

pub fn seed_box(self) -> ([f32; 3], [f32; 3])

The seeded initial-scatter box, (half-spread, centre) per axis.

The figure’s own bounding box, so the initial fill lands over the attractor and converges onto it rather than travelling to it. The probability-weighted per-step contraction is 0.742 for the fern, so a displacement shrinks a thousandfold in ~23 steps — 0.39 s at the fixed step, which is the startup haze ADR-0075 records and the successor plan’s staggered respawn removes.

z is zero: the family is two-dimensional and takes the default Basis::XY.

Source

pub fn packed(self) -> IfsPacked

Resolve this figure to the compute step’s payload.

Phases 3–5 grow this into resolve(a, b, morph, levers), which is where the whole safety argument lives — and it stays a pure function with no GPU and no clock, so a sweep asserting max σ < 1 over every figure pair and every lever extreme is an ordinary unit test.

Trait Implementations§

Source§

impl Clone for IfsFigure

Source§

fn clone(&self) -> IfsFigure

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 IfsFigure

Source§

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

Formats the value using the given formatter. Read more
Source§

impl PartialEq for IfsFigure

Source§

fn eq(&self, other: &IfsFigure) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for IfsFigure

Source§

impl Eq for IfsFigure

Source§

impl StructuralPartialEq for IfsFigure

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
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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,