From d7eb3ebd7afecf96ec53df231c369f399283b2ed Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Fri, 27 Mar 2026 22:15:45 -0400 Subject: [PATCH] fix: skip aspect ratio rejection when best-fit utilization is high High-utilization pairs (>=75%) are no longer discarded for exceeding the aspect ratio limit, since the material isn't being wasted. Co-Authored-By: Claude Opus 4.6 (1M context) --- OpenNest.Engine/BestFit/BestFitFilter.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OpenNest.Engine/BestFit/BestFitFilter.cs b/OpenNest.Engine/BestFit/BestFitFilter.cs index 3cffded..c7d0787 100644 --- a/OpenNest.Engine/BestFit/BestFitFilter.cs +++ b/OpenNest.Engine/BestFit/BestFitFilter.cs @@ -8,6 +8,7 @@ namespace OpenNest.Engine.BestFit public double MaxPlateHeight { get; set; } public double MaxAspectRatio { get; set; } = 5.0; public double MinUtilization { get; set; } = 0.3; + public double UtilizationOverride { get; set; } = 0.75; public void Apply(List results) { @@ -25,7 +26,7 @@ namespace OpenNest.Engine.BestFit var aspect = result.LongestSide / result.ShortestSide; - if (aspect > MaxAspectRatio) + if (aspect > MaxAspectRatio && result.Utilization < UtilizationOverride) { result.Keep = false; result.Reason = string.Format("Aspect ratio {0:F1} exceeds max {1}", aspect, MaxAspectRatio);