namespace CutList.Core.Nesting { /// /// Immutable configuration object for a bin packing operation. /// Replaces mutable engine state with a clean request/response pattern. /// public sealed class PackingRequest { /// /// Creates a new packing request. /// /// The items to be packed. /// The length of stock bins. /// The spacing/kerf between items (default 0). /// Maximum number of bins to create (default unlimited). public PackingRequest( IReadOnlyList items, double stockLength, double spacing = 0, int maxBinCount = int.MaxValue) { if (stockLength <= 0) throw new ArgumentException("Stock length must be greater than 0", nameof(stockLength)); Items = items ?? throw new ArgumentNullException(nameof(items)); StockLength = stockLength; Spacing = spacing; MaxBinCount = maxBinCount; } /// /// The items to be packed into bins. /// public IReadOnlyList Items { get; } /// /// The length of each stock bin. /// public double StockLength { get; } /// /// The spacing/kerf between items (blade width). /// public double Spacing { get; } /// /// Maximum number of bins to create. Use int.MaxValue for unlimited. /// public int MaxBinCount { get; } } }