feat(shapes): add PlateSizes catalog and wire Ctrl+P to snap-to-standard

PlateSizes holds standard mill sheet sizes (48x96 through 96x240) and
exposes Recommend() which snaps small layouts to an increment and
rounds larger layouts up to the nearest fitting sheet. Plate.SnapToStandardSize
applies the result while preserving long-axis orientation, and the
existing Ctrl+P "Resize to Fit" menu in EditNestForm now calls it
instead of the simple round-up AutoSize.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-10 20:16:29 -04:00
parent 54def611fa
commit 0e45c13515
5 changed files with 750 additions and 1 deletions
+6 -1
View File
@@ -7,6 +7,7 @@ using OpenNest.Engine.Sequencing;
using OpenNest.IO;
using OpenNest.Math;
using OpenNest.Properties;
using OpenNest.Shapes;
using System;
using System.ComponentModel;
using System.Diagnostics;
@@ -453,7 +454,11 @@ namespace OpenNest.Forms
public void ResizePlateToFitParts()
{
PlateView.Plate.AutoSize(Settings.Default.AutoSizePlateFactor);
var options = new PlateSizeOptions
{
SnapIncrement = Settings.Default.AutoSizePlateFactor,
};
PlateView.Plate.SnapToStandardSize(options);
PlateView.ZoomToPlate();
PlateView.Refresh();
UpdatePlateList();