fix(core): keep cut-offs in their cut sequence through regenerate and save

A cut-off's place in Plate.Parts is its cut sequence number, but
RegenerateCutOffs removed every cut-off part and appended it again, so
any part drag, fill or cut-off move sent the cut-offs to the end. The
nest file didn't store the position either, so reopening did the same.

RegenerateCutOffs now puts each cut-off back at its previous index (new
cut-offs go at the end), and CutOffDto.Sequence saves the index. Older
files without it load the cut-offs at the end, as before.
This commit is contained in:
aj
2026-09-28 18:44:04 -04:00
parent 6803d7519f
commit 4da48eed68
6 changed files with 182 additions and 7 deletions
+6
View File
@@ -87,6 +87,12 @@ namespace OpenNest.IO
public string Axis { get; init; } = "vertical";
public double? StartLimit { get; init; }
public double? EndLimit { get; init; }
/// <summary>
/// Zero-based place in the plate's cut sequence (<c>Plate.Parts</c> order,
/// cut-offs included). Null in older files, which load it at the end.
/// </summary>
public int? Sequence { get; init; }
}
public record SizeDto