U-Nesting Core
Core traits and abstractions for the U-Nesting spatial optimization engine.
This crate provides the foundational types and traits that are shared between the 2D nesting and 3D bin packing modules.
Core Components
- Geometry traits: [
Geometry], [Geometry2DExt], [Geometry3DExt] - Boundary traits: [
Boundary], [Boundary2DExt], [Boundary3DExt] - Solver trait: [
Solver] - Common interface for all optimization algorithms - GA framework: [
GaRunner], [GaProblem] - Genetic algorithm infrastructure - BRKGA framework: [
BrkgaRunner], [BrkgaProblem] - Biased Random-Key GA - SA framework: [
SaRunner], [SaProblem] - Simulated Annealing - Transform types: [
Transform2D], [Transform3D], [AABB2D], [AABB3D]
Optimization Strategies
The [Strategy] enum defines available optimization algorithms:
| Strategy | Speed | Quality | Description |
|---|---|---|---|
BottomLeftFill |
Fast | Basic | Greedy bottom-left placement |
NfpGuided |
Medium | Good | NFP-based optimal positioning (2D) |
GeneticAlgorithm |
Slow | High | GA with permutation encoding |
Brkga |
Medium | High | Biased Random-Key GA |
SimulatedAnnealing |
Medium | High | Temperature-based optimization |
ExtremePoint |
Fast | Good | EP heuristic (3D only) |
Configuration
Use [Config] to configure solver behavior:
use ;
let config = new
.with_strategy
.with_spacing
.with_margin
.with_time_limit;
Feature Flags
serde: Enable serialization/deserialization support