pub struct Geometry3D { /* private fields */ }Expand description
A 3D box geometry that can be packed.
Implementations§
Source§impl Geometry3D
impl Geometry3D
Sourcepub fn new(
id: impl Into<GeometryId>,
width: f64,
depth: f64,
height: f64,
) -> Self
pub fn new( id: impl Into<GeometryId>, width: f64, depth: f64, height: f64, ) -> Self
Creates a new 3D box geometry with the given ID and dimensions.
Sourcepub fn box_shape(
id: impl Into<GeometryId>,
width: f64,
depth: f64,
height: f64,
) -> Self
pub fn box_shape( id: impl Into<GeometryId>, width: f64, depth: f64, height: f64, ) -> Self
Alias for creating a box shape.
Sourcepub fn with_quantity(self, n: usize) -> Self
pub fn with_quantity(self, n: usize) -> Self
Sets the quantity to place.
Sourcepub fn with_orientation(self, constraint: OrientationConstraint) -> Self
pub fn with_orientation(self, constraint: OrientationConstraint) -> Self
Sets the orientation constraint.
Sourcepub fn with_stackable(self, stackable: bool) -> Self
pub fn with_stackable(self, stackable: bool) -> Self
Sets whether items can be stacked on top.
Sourcepub fn with_max_stack_weight(self, weight: f64) -> Self
pub fn with_max_stack_weight(self, weight: f64) -> Self
Sets the maximum weight that can be stacked on top.
Sourcepub fn dimensions(&self) -> &Vector3<f64>
pub fn dimensions(&self) -> &Vector3<f64>
Returns the dimensions (width, depth, height).
Sourcepub fn orientation_constraint(&self) -> OrientationConstraint
pub fn orientation_constraint(&self) -> OrientationConstraint
Returns the orientation constraint.
Sourcepub fn is_stackable(&self) -> bool
pub fn is_stackable(&self) -> bool
Returns whether items can be stacked on top.
Sourcepub fn allowed_orientations(&self) -> Vec<(usize, usize, usize)>
pub fn allowed_orientations(&self) -> Vec<(usize, usize, usize)>
Returns the allowed orientations based on the constraint. Each orientation is (width_axis, depth_axis, height_axis).
Sourcepub fn orientation_label(&self, orientation: usize) -> String
pub fn orientation_label(&self, orientation: usize) -> String
Returns the orientation label for a given orientation index, as an
axis-permutation string (e.g. "xyz", "xzy").
The permutation (x_idx, y_idx, z_idx) from allowed_orientations
is mapped to the axis letters x/y/z. Out-of-range indices fall
back to the identity orientation "xyz".
Sourcepub fn dimensions_for_orientation(&self, orientation: usize) -> Vector3<f64>
pub fn dimensions_for_orientation(&self, orientation: usize) -> Vector3<f64>
Returns dimensions for a given orientation index.
Trait Implementations§
Source§impl Clone for Geometry3D
impl Clone for Geometry3D
Source§fn clone(&self) -> Geometry3D
fn clone(&self) -> Geometry3D
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Geometry3D
impl Debug for Geometry3D
Source§impl Geometry for Geometry3D
impl Geometry for Geometry3D
Source§fn id(&self) -> &GeometryId
fn id(&self) -> &GeometryId
Source§fn aabb_vec(&self) -> (Vec<f64>, Vec<f64>)
fn aabb_vec(&self) -> (Vec<f64>, Vec<f64>)
Source§fn rotation_constraint(&self) -> &RotationConstraint<f64>
fn rotation_constraint(&self) -> &RotationConstraint<f64>
Source§fn aabb(&self) -> ([Self::Scalar; 2], [Self::Scalar; 2])
fn aabb(&self) -> ([Self::Scalar; 2], [Self::Scalar; 2])
Source§fn allow_mirror(&self) -> bool
fn allow_mirror(&self) -> bool
Auto Trait Implementations§
impl Freeze for Geometry3D
impl RefUnwindSafe for Geometry3D
impl Send for Geometry3D
impl Sync for Geometry3D
impl Unpin for Geometry3D
impl UnsafeUnpin for Geometry3D
impl UnwindSafe for Geometry3D
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.