pub struct Nester2D { /* private fields */ }Expand description
2D nesting solver.
Implementations§
Source§impl Nester2D
impl Nester2D
Sourcepub fn default_config() -> Self
pub fn default_config() -> Self
Creates a nester with default configuration.
Sourcepub fn solve_multi_strip(
&self,
geometries: &[Geometry2D],
boundary: &Boundary2D,
) -> Result<SolveResult<f64>>
pub fn solve_multi_strip( &self, geometries: &[Geometry2D], boundary: &Boundary2D, ) -> Result<SolveResult<f64>>
Solves nesting with automatic multi-strip support.
When items don’t fit in a single strip, automatically creates additional strips.
Each placement’s boundary_index indicates which strip it belongs to.
Positions are adjusted so that strip N items have x offset of N * strip_width.
Trait Implementations§
Source§impl Solver for Nester2D
impl Solver for Nester2D
Source§type Geometry = Geometry2D
type Geometry = Geometry2D
The geometry type this solver handles.
Source§type Boundary = Boundary2D
type Boundary = Boundary2D
The boundary type this solver handles.
Source§fn solve(
&self,
geometries: &[Self::Geometry],
boundary: &Self::Boundary,
) -> Result<SolveResult<f64>>
fn solve( &self, geometries: &[Self::Geometry], boundary: &Self::Boundary, ) -> Result<SolveResult<f64>>
Solves the nesting/packing problem.
Source§fn solve_with_progress(
&self,
geometries: &[Self::Geometry],
boundary: &Self::Boundary,
callback: ProgressCallback,
) -> Result<SolveResult<f64>>
fn solve_with_progress( &self, geometries: &[Self::Geometry], boundary: &Self::Boundary, callback: ProgressCallback, ) -> Result<SolveResult<f64>>
Solves with a progress callback.
Auto Trait Implementations§
impl !Freeze for Nester2D
impl RefUnwindSafe for Nester2D
impl Send for Nester2D
impl Sync for Nester2D
impl Unpin for Nester2D
impl UnwindSafe for Nester2D
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> 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.