1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//! # 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
//!
//! ```rust
//! 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);
//! # Ok::<(), u_nesting::core::Error>(())
//! ```
//!
//! ## Feature Flags
//!
//! - `d2` (default): 2D nesting algorithms
//! - `d3` (default): 3D bin packing algorithms
//! - `cutting`: cutting path optimization for a 2D layout
//! - `serde`: Serialization support
//! - `parallel`: 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, so
//! `rayon::ThreadPool::install` (or `RAYON_NUM_THREADS`) sets how many
//! threads it uses.
/// Core traits and abstractions.
pub use u_nesting_core as core;
/// 2D nesting algorithms.
pub use u_nesting_d2 as d2;
/// 3D bin packing algorithms.
pub use u_nesting_d3 as d3;
/// Cutting path optimization.
pub use u_nesting_cutting as cutting;
// Re-export commonly used types at root level
pub use ;
// The README's Rust examples are the first code most users copy, so they are
// compiled and run with the doc-tests. Without this they were checked by
// nothing.
;