Skip to main content

Module raster

Module raster 

Source
Available on crate feature raster only.
Expand description

Deterministic 3D-scene → terminal-text rasterizer (Phase R, PHASE-R-MAP §3/§4).

Pipeline: state → SceneGraph3D → CellGrid (glyph text). Every public type here is Debug + Clone + PartialEq + Serialize + Deserialize (the JSON golden-artifact contract) and every Cell is Tier-0 fully informative (ch + fg + bg unconditionally — no Option).

Re-exports§

pub use camera::depth_sort;
pub use camera::depth_sort_nodes;
pub use camera::face_is_clipped;
pub use camera::node_is_clipped;
pub use camera::project;
pub use camera::strut_is_clipped;
pub use camera::Camera;
pub use camera::Projected;
pub use color::heat;
pub use color::to_ansi256;
pub use color::Palette;

Modules§

algebra
Transformation algebra (topology-deck.html:181-193): s = v·e, r, T, Φ. Pure, RNG-free, fully portable — no mulberry32 needed here. Task 5.
camera
Camera + perspective projection + painter’s depth sort (Task 2).
color
Color under constraint (Task 4): the deck’s gold->bone->crimson heat canon, a deterministic 256-palette quantization, and the per-cell “one fg + one bg” pick under the braille glyph floor.
deck
mulberry32 deck RNG port + buildWorld fixture + o(C) organization degree (topology-deck.html:120-121, 129-179, 196-208). Task 6.
fmt
Deterministic float formatter — copied verbatim from viz/svg.rs:109-117 (private there) so golden fixtures across raster/ share the exact same byte-exact float→text contract. Do NOT alter the algorithm.
h3cells3d
h3o u64 boundary (PHASE-R-MAP §4 / divergence D7): all bitwise spatial algebra for the raster crate lives here, never leaking into graph semantics. CellIndex (u64-backed NonZeroU64) is the spatial index domain type end-to-end; it is stringified only when it crosses the graph’s stringly-typed ID boundary. Feature-gated cells3d. Task 9.
ingest
Attribute contract + typed ingest errors for real-Hypergraph topology ingest (Phase I, Task 1). This module doc is the canonical, normative home of the attribute contract; plans/phase-I-topology-ingest.md is its rationale, not its spec.
instrumentscells3d
The three Lawverian 3D instruments (PHASE-R-MAP §3): pure DeckWorld -> SceneGraph3D builders, one per instrument, direct transcriptions of the deck’s draw functions minus canvas calls. Feature-gated cells3d (S9 lane gate — 3D spatial embeddings are library/CLI capability only).
pngraster-png
Rust-side PNG pixel-plate emission (Task 14, ADR097 Tier-1).

Structs§

Cell
A single terminal cell: glyph + foreground + background, always all three present (the glyph floor — PHASE-R-MAP §4 Tier-0 contract).
CellGrid
A row-major grid of Cells (cells.len() == cols*rows).
Face
A triangle face for the scanline fill (Task 3).
Node3
A rendered node lifted into 3D (mirrors viz::NodeGlyph, viz/mod.rs:52-61).
Rgb
A truecolor RGB triple. No alpha — the glyph floor composes fg/bg unconditionally (Task 4 fills the quantization/heat-ramp logic).
SceneGraph3D
The 3D scene graph — mirrors viz::SceneGraph (viz/mod.rs:74-80) lifted to (x,y,z) with triangle faces and line struts.
Strut
A line strut for the Bresenham line walk (Task 3).
Vertex3
A point in the 3D scene, prior to camera projection.

Functions§

rasterize
Rasterize scene under camera into a cols x rows CellGrid (Task 3): near-plane-clip, painter’s depth-sort, rasterize faces, struts and node discs into a braille 2x4 subcell buffer via the shared grid::draw_scene core, compose glyphs, then stamp the scene’s labeled scalars across the top rows as literal glyph cells.