fix(engine): move progress reporting from inner fills to ShrinkFiller
StripNestEngine was passing progress directly to DefaultNestEngine.Fill inside the ShrinkFiller loop, causing every per-angle/per-strategy report to update the UI with overlapping layouts in the same work area. Now inner fills are silent (null progress) and ShrinkFiller reports its own progress when the best layout improves. IterativeShrinkFiller tracks placed parts across items and includes them in reports. The trial box is reported before the fill starts so the work area border updates immediately. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -77,14 +77,17 @@ namespace OpenNest
|
||||
// Phase 1: Iterative shrink-fill for multi-quantity items.
|
||||
if (fillItems.Count > 0)
|
||||
{
|
||||
// Inner fills are silent — ShrinkFiller manages progress reporting
|
||||
// to avoid overlapping layouts from per-angle/per-strategy reports.
|
||||
Func<NestItem, Box, List<Part>> fillFunc = (ni, b) =>
|
||||
{
|
||||
var inner = new DefaultNestEngine(Plate);
|
||||
return inner.Fill(ni, b, progress, token);
|
||||
return inner.Fill(ni, b, null, token);
|
||||
};
|
||||
|
||||
var shrinkResult = IterativeShrinkFiller.Fill(
|
||||
fillItems, workArea, fillFunc, Plate.PartSpacing, token);
|
||||
fillItems, workArea, fillFunc, Plate.PartSpacing, token,
|
||||
progress, PlateNumber);
|
||||
|
||||
allParts.AddRange(shrinkResult.Parts);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user