Skip to main content

sciart_core/
lib.rs

1//! **Internal crate of [`sciart`](https://docs.rs/sciart)**, with no semver promise: its API
2//! can change in any release. Use the `sciart` crate, the supported entry point.
3//!
4//! Terminal-agnostic primitives for sciart (SPEC-001).
5//!
6//! Nothing in this crate touches the terminal, the OS, the wall clock or a global RNG:
7//! generators built on it are deterministic and testable in isolation.
8
9mod canvas;
10mod clock;
11mod ctx;
12pub mod draw;
13mod generator;
14pub mod geom;
15pub mod grid;
16pub mod ink;
17pub mod ode;
18pub mod particles;
19pub mod raster;
20pub mod rng;
21mod size;
22mod stage;
23pub mod stellar;
24pub mod text;
25pub mod timeline;
26pub mod title;
27pub mod trig;
28
29pub use canvas::{Canvas, Cell, Glyph, GlyphMode};
30pub use clock::FixedStep;
31pub use ctx::Ctx;
32pub use generator::{Category, Generator, Meta};
33pub use geom::{Camera, Projector};
34pub use grid::{CubicRow, Edges, Grid, Hood, MapRow, SampleMap};
35pub use ink::{Ink, Ramp, Role};
36pub use particles::{InverseCdf, ParticlePool, SpatialHash, Trail};
37pub use raster::{Density, Dots, Glow, Pixels, Tone};
38pub use rng::SplitMix64;
39pub use size::Size;
40pub use stage::Stage;
41pub use text::StackText;
42pub use timeline::{Beat, Timeline, ease};
43pub use trig::Trig;
44
45/// Simulation step used by the runtime (ADR-0003).
46pub const SIM_DT: f64 = 1.0 / 60.0;
47
48/// Everything a generator module needs: `use sciart_core::prelude::*;`
49pub mod prelude {
50    pub use crate::{
51        Beat, Camera, Canvas, Category, Cell, Ctx, Density, Dots, Edges, FixedStep, Generator,
52        Glow, Glyph, GlyphMode, Grid, Hood, Ink, InverseCdf, Meta, ParticlePool, Pixels, Projector,
53        Ramp, Role, SIM_DT, SampleMap, Size, SpatialHash, SplitMix64, StackText, Stage, Timeline,
54        Trail, Trig,
55    };
56}