use super::graph::edge_graph; use super::models::CellNd; use mrlycore::errors::Result; use mrlynum::census::{count, exposed}; /// Counts the filled sites of the cell. pub fn fills(cell: &CellNd) -> usize { count(cell.types(), 1) } /// Counts the empty sites of the cell. pub fn voids(cell: &CellNd) -> usize { count(cell.types(), 0) } /// Counts the faces of filled sites open to emptiness or the border. pub fn exposure(cell: &CellNd) -> u128 { exposed(cell.types()) } /// Counts the distinct corners the filled sites touch, the edge graph's nodes. pub fn vertices(cell: &CellNd) -> Result { Ok(edge_graph(cell)?.nodes.len()) } /// Counts the distinct unit edges the filled sites carry, the edge graph's branches. pub fn edges(cell: &CellNd) -> Result { Ok(edge_graph(cell)?.branches.len()) }