fix(post): post sheet cut-offs in CI Fiber without comp or lead-in

Posting a nest with a sheet cut-off threw because the CI Fiber writer
treated every contour as a compensated part contour and requires a
linear lead-in after G41/G42 (TF5200 13.2.4.1). Cut-offs are open
centreline cuts with no lead-in and no inside/outside, so they now post
without G41/G42 and run after every part on the sheet so the sheet is
not severed before the parts are cut (matching the CL post).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
aj
2026-09-28 14:14:07 -04:00
co-authored by Claude Opus 5.5
parent 6d7c98ef4a
commit b0997f614b
3 changed files with 80 additions and 2 deletions
@@ -222,6 +222,35 @@ public class CIFiberPostProcessorTests
Assert.Contains("13.2.4.1", ex.Message);
}
[Fact]
public void Post_CutOff_PostsLastWithoutCompensationOrLeadIn()
{
var nest = MakeSquareWithHoleNest();
var plate = nest.Plates[0];
// Vertical cut-off at X=20: a bare rapid + line, no lead-in.
var cutOff = new CutOff(new Vector(20, 0), CutOffAxis.Vertical);
cutOff.Regenerate(plate, new CutOffSettings());
plate.Parts.Insert(0, new Part(cutOff.Drawing, Vector.Zero));
var lines = Lines(Post(nest));
// Cut-off follows the real part despite being first in plate order.
var partEnd = lines.IndexOf("( PART END )");
var cutOffPart = lines.IndexOf("( Part #2 )");
Assert.True(partEnd >= 0 && cutOffPart > partEnd);
var n3 = lines.IndexOf("N3:");
Assert.True(n3 > cutOffPart);
Assert.Equal("/L \"L0\"", lines[n3 + 1]);
Assert.Equal("V.E.R3=3", lines[n3 + 2]);
Assert.StartsWith("G0X20Y", lines[n3 + 3]);
Assert.Equal("/L \"L4\"", lines[n3 + 4]);
Assert.Equal("/L \"L6\"", lines[n3 + 5]);
Assert.StartsWith("G1X20Y", lines[n3 + 6]);
Assert.Equal("/L \"ZHSOFF\"", lines[n3 + 7]);
}
[Fact]
public void Post_ValidatesTableSize()
{