fix(posts): pick Cincinnati CL kerf side from the shared contour winding

The CL post wrote the configured default side (G41) on every contour,
so a contour wound against OpenNest's convention was compensated into
the part. It now takes each feature's side from Core's shared
PostContours winding rule, as the CI Fiber post does: the perimeter is
picked across the part's cut features and hole sub-program contours
are always holes. Correctly wound drawings post unchanged.

Remove the "Default kerf side" post setting; saved configs that still
carry it load as before. Expose PostContours.Flatten and Classify so a
post can classify one part's features itself.

Add CL tests for a square with a hole: the exact inline program, cuts
that match the shared contours on the sheet, G41/G42 keeping the part
out of the kerf inline and through part sub-programs, and identical
output from absolute and incremental part and hole programs. The
replay now records the compensation in force on each cut.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ajandClaude Opus 5.5 committed 2026-11-11 15:52:10 -05:00
1 parent cd623ff1aa
commit fa6f664296
12 files changed
+318 -42

No files matched your search

@@ -42,6 +42,7 @@ public sealed class CincinnatiPartSubprogramWriter
/// <summary>
/// Writes a complete part sub-program for the given normalized program.
/// The program must be in absolute mode with coordinates normalized to origin (0,0).
/// With <paramref name="holes"/> every contour is a hole, as in a hole sub-program.
/// </summary>
public void Write(
TextWriter w,
@@ -50,7 +51,8 @@ public sealed class CincinnatiPartSubprogramWriter
int subNumber,
string cutLibrary,
string etchLibrary,
double sheetDiagonal
double sheetDiagonal,
bool holes = false
)
{
var allFeatures = FeatureUtils.SplitByRapids(normalizedProgram.Codes);
@@ -60,6 +62,7 @@ public sealed class CincinnatiPartSubprogramWriter
// Classify and order: etch features first, then cut features
var ordered = FeatureUtils.ClassifyAndOrder(allFeatures);
var exterior = FeatureUtils.FindExterior(ordered);
var kerf = FeatureUtils.KerfSides(ordered, holes);
w.WriteLine("(*****************************************************)");
w.WriteLine($":{subNumber}");
@@ -90,6 +93,7 @@ public sealed class CincinnatiPartSubprogramWriter
IsFirstFeatureOfPart = false,
IsLastFeatureOnSheet = isLastFeature,
IsExteriorFeature = exterior[i],
Kerf = kerf[i],
IsEtch = isEtch,
LibraryFile = isEtch ? etchLibrary : cutLibrary,
CutDistance = cutDistance,