From c1f1c829dc63d880081b0b025876fbcfd3cec2e1 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Tue, 31 Mar 2026 17:37:26 -0400 Subject: [PATCH] fix: flip ComputeNormal for CCW arcs on concave contour features CCW arcs (e.g. the top of a U-slot) had the radial normal pointing into the part material instead of into the scrap. This caused the lead-in preview to flip sides on concave features. Co-Authored-By: Claude Opus 4.6 (1M context) --- OpenNest.Core/CNC/CuttingStrategy/ContourCuttingStrategy.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenNest.Core/CNC/CuttingStrategy/ContourCuttingStrategy.cs b/OpenNest.Core/CNC/CuttingStrategy/ContourCuttingStrategy.cs index 126bf05..f404873 100644 --- a/OpenNest.Core/CNC/CuttingStrategy/ContourCuttingStrategy.cs +++ b/OpenNest.Core/CNC/CuttingStrategy/ContourCuttingStrategy.cs @@ -169,6 +169,12 @@ namespace OpenNest.CNC.CuttingStrategy { // Radial direction from center to point normal = point.AngleFrom(arc.Center); + + // For CCW arcs the radial points the wrong way — flip it. + // CW arcs are convex features (corners) where radial = outward. + // CCW arcs are concave features (slots) where radial = inward. + if (arc.Rotation == RotationType.CCW) + normal += System.Math.PI; } else if (entity is Circle circle) {