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 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
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
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
Returns the unique identifier for this geometry.
Source§fn aabb_vec(&self) -> (Vec<f64>, Vec<f64>)
fn aabb_vec(&self) -> (Vec<f64>, Vec<f64>)
Returns the axis-aligned bounding box as Vec (for generic dimension support).
Source§fn rotation_constraint(&self) -> &RotationConstraint<f64>
fn rotation_constraint(&self) -> &RotationConstraint<f64>
Returns the allowed rotations for this geometry.
Source§fn aabb(&self) -> ([Self::Scalar; 2], [Self::Scalar; 2])
fn aabb(&self) -> ([Self::Scalar; 2], [Self::Scalar; 2])
Returns the axis-aligned bounding box as (min, max) corners.
Source§fn allow_mirror(&self) -> bool
fn allow_mirror(&self) -> bool
Returns whether mirroring/flipping is allowed.
Auto Trait Implementations§
impl Freeze for Geometry3D
impl RefUnwindSafe for Geometry3D
impl Send for Geometry3D
impl Sync for Geometry3D
impl Unpin 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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.