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
impl IfsFigure
Sourcepub const ALL: [Self; 5]
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.
Sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
Parse a [particles] family name, or None if unknown.
Sourcepub fn name(self) -> &'static str
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.
Sourcepub fn table(self) -> IfsTable
pub fn table(self) -> IfsTable
The curated table, decomposed — the form everything downstream works in.
Sourcepub fn frame(self) -> (f32, [f32; 3])
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.
Sourcepub fn seed_box(self) -> ([f32; 3], [f32; 3])
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.
Sourcepub fn packed(self) -> IfsPacked
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§
impl Copy for IfsFigure
impl Eq for IfsFigure
impl StructuralPartialEq for IfsFigure
Auto Trait Implementations§
impl Freeze for IfsFigure
impl RefUnwindSafe for IfsFigure
impl Send for IfsFigure
impl Sync for IfsFigure
impl Unpin for IfsFigure
impl UnsafeUnpin for IfsFigure
impl UnwindSafe for IfsFigure
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.