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) <noreply@anthropic.com>
This commit is contained in:
2026-03-27 22:15:45 -04:00
parent 4404d3a5d0
commit d7eb3ebd7a

View File

@@ -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<BestFitResult> 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);