feat: add remnant filling to PairFiller for better part density

PairFiller previously only filled the main grid with pair patterns,
leaving narrow waste strips unfilled. Row/Column strategies filled
their remnants, winning on count despite worse base grids.

Now PairFiller evaluates grid+remnant together for each angle/direction
combination, picking the best total. Uses a two-phase approach: fast
grid evaluation first, then remnant filling only for grids within
striking distance of the current best. Remnant results are cached
via FillResultCache.

Constructor now takes Plate (needed to create remnant engine).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-21 15:19:19 -04:00
parent 560105f952
commit 00e7866506
3 changed files with 147 additions and 14 deletions
@@ -12,7 +12,7 @@ namespace OpenNest.Engine.Strategies
public List<Part> Fill(FillContext context)
{
var comparer = context.Policy?.Comparer;
var filler = new PairFiller(context.Plate.Size, context.Plate.PartSpacing, comparer);
var filler = new PairFiller(context.Plate, comparer);
var result = filler.Fill(context.Item, context.WorkArea,
context.PlateNumber, context.Token, context.Progress);