- Evaluate pair candidates in parallel batches instead of sequentially - Add GridDedup to skip duplicate pattern/direction/workArea combos across PairFiller and StripeFiller strategies - Replace crude 30% remnant area estimate with L-shaped geometry calculation using actual grid extents and max utilization - Move FillStrategyRegistry.SetEnabled to outer evaluation loop to avoid repeated enable/disable per remnant fill Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
26 lines
795 B
C#
26 lines
795 B
C#
using OpenNest.Engine.Fill;
|
|
using System.Collections.Generic;
|
|
|
|
namespace OpenNest.Engine.Strategies
|
|
{
|
|
public class PairsFillStrategy : IFillStrategy
|
|
{
|
|
public string Name => "Pairs";
|
|
public NestPhase Phase => NestPhase.Pairs;
|
|
public int Order => 100;
|
|
|
|
public List<Part> Fill(FillContext context)
|
|
{
|
|
var comparer = context.Policy?.Comparer;
|
|
var dedup = GridDedup.GetOrCreate(context.SharedState);
|
|
var filler = new PairFiller(context.Plate, comparer, dedup);
|
|
var result = filler.Fill(context.Item, context.WorkArea,
|
|
context.PlateNumber, context.Token, context.Progress);
|
|
|
|
context.SharedState["BestFits"] = result.BestFits;
|
|
|
|
return result.Parts;
|
|
}
|
|
}
|
|
}
|