refactor: extract responsibilities from NestEngine into focused classes

- Move BuildPairParts to BestFitResult.BuildParts() instance method
- Extract BinConverter (RectanglePacking) for Part/NestItem/Bin conversions
- Extract RotationAnalysis for FindBestRotation and FindHullEdgeAngles

NestEngine reduced from 484 to 287 lines — now purely orchestration,
strategy selection, and comparison logic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 21:37:50 -05:00
parent b738d4c72c
commit 99edad4228
6 changed files with 232 additions and 210 deletions
+1 -1
View File
@@ -126,7 +126,7 @@ namespace OpenNest.Forms
result.BoundingWidth,
result.BoundingHeight);
var parts = NestEngine.BuildPairParts(result, drawing);
var parts = result.BuildParts(drawing);
foreach (var part in parts)
view.Plate.Parts.Add(part);
+1 -1
View File
@@ -537,7 +537,7 @@ namespace OpenNest.Forms
{
if (form.ShowDialog(this) == DialogResult.OK && form.SelectedResult != null)
{
var parts = NestEngine.BuildPairParts(form.SelectedResult, drawing);
var parts = form.SelectedResult.BuildParts(drawing);
activeForm.PlateView.SetAction(typeof(ActionClone), parts);
}
}