rectangle_pack/
box_size_heuristics.rs

1use crate::WidthHeightDepth;
2
3/// Incoming boxes are places into the smallest hole that will fit them.
4///
5/// "small" vs. "large" is based on the heuristic function.
6///
7/// A larger heuristic means that the box is larger.
8pub type BoxSizeHeuristicFn = dyn Fn(WidthHeightDepth) -> u128;
9
10/// The volume of the box
11pub fn volume_heuristic(whd: WidthHeightDepth) -> u128 {
12    whd.width as u128 * whd.height as u128 * whd.depth as u128
13}