Files
OpenNest/OpenNest.Data/ThicknessCuttingConfig.cs
T
ajandClaude Sonnet 5.5 2a59ffb951 feat(labels): etch the part number and bend groups in the label box
Plan Cutting adds each part's label to the clean program it plans from
when CuttingParameters.EtchPartLabels is on (off by default, kept per
machine thickness like the other cutting options), so it is emitted as
scribe marks: shown, counted in cut time, posted through the etch path
and never part of nesting geometry.

The text is the drawing name plus its bend groups ("1234-AB"). A group
is the bend line's direction against the sheet grain in 15 degree steps
(BendGrain.Bucket), named by a fixed letter: A across the grain, B with
it, then C to L. A built-in single-stroke font (StrokeFont) draws it,
centered in the box and shrunk to fit down to half the box height.

Locked or unplanned parts, drawings without a box and common-line
members get no label. A plan-time warning for a label that cannot fit,
a letter beside each bend's etch dashes and a per-group list in the
reports are left for later.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 17:51:01 -05:00

48 lines
1.9 KiB
C#

using System.Text.Json;
using System.Text.Json.Serialization;
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;
/// <summary>The longest part its tab alone holds; 0 turns the rule off.</summary>
public double TabHeldMaxLength { get; set; } = 6;
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; }
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public bool EtchPartLabels { get; set; }
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; }
}