feat: serialize/deserialize cut-off definitions in nest file format

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-22 19:40:01 -04:00
parent d58a446eac
commit 2f19f47a85
4 changed files with 164 additions and 2 deletions

View File

@@ -197,6 +197,25 @@ namespace OpenNest.IO
plate.Parts.Add(part);
}
// Cut-offs
if (p.CutOffs != null)
{
foreach (var cutoffDto in p.CutOffs)
{
var axis = cutoffDto.Axis?.ToLowerInvariant() == "horizontal"
? CutOffAxis.Horizontal
: CutOffAxis.Vertical;
var cutoff = new CutOff(new Vector(cutoffDto.X, cutoffDto.Y), axis)
{
StartLimit = cutoffDto.StartLimit,
EndLimit = cutoffDto.EndLimit
};
plate.CutOffs.Add(cutoff);
}
plate.RegenerateCutOffs(new CutOffSettings());
}
nest.Plates.Add(plate);
}