mod.rs

1.7 kB · rust · 65 lines

1/// The square grid of f32 samples.2pub mod field;3/// The recipe and sampling of one moire layer.4pub mod layer;5/// The exact correlations of flat carpet layers, and the prime detector they make.6pub mod pairs;7/// The named recipes: the parity heatmap, its weave, its hive and the carpet stack.8pub mod presets;9/// The quantized PNG rendering of a field.10pub mod render;11/// The lattice coordinates and code-membership tests behind the layers.12pub mod sample;13/// The stacking of layers into one combined field.14pub mod stack;15/// The cube designs stacked into a volume, and the planes that cut it.16pub mod volume;1718/// The sampling lattice of a moire field.19#[derive(Clone, Copy, Debug, PartialEq, Eq)]20pub enum Lattice {21    /// The square lattice.22    Square,23    /// The hexagonal lattice.24    Hex,25}2627/// The way stacked layers merge.28#[derive(Clone, Copy, Debug, PartialEq, Eq)]29pub enum Combine {30    /// The layer-count sum.31    Sum,32    /// The intersection.33    And,34    /// The parity.35    Xor,36}3738/// The identity of a design: its code, base and dimension.39#[derive(Clone, Copy, Debug, PartialEq, Eq)]40pub struct Spec {41    /// The design code.42    pub code: u128,43    /// The residue base.44    pub base: usize,45    /// The design dimension.46    pub dimension: usize,47}4849impl Spec {50    /// Builds a spec from a code, base and dimension.51    pub fn new(code: u128, base: usize, dimension: usize) -> Spec {52        Spec {53            code,54            base,55            dimension,56        }57    }58}5960pub use field::Field;61pub use layer::{layer, Layer};62pub use presets::{all, named, Preset};63pub use render::render;64pub use stack::{merge, stack, stack_codes};65pub use volume::{frame, volume, Frame, Volume};