mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-02 11:21:40 -05:00
Document and Undo/ (ChangeScope, NestFingerprint, NestUndoState) use only Core, Data, IO and Engine, so they move into the toolkit-neutral library both desktop front ends share. Namespaces are unchanged, so the WinForms app compiles as before; it keeps using the internal scope factories and fingerprint through InternalsVisibleTo. The scope, fingerprint and SaveAs/save-point rules now have Linux tests in OpenNest.Desktop.Tests; before, only the Windows-only WinForms suite covered them.
30 lines
920 B
C#
30 lines
920 B
C#
using OpenNest.CNC;
|
|
using OpenNest.Geometry;
|
|
|
|
namespace OpenNest.Desktop.Tests;
|
|
|
|
internal static class TestNests
|
|
{
|
|
/// <summary>A nest with one 48x96 plate holding one 10x10 square part.</summary>
|
|
public static Nest OneSquare()
|
|
{
|
|
var program = new Program();
|
|
program.Codes.Add(new RapidMove(new Vector(0, 0)));
|
|
program.Codes.Add(new LinearMove(new Vector(10, 0)));
|
|
program.Codes.Add(new LinearMove(new Vector(10, 10)));
|
|
program.Codes.Add(new LinearMove(new Vector(0, 10)));
|
|
program.Codes.Add(new LinearMove(new Vector(0, 0)));
|
|
|
|
var drawing = new Drawing("square", program);
|
|
drawing.Quantity.Required = 1;
|
|
|
|
var plate = new Plate(new Size(48, 96));
|
|
plate.Parts.Add(new Part(drawing));
|
|
|
|
var nest = new Nest { Name = "test" };
|
|
nest.Drawings.Add(drawing);
|
|
nest.Plates.Add(plate);
|
|
return nest;
|
|
}
|
|
}
|