mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-14 02:15:07 -05:00
On an enclosed machine a cutout slug that tips once cut free can stand up above the sheet and catch the enclosure door when the pallet changes. The head already keeps off cut cutouts, so this is about clearing the door, not the head. Cutting Settings > Cutouts > "Slice slugs the support grid can't hold level" (CuttingParameters.SliceTippingSlugs, off by default, saved per machine thickness and written only when on) makes Plan Cutting cut each such slug along the bed's contact lines (grid rows and columns, slat center lines) before the cutout, so no piece keeps a contact and the pieces drop between the supports. Each slice stops a kerf short of the cutout, so the pieces stay attached until the cutout's own kerf frees them together. A slug the bed holds level, or one on no contact, is left whole; a cutout holding another part or another of its part's cuts is never sliced. Slices are break cuts emitted right after the drawing's own break cuts, pierced on themselves and led straight back to their start. The released-contour proof now leaves out straight break cuts lying wholly inside one of the part's closed holes, since the grid cells they free are scrap; break cuts in material still take part. The plan fingerprint only changes when the setting is on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
109 lines
4.5 KiB
C#
109 lines
4.5 KiB
C#
using OpenNest.CNC.CuttingStrategy;
|
|
|
|
namespace OpenNest.IO;
|
|
|
|
/// <summary>
|
|
/// JSON-safe cutting parameters shared by nest files and desktop settings.
|
|
/// Lead and tab discriminators avoid serializing abstract domain types.
|
|
/// </summary>
|
|
public class CuttingParametersDto
|
|
{
|
|
public int Id { get; set; }
|
|
public string MachineName { get; set; }
|
|
public string MaterialName { get; set; }
|
|
public string Grade { get; set; }
|
|
public double Thickness { get; set; }
|
|
public double Kerf { get; set; }
|
|
public double PartSpacing { get; set; }
|
|
public LeadInDto ExternalLeadIn { get; set; }
|
|
public LeadOutDto ExternalLeadOut { get; set; }
|
|
public LeadInDto InternalLeadIn { get; set; }
|
|
public LeadOutDto InternalLeadOut { get; set; }
|
|
|
|
// Older files also stored arcCircleLeadIn/arcCircleLeadOut. Circles now use the internal
|
|
// leads, so those keys are ignored on read and no longer written.
|
|
public bool TabsEnabled { get; set; }
|
|
|
|
// Legacy settings only stored tabWidth. A missing TabConfig uses that width;
|
|
// Type = "None" explicitly records a null tab in a nest parameter snapshot.
|
|
public double TabWidth { get; set; }
|
|
public TabDto TabConfig { get; set; }
|
|
public double PierceClearance { get; set; }
|
|
public double PierceDiameter { get; set; }
|
|
public bool RoundLeadInAngles { get; set; }
|
|
public double LeadInAngleIncrement { get; set; }
|
|
public bool SupportTabs { get; set; }
|
|
public bool TabBySize { get; set; }
|
|
// The size range's JSON keys keep their names from when only plates with no support bed used it.
|
|
public double NoBedTabMinWidth { get; set; }
|
|
public double NoBedTabMaxWidth { get; set; }
|
|
public double TabHeldMaxLength { get; set; }
|
|
// Written only when on, so files and settings saved without it are unchanged.
|
|
[System.Text.Json.Serialization.JsonIgnore(Condition = System.Text.Json.Serialization.JsonIgnoreCondition.WhenWritingDefault)]
|
|
public bool SliceTippingSlugs { get; set; }
|
|
public SequenceDto Sequencing { get; set; } = new();
|
|
public AssignmentDto Assignment { get; set; } = new();
|
|
|
|
public class LeadInDto
|
|
{
|
|
public string Type { get; set; } = "None";
|
|
public double Length { get; set; }
|
|
public double ApproachAngle { get; set; }
|
|
public double Radius { get; set; }
|
|
// Absent from files written before arc lead-ins had a sweep: they were half circles.
|
|
public double SweepAngle { get; set; } = ArcLeadIn.DefaultSweepAngle;
|
|
public double LineLength { get; set; }
|
|
public double ArcRadius { get; set; }
|
|
public double Kerf { get; set; }
|
|
public double Length1 { get; set; }
|
|
public double Angle1 { get; set; }
|
|
public double Length2 { get; set; }
|
|
public double Angle2 { get; set; }
|
|
}
|
|
|
|
public class LeadOutDto
|
|
{
|
|
public string Type { get; set; } = "None";
|
|
public double Length { get; set; }
|
|
public double ApproachAngle { get; set; }
|
|
public double Radius { get; set; }
|
|
public double GapSize { get; set; }
|
|
}
|
|
|
|
public class TabDto
|
|
{
|
|
public string Type { get; set; } = "None";
|
|
public double Size { get; set; }
|
|
public LeadInDto TabLeadIn { get; set; }
|
|
public LeadOutDto TabLeadOut { get; set; }
|
|
public double CutoutMinWidth { get; set; }
|
|
public double CutoutMinHeight { get; set; }
|
|
public double CutoutMaxWidth { get; set; }
|
|
public double CutoutMaxHeight { get; set; }
|
|
public int MachineTabId { get; set; }
|
|
public double BreakerDepth { get; set; }
|
|
public double BreakerLeadInLength { get; set; }
|
|
public double BreakerAngle { get; set; }
|
|
}
|
|
|
|
public class SequenceDto
|
|
{
|
|
public SequenceMethod Method { get; set; } = SequenceMethod.Advanced;
|
|
public double SmallCutoutWidth { get; set; } = 1.5;
|
|
public double SmallCutoutHeight { get; set; } = 1.5;
|
|
public double MediumCutoutWidth { get; set; } = 8.0;
|
|
public double MediumCutoutHeight { get; set; } = 8.0;
|
|
public double DistanceMediumSmall { get; set; }
|
|
public bool AlternateRowsColumns { get; set; } = true;
|
|
public bool AlternateCutoutsWithinRowColumn { get; set; } = true;
|
|
public double MinDistanceBetweenRowsColumns { get; set; } = 0.25;
|
|
}
|
|
|
|
public class AssignmentDto
|
|
{
|
|
public SequenceMethod Method { get; set; } = SequenceMethod.Advanced;
|
|
public string Preference { get; set; } = "ILAT";
|
|
public double MinGeometryLength { get; set; } = 0.01;
|
|
}
|
|
}
|