feat: serialize and deserialize hole sub-programs in nest file format

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-09 14:40:13 -04:00
parent 4aed231611
commit df65414a9d
4 changed files with 178 additions and 4 deletions

View File

@@ -374,6 +374,8 @@ namespace OpenNest.IO
{
var p = 0;
var r = 0.0;
var x = 0.0;
var y = 0.0;
while (section == CodeSection.SubProgram)
{
@@ -395,13 +397,26 @@ namespace OpenNest.IO
r = double.Parse(code.Value);
break;
case 'X':
x = double.Parse(code.Value);
break;
case 'Y':
y = double.Parse(code.Value);
break;
default:
section = CodeSection.Unknown;
break;
}
}
program.Codes.Add(new SubProgramCall() { Id = p, Rotation = r });
program.Codes.Add(new SubProgramCall
{
Id = p,
Rotation = r,
Offset = new Geometry.Vector(x, y)
});
}
private Code GetNextCode()