Skip to main content

Crate sciart_core

Crate sciart_core 

Source
Expand description

Internal crate of sciart, with no semver promise: its API can change in any release. Use the sciart crate, the supported entry point.

Terminal-agnostic primitives for sciart (SPEC-001).

Nothing in this crate touches the terminal, the OS, the wall clock or a global RNG: generators built on it are deterministic and testable in isolation.

Re-exports§

pub use geom::Camera;
pub use geom::Projector;
pub use grid::CubicRow;
pub use grid::Edges;
pub use grid::Grid;
pub use grid::Hood;
pub use grid::MapRow;
pub use grid::SampleMap;
pub use ink::Ink;
pub use ink::Ramp;
pub use ink::Role;
pub use particles::InverseCdf;
pub use particles::ParticlePool;
pub use particles::SpatialHash;
pub use particles::Trail;
pub use raster::Density;
pub use raster::Dots;
pub use raster::Glow;
pub use raster::Pixels;
pub use raster::Tone;
pub use rng::SplitMix64;
pub use text::StackText;
pub use timeline::Beat;
pub use timeline::Timeline;
pub use timeline::ease;
pub use trig::Trig;

Modules§

draw
Shared drawing helpers (SPEC-001 CORE-R22..R27, CORE-R49, CORE-R62, CORE-R63, CORE-R67, CORE-R76).
geom
Geometry helpers shared by generators (CORE-R16..R18, CORE-R45, CORE-R50, CORE-R60..R63).
grid
Dense 2-D fields for automata, lattices and PDEs (SPEC-001 CORE-R33..R36, CORE-R43, CORE-R48, CORE-R52, CORE-R53, CORE-R68, CORE-R69).
ink
Semantic inks (CORE-R8), ink levels (CORE-R66), the colormap-field helpers (CORE-R46, CORE-R56, ADR-0011) and the phase, blackbody and named-ramp roles (CORE-R78..R80, ADR-0015).
ode
Fixed-step ODE integration for deterministic physics scenes (SPEC-001 CORE-R37, CORE-R44) and tridiagonal solvers for implicit diffusion (CORE-R59) and complex Crank–Nicolson steps (CORE-R100).
particles
Particle helpers shared by the particle-system scenes (SPEC-001 CORE-R28..R32, CORE-R54, CORE-R58).
prelude
Everything a generator module needs: use sciart_core::prelude::*;
raster
Sub-cell rasters layered onto a Canvas (SPEC-001 CORE-R41, CORE-R42, CORE-R51, CORE-R55, CORE-R64, CORE-R65, CORE-R85, CORE-R86, CORE-R95, ADR-0010).
rng
A tiny generator for hot inner loops (SPEC-001 CORE-R57), and stateless hashes on its finaliser (CORE-R70).
stellar
Stellar-disc helpers (SPEC-001 CORE-R93): the quadratic limb-darkening law, shared by solar_system-era scenes (total_solar_eclipse, solar_surface, exoplanet_transit).
text
Allocation-free text formatting for render (SPEC-001 CORE-R49, GEN-R11).
timeline
Looping scripted narratives and easing curves (SPEC-001 CORE-R38, CORE-R39).
title
Science titles: Phenomenon · mechanism, fitted and drawn at the bottom-left of every scene by Stage (SPEC-001 CORE-R71..R75, ADR-0014).
trig
Sine and cosine whose bits do not depend on the optimiser (SPEC-001 CORE-R90, ADR-0016).

Structs§

Canvas
A row-major grid of cells that generators draw into.
Cell
Ctx
Per-generator context: the only source of randomness and time (CORE-R13, ADR-0008).
FixedStep
Fixed-timestep accumulator (ADR-0003, CORE-R9..R12).
Glyph
A glyph with a pure-ASCII fallback (GEN-R10).
Meta
Size
Terminal dimensions in cells. Both axes are always >= 1 (CORE-R1).
Stage
Owns one generator plus its context and a double-buffered canvas, and is the single place that implements the call protocol (CORE-R15, CORE-R19..R21) and draws the science title (CORE-R75).

Enums§

Category
Where a scene belongs (CORE-R77, ADR-0013). Sky scenes are sorted by setting (Voyages, then Earth & Sky, then Sun & Planets, then Deep Cosmos); the rest by which of physics (P), chemistry (C) and biology (B) its model needs. Variant order is display order only.
GlyphMode

Constants§

SIM_DT
Simulation step used by the runtime (ADR-0003).

Traits§

Generator
A scene (CORE-R14). Call protocol (CORE-R15), guaranteed by the runtime: resize before the first update/render and on every size change; render receives a cleared canvas of the last resized size.