fix: normalize best-fit pairs to landscape and fix viewer size swap
Normalize pair bounding box to landscape (width >= height) in PairEvaluator for consistent display and filtering. Fix BestFitViewerForm where BoundingWidth/BoundingHeight were passed in the wrong order to the plate Size constructor. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using OpenNest.Converters;
|
||||
using OpenNest.Engine.Fill;
|
||||
using OpenNest.Geometry;
|
||||
using OpenNest.Math;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -67,6 +68,15 @@ namespace OpenNest.Engine.BestFit
|
||||
|
||||
var trueArea = drawing.Area * 2;
|
||||
|
||||
// Normalize to landscape (width >= height) for consistent display.
|
||||
if (bestHeight > bestWidth)
|
||||
{
|
||||
var tmp = bestWidth;
|
||||
bestWidth = bestHeight;
|
||||
bestHeight = tmp;
|
||||
bestRotation += Angle.HalfPI;
|
||||
}
|
||||
|
||||
return new BestFitResult
|
||||
{
|
||||
Candidate = candidate,
|
||||
|
||||
Reference in New Issue
Block a user