From 66b3aeafc1fb28c611666489e9d841412d8d82ff Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Thu, 12 Mar 2026 23:59:04 -0400 Subject: [PATCH] fix: correct inverted quadrant-to-exit-point mapping in GetExitPoint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The exit point should be the corner farthest from the origin so the perimeter (cut last) ends near the machine home. The mapping was backwards — Q1 (origin bottom-left) was returning (0,0) instead of (w,l). Co-Authored-By: Claude Opus 4.6 --- .../CNC/CuttingStrategy/ContourCuttingStrategy.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenNest.Core/CNC/CuttingStrategy/ContourCuttingStrategy.cs b/OpenNest.Core/CNC/CuttingStrategy/ContourCuttingStrategy.cs index 418da09..7ea880b 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/ContourCuttingStrategy.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/ContourCuttingStrategy.cs @@ -70,11 +70,11 @@ namespace OpenNest.CNC.CuttingStrategy return plate.Quadrant switch { - 1 => new Vector(0, 0), // Q1 TopRight origin -> exit BottomLeft - 2 => new Vector(w, 0), // Q2 TopLeft origin -> exit BottomRight - 3 => new Vector(w, l), // Q3 BottomLeft origin -> exit TopRight - 4 => new Vector(0, l), // Q4 BottomRight origin -> exit TopLeft - _ => new Vector(0, 0) + 1 => new Vector(w, l), // Q1 origin BottomLeft -> exit TopRight + 2 => new Vector(0, l), // Q2 origin BottomRight -> exit TopLeft + 3 => new Vector(0, 0), // Q3 origin TopRight -> exit BottomLeft + 4 => new Vector(w, 0), // Q4 origin TopLeft -> exit BottomRight + _ => new Vector(w, l) }; }