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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user