fix(sequencing): snapshot plates before sequencing the entire nest

This commit is contained in:
aj
2026-09-29 12:23:19 -04:00
parent 662bc133b1
commit 7d179c696a
4 changed files with 132 additions and 3 deletions
@@ -9,6 +9,16 @@ namespace OpenNest.Engine.Sequencing
/// <summary>Applies a sequencer's exit-first route as the plate's cutting order.</summary>
public static class PlateSequencing
{
/// <summary>Sequences the plates present when the operation starts.</summary>
public static void ApplyAll(IEnumerable<Plate> plates, SequenceParameters parameters)
{
// Reordering parts can make PlateManager replace the trailing empty
// plate. Snapshot before applying so those events cannot invalidate
// enumeration of the nest's live plate collection.
foreach (var plate in plates.ToArray())
Apply(plate, parameters);
}
public static void Apply(Plate plate, SequenceParameters parameters)
{
var sequencer = PartSequencerFactory.Create(parameters);