Move fill algorithms to OpenNest.Engine.Fill namespace: FillLinear, FillExtents, PairFiller, ShrinkFiller, Compactor, RemnantFiller, RemnantFinder, FillScore, Pattern, PatternTiler, PartBoundary, RotationAnalysis, AngleCandidateBuilder, and AccumulatingProgress. Move strategy layer to OpenNest.Engine.Strategies namespace: IFillStrategy, FillContext, FillStrategyRegistry, FillHelpers, and all built-in strategy implementations. Add using directives to all consuming files across Engine, UI, MCP, and Tests projects. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
29 lines
976 B
C#
29 lines
976 B
C#
using OpenNest.Engine.BestFit;
|
|
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 filler = new PairFiller(context.Plate.Size, context.Plate.PartSpacing);
|
|
var result = filler.Fill(context.Item, context.WorkArea,
|
|
context.PlateNumber, context.Token, context.Progress);
|
|
|
|
// Cache hit — PairFiller already called GetOrCompute internally.
|
|
var bestFits = BestFitCache.GetOrCompute(
|
|
context.Item.Drawing, context.Plate.Size.Length,
|
|
context.Plate.Size.Width, context.Plate.PartSpacing);
|
|
context.SharedState["BestFits"] = bestFits;
|
|
|
|
return result;
|
|
}
|
|
}
|
|
}
|