mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-24 06:17:39 -05:00
The Cutting Parameters dialog had grown taller than many screens. It now
puts the leads in a column of their own beside Tabs, Cutouts, Marks and
Pierce (about 780 x 580 instead of 410 x 985). The Place Lead-in side
panel and Machine Configuration keep the single stacked column. The tab
size range is one "Narrow side from ... to ..." row, with its details in
tooltips.
Since e1ccd692 every tabbed part counts as steady, but "Tab alone holds
parts up to" (TabHeldMaxLength, default 6) still picked short parts' tab
points from the center-of-gravity line and treated every tab as equally
steady in the last-resort entry fallback. The setting is removed: every
part the support grid cannot hold level is tabbed and held by its tab,
however long it is. Settings and nests saved with the old value read
unchanged and ignore it.
The problem-nest corpus (entries, every nest) plans identically to master.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
65 lines
2.8 KiB
C#
65 lines
2.8 KiB
C#
using System.Text.Json;
|
|
using System.Text.Json.Serialization;
|
|
using OpenNest.CNC.CuttingStrategy;
|
|
|
|
namespace OpenNest.Data;
|
|
|
|
/// <summary>
|
|
/// The Cutting Parameters dialog's settings beyond leads for one thickness: lead-in angle
|
|
/// rounding, tabs and pierce. Lengths are in the machine's units. A thickness without them
|
|
/// (<see cref="ThicknessConfig.Cutting"/> null) takes this PC's last cutting settings.
|
|
/// </summary>
|
|
public class ThicknessCuttingConfig
|
|
{
|
|
public bool RoundLeadInAngles { get; set; }
|
|
public double LeadInAngleIncrement { get; set; } = 5;
|
|
|
|
/// <summary>Whether parts are tabbed at all: by the support grid, or by size with <see cref="TabBySize"/>.</summary>
|
|
public bool Tabs { get; set; }
|
|
|
|
/// <summary>With <see cref="Tabs"/>, ignore the support grid and tab parts whose narrow side is in the size range.</summary>
|
|
public bool TabBySize { get; set; }
|
|
|
|
public double TabSize { get; set; } = 0.03;
|
|
|
|
public double TabSizeMinWidth { get; set; }
|
|
|
|
/// <summary>The widest part tabbed by size; 0 tabs nothing by size.</summary>
|
|
public double TabSizeMaxWidth { get; set; }
|
|
|
|
/// <summary>Whether cutouts the support grid can't hold level have their slugs sliced; written only when on.</summary>
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
|
public bool SliceTippingSlugs { get; set; }
|
|
|
|
/// <summary>What Plan Cutting etches in each part's label box; written only when not off.</summary>
|
|
[JsonConverter(typeof(JsonStringEnumConverter))]
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
|
public PartLabelMode LabelMode { get; set; }
|
|
|
|
/// <summary>
|
|
/// Read only: the old on/off part label option, which meant the number with its bend
|
|
/// groups. Never written; files saved with it load as <see cref="PartLabelMode.PartNumberAndBendGroups"/>.
|
|
/// </summary>
|
|
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
|
public bool EtchPartLabels { get; set; }
|
|
|
|
/// <summary>
|
|
/// <see cref="LabelMode"/>, or the full label when only the old on/off option is set. A number
|
|
/// that names no mode (the reader accepts numbers) loads as the old option, so as Off without it.
|
|
/// </summary>
|
|
[JsonIgnore]
|
|
public PartLabelMode ResolvedLabelMode =>
|
|
LabelMode != PartLabelMode.Off && System.Enum.IsDefined(LabelMode) ? LabelMode
|
|
: EtchPartLabels ? PartLabelMode.PartNumberAndBendGroups
|
|
: PartLabelMode.Off;
|
|
|
|
public double PierceClearance { get; set; } = 0.0625;
|
|
|
|
/// <summary>The pierce zone's diameter; 0 turns it off.</summary>
|
|
public double PierceDiameter { get; set; }
|
|
|
|
/// <summary>Fields a newer OpenNest wrote, kept so saving here does not drop them.</summary>
|
|
[JsonExtensionData]
|
|
public Dictionary<string, JsonElement>? Unknown { get; set; }
|
|
}
|