This repository has been archived on 2026-09-29. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
OpenNest-Engines/README.md
T
aj 13478f5102 feat(rectangles): add rectangle-lane maximal-rectangles engine
Nests every part as the axis-aligned box of its material at its minimum-area
rotation and packs boxes with a maximal-rectangles free list (6 placement rules x
global/ordered pick). Sheet choice uses the salvage-credited look-ahead cost.

Curved extremes read the way the layout check sees them (circumscribed arcs on
the Clipper grid), so discs, rings and obrounds stay valid at box contact; an
80-job sweep failed 16-50 jobs before that rule.

Local 2026 production lanes (--min-salvage-dimension 12, --parallel 3):
- 91 all-rectangular jobs: 91/91 valid, cost 333081 vs best general 332153
  (Gpt6Astra, 89/91 valid), 5.9 s vs 13.7 s (Opus55) and 169.5 s (Gpt6Astra)
- 77 box-filling (>= 90%) jobs: 77/77 valid, lowest total cost 641637
2026-09-29 20:49:00 -04:00

65 lines
2.7 KiB
Markdown

# OpenNest Engines
Independent nesting engine plugins for [OpenNest](https://git.thecozycat.net/aj/OpenNest).
Each engine is a standalone class library that OpenNest discovers at runtime via
`NestingEngineRegistry.LoadPlugins()` — drop the DLL into an `Engines/` folder next to
the OpenNest app or `OpenNest.Benchmark` build output.
| Engine | Approach |
|--------|----------|
| [Gpt6Astra](OpenNest.Engine.Gpt6Astra/) | Contact-based placement |
| [Opus55](OpenNest.Engine.Opus55/) | Frontier-advance no-fit-polygon packing |
| [Qwen38FlashNext](OpenNest.Engine.Qwen38FlashNext/) | Bottom-left greedy insertion over convex NFPs with an exact clearance gate |
| [Rectangles](OpenNest.Engine.Rectangles/) | Rectangle lane: maximal-rectangles box packing for plain and near-rectangular parts |
## Building
Engines compile against an OpenNest checkout, expected as a sibling clone:
```
src/
OpenNest/ git clone https://git.thecozycat.net/aj/OpenNest.git
OpenNest-Engines/ this repo
```
Use a different location with `/p:OpenNestRoot=<path>` (or the `OpenNestRoot`
environment variable).
```powershell
./Build-Engines.ps1 # build all engines + deploy to the benchmark
./Build-Engines.ps1 -Engines Opus55 # just one
dotnet test OpenNest.Engine.Opus55/tests/OpenNest.Engine.Opus55.Tests.csproj
```
Each engine's README covers its algorithm and benchmark results.
`Engine.Testing/` contains shared xUnit contract tests, shapes, job builders and layout
assertions backed by `NestLayoutCheck`. It is a test dependency, not a plugin;
`Build-Engines.ps1` only deploys projects in `OpenNest.Engine.*` directories. All engines
require the shared-services APIs in the sibling host checkout. See
[the PR 5 migration report](MIGRATION-PR5.md) for validation and benchmark results.
## Writing a new engine
```powershell
./New-Engine.ps1 -Name Nova
```
This copies `_Template/` to `OpenNest.Engine.Nova/`: an `INestingEngine` stub, a README
spelling out what counts as an independent engine, `BENCH-RULES.md` (how a model's run
works: workspace limits, git, the real-part archive, reporting), and starter acceptance tests checked by
the shared `NestLayoutCheck` (they fail until `Solve()` is implemented).
To work inside an OpenNest checkout instead, stamp it into an `Engines/` folder there and
bring the shared build files and test kit along; they detect that layout automatically:
```powershell
./New-Engine.ps1 -Name Nova -Destination <OpenNest>/Engines -IncludeBuildFiles
```
## Layout
Each engine lives in `OpenNest.Engine.<Name>/` with an optional `tests/` subproject.
`Directory.Build.props` supplies the target framework and the `OpenNest.Engine`
reference, so an engine's `.csproj` can be nearly empty.