Reusable Fill/, BestFit, RectanglePacking and CirclePacking components are fair game; whole-engine delegation and run-all-pick-best stay banned. Improvements to shared components go in the engine's own project and are reported, not applied to OpenNest.Core/OpenNest.Engine. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
71 lines
3.3 KiB
Markdown
71 lines
3.3 KiB
Markdown
# OpenNest.Engine.Qwen
|
|
|
|
An independent `INestingEngine` implementation. It must not be a wrapper, ensemble, or
|
|
selector over OpenNest's built-in engines. `Solve()` must not call, instantiate, or
|
|
delegate to any existing `INestingEngine` (`StockLadderNestingEngine`,
|
|
`FixedStrategyNestingEngine`), `NestingEngineRegistry`, `NestJobRunner`, or the whole-plate
|
|
nesters/fillers behind `PlateNesterFactory` (`DefaultPlateNester`, `StripPlateNester`,
|
|
`RemnantPlateNester`, `PlateFillService`, `DefaultPlateFiller`, ...). It must also never run
|
|
several of them and keep the best result.
|
|
|
|
The decisions that make it an engine must be yours: which sheet(s) to use, which parts go
|
|
where and in what order, which pattern/strategy to apply to which region, and when to stop.
|
|
|
|
## Allowed building blocks
|
|
|
|
Reuse is encouraged. These are tools you drive, composed by your own decision logic:
|
|
|
|
- `OpenNest.Core` geometry: `Polygon`, `Shape`, `BoundingBox`, `Vector`, `Box`, `ConvexHull`,
|
|
`ConvexDecomposition`, `RotatingCalipers`, `Collision`, `NoFitPolygon`, `ShapeProfile`,
|
|
`SpatialQuery`.
|
|
- Fill and pattern components in `OpenNest.Engine.Fill`: `FillLinear`, `FillExtents`,
|
|
`PairFiller`, `ShrinkFiller`, `RemnantFiller`/`RemnantFinder`, `Compactor`, `FillScore`,
|
|
`Pattern`/`PatternTiler`, `PartBoundary`, `RotationAnalysis`, `AngleCandidateBuilder`,
|
|
`BestCombination`.
|
|
- `OpenNest.Engine.BestFit` (`BestFitFinder`, `PairEvaluator`, ...), `RectanglePacking`,
|
|
`CirclePacking`.
|
|
|
|
If you find a faster or better way to do something a shared component already does (for
|
|
example linear patterning), implement it inside this engine's own project and leave the
|
|
shared code untouched. Do not edit `OpenNest.Core` or `OpenNest.Engine`. Call it out in your
|
|
report (what it replaces, why it is better, measured numbers) so it can be generalized and
|
|
upstreamed for every engine later.
|
|
|
|
## What to fill in
|
|
|
|
`QwenNestingEngine.cs` — implement `Solve()`. Pick and document an actual
|
|
placement strategy (NFP-based sliding placement, skyline/shelf packer,
|
|
simulated-annealing/genetic layout search, guillotine-cut packer,
|
|
physics/gravity-settling, etc). It's fine to be simpler or worse than the built-in
|
|
engines to start; it must not be the same algorithm re-derived through indirection.
|
|
|
|
## Build
|
|
|
|
```bash
|
|
dotnet build Engines/OpenNest.Engine.Qwen/OpenNest.Engine.Qwen.csproj
|
|
```
|
|
|
|
This project is intentionally **outside** `OpenNest.sln` (same pattern as the
|
|
`OpenNest.Engine.Aurora` plugin) — it's discovered at runtime as a plugin, not built
|
|
as part of the main solution.
|
|
|
|
## Try it out with the benchmark
|
|
|
|
`OpenNest.Benchmark` auto-loads plugin engines from an `Engines/` folder next to its
|
|
own build output:
|
|
|
|
```bash
|
|
dotnet build Engines/OpenNest.Engine.Qwen/OpenNest.Engine.Qwen.csproj -c Release
|
|
dotnet build OpenNest.Benchmark/OpenNest.Benchmark.csproj -c Release
|
|
|
|
mkdir -p OpenNest.Benchmark/bin/Release/net8.0/Engines
|
|
cp Engines/OpenNest.Engine.Qwen/bin/Release/net8.0/OpenNest.Engine.Qwen.dll OpenNest.Benchmark/bin/Release/net8.0/Engines/
|
|
|
|
dotnet OpenNest.Benchmark/bin/Release/net8.0/OpenNest.Benchmark.dll <path-to-.nest-or-folder>
|
|
```
|
|
|
|
Or build and deploy in one step with `./Engines/Build-Engines.ps1 -Engines Qwen`.
|
|
|
|
Your engine will show up in the report under its CLR type name (`QwenNestingEngine`),
|
|
competing on equal footing against the built-in engines.
|