PairFiller now returns PairFillResult (Parts + BestFits) instead of using a mutable BestFits property. Extracted EvaluateCandidates, TryReduceWorkArea, and BuildTilingAngles for clarity. Simplified the candidate loop by leveraging FillScore comparison semantics. Removed FillRemainingStrip and all its helpers (FindPlacedEdge, BuildRemainingStrip, BuildRotationSet, FindBestFill, TryFewerRows, RemainderPatterns) from FillLinear — these were a major bottleneck in strip nesting, running expensive fills on undersized remnant strips. ShrinkFiller + RemnantFiller already handle space optimization, making the remainder strip fill redundant. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
24 lines
689 B
C#
24 lines
689 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 filler = new PairFiller(context.Plate.Size, context.Plate.PartSpacing);
|
|
var result = filler.Fill(context.Item, context.WorkArea,
|
|
context.PlateNumber, context.Token, context.Progress);
|
|
|
|
context.SharedState["BestFits"] = result.BestFits;
|
|
|
|
return result.Parts;
|
|
}
|
|
}
|
|
}
|