mod.rs

2.5 kB · rust · 70 lines

1/// The triangle, corner and edge tallies of a hex cell, whose census and euler take the extra include_grid flag.2pub mod census;3/// The coded cubes projected to iso, pro and cut hexagons.4pub mod designs;5/// The hexagon shapes, projections and tessellations.6pub mod geometry;7/// The core, dual and edge networks of a hex slice.8pub mod graph;9mod models;10/// The coloring of a hex cell's triangles by type.11pub mod painter;12/// The square raster of a hex cell's fills at the true aspect.13pub mod raster;14/// The triangle, SVG and PNG renderings of a hex cell.15pub mod renderer;16/// The JSON form of a hex cell and its projection.17pub mod serializer;18/// The ghost star of the hexagonal cut stack: the arm ink law, the background and the cell-frame decay.19pub mod star;20/// The random 3d tiles flattened through their projections.21pub mod tile;22/// The pieces, holes and enclosed voids of a hex slice's fill.23pub mod topology;2425/// The triangle code for an empty site.26pub const VOID: u8 = 0;27/// The triangle code for a filled site.28pub const FILL: u8 = 1;29/// The triangle code for the backdrop outside the figure.30pub const GRID: u8 = 2;31/// The triangle code for a cube's top face in the iso view.32pub const UP: u8 = 3;33/// The triangle code for a cube's left face in the iso view.34pub const LEFT: u8 = 4;35/// The triangle code for a cube's right face in the iso view.36pub const RIGHT: u8 = 5;3738/// The two ways a hexagon can point.39#[derive(Clone, Copy, Debug, PartialEq, Eq)]40pub enum Orientation {41    /// The hexagon wider than it is tall.42    Horizontal,43    /// The hexagon taller than it is wide.44    Vertical,45}4647/// The three ways a cube flattens to a hexagon.48#[derive(Clone, Copy, Debug, PartialEq, Eq)]49pub enum Projection {50    /// The isometric view of top, left and right faces.51    Iso,52    /// The three-face view keeping each face's fills and voids.53    Pro,54    /// The hexagonal slice through the cube's center.55    Cut,56}5758pub use census::{census, euler, fills, fills_only, Census};59pub use designs::{cut_design, iso_design, pro_design};60pub use geometry::{61    blank, cut, framed, is_cube, is_hex, iso, orientation, pad, pro, radial, radial_crop,62    radial_mask, skin, tessellate, tile, tile_cell, tile_crop, tile_step,63};64pub use models::Cell6d;65pub use painter::paint;66pub use raster::raster;67pub use renderer::{hex_png, png, rect, rect_png, rect_svg, svg, triangles, Rect};68pub use serializer::{from_json, to_json};69pub use tile::{build as build_tile, random_tile, HexTile};70pub use topology::{components, giant, giant_network, holes, rim_holes, spectral_exponent};