using System; using System.Threading; using OpenNest.Engine.Jobs; namespace OpenNest.Engine.__NAME__; /// /// TODO: name and describe the actual placement strategy here (e.g. "skyline packer with /// greedy shelf assignment", "NFP-based sliding placement with simulated-annealing order /// search", etc). This must be an independently designed algorithm — see README.md. /// public sealed class __NAME__NestingEngine : INestingEngine { public NestJobResult Solve( NestJob job, IProgress? progress = null, CancellationToken token = default ) { ArgumentNullException.ThrowIfNull(job); token.ThrowIfCancellationRequested(); // TODO: implement independent placement logic here. // // Do NOT call NestingEngineRegistry.Create(...), PlateNesterFactory, PlateFillService, // or any built-in INestingEngine, and do not run several and keep the best. The // Fill/ and pattern components (FillLinear, PairFiller, PatternTiler, Compactor, ...) // and OpenNest.Core geometry ARE fair game as tools; the decisions are yours. // // job.Parts -> requested parts (PartGeometrySnapshot geometry, quantity, priority, rotation policy) // job.Plates -> candidate stock sheets (size, spacing, edge spacing, quadrant, quantity) // job.Options -> job-wide options // // Read material with JobPartGeometry.TryRead(part.Geometry); use stock.WorkArea/Fits, // RotationCandidates.ForShape and NestJobCost as primitives for your own decisions. // var result = new NestJobResultBuilder(job, progress); // result.AddSheet(stock, poses); // (PartId, X, Y, Rotation); call only on commit. // return result.Build(NestJobStopReason.NoPlacementFound); // The builder assigns sheet/instance indices, fulfillment, usage and commit progress. throw new NotImplementedException("__NAME__ nesting engine placement logic not yet implemented."); } }