Expand description
§U-Nesting
Domain-agnostic 2D/3D spatial optimization engine.
This crate provides algorithms for:
- 2D Nesting: Polygon placement optimization (cutting, packing)
- 3D Bin Packing: Box placement in containers
§Quick Start
use u_nesting::d2::{Boundary2D, Geometry2D, Nester2D};
use u_nesting::{Config, Solver, Strategy};
let geometries = vec![Geometry2D::rectangle("plate", 100.0, 50.0).with_quantity(4)];
let boundary = Boundary2D::rectangle(1000.0, 500.0);
let config = Config::new().with_strategy(Strategy::NfpGuided);
let result = Nester2D::new(config).solve(&geometries, &boundary)?;
assert_eq!(result.placements.len(), 4);§Feature Flags
d2(default): 2D nesting algorithmsd3(default): 3D bin packing algorithmscutting: cutting path optimization for a 2D layoutserde: Serialization supportparallel: evaluates a search’s population (GA, BRKGA) and computes no-fit polygons on rayon’s thread pool. Without it every solve runs on the calling thread. The solve uses the pool it is called from, sorayon::ThreadPool::install(orRAYON_NUM_THREADS) sets how many threads it uses.
Re-exports§
pub use u_nesting_core as core;pub use u_nesting_d2 as d2;pub use u_nesting_d3 as d3;
Structs§
- Config
- Common configuration for solvers.
- Placement
- Represents the placement of a geometry within a boundary.
- Solve
Result - Result of a nesting or packing solve operation.
Enums§
- Stop
Reason - Why a solve stopped – the same vocabulary every runner in
u-metaheurreports, so a nesting run and any other search say it in one set of words. Each strategy here sets it where it stops;Completedis a fill that tried every piece, or a search that spent the budget it is given internally. Why a run stopped: the run’s own account of the solution it returns. - Strategy
- Optimization strategy.
Traits§
- Solver
- Trait for nesting/packing solvers.