binpack_3d/corners.rs
1use serde::{
2 Deserialize,
3 Serialize,
4};
5
6use crate::vector::Vector3;
7
8/// A item corner
9#[derive(Debug, Clone, Hash, PartialEq, Eq, Serialize, Deserialize)]
10pub struct Corners {
11 /// The Position of a Item
12 pub position: Vector3<u32>,
13}
14
15impl Corners {
16 /// Creates a new corner
17 pub const fn new(x: u32, y: u32, z: u32) -> Self {
18 // Self { x, y, z }
19 Self {
20 position: Vector3::new(x, y, z),
21 }
22 }
23}
24impl From<Vector3<u32>> for Corners {
25 fn from(value: Vector3<u32>) -> Self {
26 Self { position: value }
27 }
28}