macro_rules! define_xyz_dimension_range {
($name:ident, $var_type:ty, $coordinate_type:ty, $friendly_name:expr, $doc:expr) => { ... };
}Expand description
Creates a 3D dimension range type for spatial bounds checking.
ยงExample
use feagi_structures::{define_xyz_dimensions, define_xyz_dimension_range, FeagiDataError};
define_xyz_dimensions!(Position3D, u32, "Position3D", 0, "3D position coordinates");
define_xyz_dimension_range!(BoundingBox3D, u32, Position3D, "BoundingBox3D", "3D bounding box for spatial queries");
let bounds = BoundingBox3D::new(0..10, 0..20, 0..30).unwrap();
let pos = Position3D::new(5, 15, 25).unwrap();
assert!(bounds.verify_coordinate_within_range(&pos).is_ok());
let out_of_bounds = Position3D::new(15, 15, 25).unwrap();
assert!(bounds.verify_coordinate_within_range(&out_of_bounds).is_err());