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>
24 lines
727 B
C#
24 lines
727 B
C#
using OpenNest.RectanglePacking;
|
|
using System.Collections.Generic;
|
|
|
|
namespace OpenNest.Engine.Strategies
|
|
{
|
|
public class RectBestFitStrategy : IFillStrategy
|
|
{
|
|
public string Name => "RectBestFit";
|
|
public NestPhase Phase => NestPhase.RectBestFit;
|
|
public int Order => 200;
|
|
|
|
public List<Part> Fill(FillContext context)
|
|
{
|
|
var binItem = BinConverter.ToItem(context.Item, context.Plate.PartSpacing);
|
|
var bin = BinConverter.CreateBin(context.WorkArea, context.Plate.PartSpacing);
|
|
|
|
var engine = new FillBestFit(bin);
|
|
engine.Fill(binItem);
|
|
|
|
return BinConverter.ToParts(bin, new List<NestItem> { context.Item });
|
|
}
|
|
}
|
|
}
|