fix(engine): isolate job identity and engine selection

Replace name-based quantity deduction with reference-based drawing
identity in the engine paths the whole-job runner reaches
(NestEngineBase fill/pack, StripNestEngine deduction, RemnantFiller
ledger, IterativeShrinkFiller leftovers). Add instance-scoped
PlateNesterFactory that resolves built-in strategies without touching
the global NestEngineRegistry. Add identity and engine-selection tests.

44 net8.0 tests pass in Debug and Release; no new warnings.
This commit is contained in:
aj
2026-09-17 15:35:59 -04:00
parent 0963b051be
commit 5b88d85937
8 changed files with 279 additions and 22 deletions
+3 -2
View File
@@ -128,13 +128,14 @@ namespace OpenNest
}
}
// Deduct placed quantities from original items.
// Deduct placed quantities from original items by drawing reference.
foreach (var item in items)
{
if (item.Quantity <= 0)
continue;
var placed = allParts.Count(p => p.BaseDrawing.Name == item.Drawing.Name);
var placed = allParts.Count(p =>
ReferenceEquals(p.BaseDrawing, item.Drawing));
item.Quantity = System.Math.Max(0, item.Quantity - placed);
}