pub struct Bin {
pub id: usize,
pub outer: Arc<SimplePolygon>,
pub value: u64,
pub pretransform: Transformation,
pub holes: Vec<Arc<SimplePolygon>>,
pub quality_zones: [Option<InferiorQualityZone>; 10],
pub base_cde: Arc<CDEngine>,
pub area: fsize,
}
Expand description
A container in which items can be placed.
Fields§
§id: usize
§outer: Arc<SimplePolygon>
The contour of the bin
value: u64
The cost of using the bin
pretransform: Transformation
Transformation applied to the shape with respect to the original shape in the input file (for example to center it).
holes: Vec<Arc<SimplePolygon>>
Shapes of holes/defects in the bins, if any
quality_zones: [Option<InferiorQualityZone>; 10]
Zones of different qualities in the bin, stored per quality.
base_cde: Arc<CDEngine>
The starting state of the CDEngine
for this bin.
area: fsize
Implementations§
Source§impl Bin
impl Bin
pub fn new( id: usize, outer: SimplePolygon, value: u64, pretransform: Transformation, holes: Vec<SimplePolygon>, quality_zones: Vec<InferiorQualityZone>, cde_config: CDEConfig, ) -> Self
Sourcepub fn from_strip(rect: AARectangle, cde_config: CDEConfig) -> Self
pub fn from_strip(rect: AARectangle, cde_config: CDEConfig) -> Self
Create a new Bin
for a strip-packing problem. Instead of a shape, the bin is always rectangular.
pub fn bbox(&self) -> AARectangle
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Bin
impl RefUnwindSafe for Bin
impl Send for Bin
impl Sync for Bin
impl Unpin for Bin
impl UnwindSafe for Bin
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 more