Solver

Trait Solver 

Source
pub trait Solver {
    type Geometry: Geometry;
    type Boundary: Boundary;
    type Scalar;

    // Required methods
    fn solve(
        &self,
        geometries: &[Self::Geometry],
        boundary: &Self::Boundary,
    ) -> Result<SolveResult<Self::Scalar>>;
    fn solve_with_progress(
        &self,
        geometries: &[Self::Geometry],
        boundary: &Self::Boundary,
        callback: ProgressCallback,
    ) -> Result<SolveResult<Self::Scalar>>;
    fn cancel(&self);
}
Expand description

Trait for nesting/packing solvers.

Required Associated Types§

Source

type Geometry: Geometry

The geometry type this solver handles.

Source

type Boundary: Boundary

The boundary type this solver handles.

Source

type Scalar

The scalar type for coordinates.

Required Methods§

Source

fn solve( &self, geometries: &[Self::Geometry], boundary: &Self::Boundary, ) -> Result<SolveResult<Self::Scalar>>

Solves the nesting/packing problem.

Source

fn solve_with_progress( &self, geometries: &[Self::Geometry], boundary: &Self::Boundary, callback: ProgressCallback, ) -> Result<SolveResult<Self::Scalar>>

Solves with a progress callback.

Source

fn cancel(&self)

Cancels an ongoing solve operation.

Implementors§