mod.rs
1.7 kB · rust · 46 lines
1/// The fill, void, volume, surface and Euler counts of a cube.2pub mod census;3/// The builders of coded, corner, noise and carpet cubes.4pub mod designs;5/// The diagonal slices of a cube: their profile, their cells, their projection and their drawing.6pub mod diagonal;7/// The exposed quads and wire edges of a cube.8pub mod faces;9/// The orientations, merges, masked mosaics, slices and lifts of cubes.10pub mod geometry;11/// The JSON form of a cube.12pub mod serializer;13/// The random tiles and the cubes they build.14pub mod tile;1516pub use crate::math::dim::graph::{core_graph, edge_graph, tunnel_graph};17pub use crate::math::dim::models::Cell3d;18pub use crate::math::dim::paint;19pub use census::{census, euler, fills, hidden, Census};20pub use designs::{21 carpet, create, dust, from_corners, level_set, levels_code, named, net, ones, point, star,22 void, xline, xtree, yline, ytree, zeros, zline, ztree,23};24pub use diagonal::{25 profile, project, shadow, slice as diagonal_slice, support, svg as diagonal_svg,26};27pub use faces::{quads, wires, Quad};28pub use geometry::{extrude, magic, manhattan_layers, merge, mosaic, orientations, slice, special};29pub use serializer::{from_json, to_json};30pub use tile::{build, create as create_tile, random_tile};3132#[cfg(test)]33mod tests {34 use super::*;35 #[test]36 fn menger_graphs() {37 let cell = designs::carpet(3, 1).unwrap();38 let core = core_graph(&cell).unwrap();39 assert_eq!(core.nodes.len(), 20);40 let edges = edge_graph(&designs::ones(1, 1).unwrap()).unwrap();41 assert_eq!(edges.nodes.len(), 8);42 assert_eq!(edges.branches.len(), 12);43 let tunnels = tunnel_graph(&cell).unwrap();44 assert_eq!(tunnels.nodes.len(), 7);45 }46}