Files
OpenNest/OpenNest.Data/ThicknessCuttingConfig.cs
T
ajandClaude Opus 5.5 037d154a91 feat(planner): opt-in heat weight spreads the part order in blocks
Plan Cutting cut dense runs of small neighboring parts back to back, so thin
sheets built up heat in one area (N26-2F2 sheet 2). An opt-in
CuttingParameters.HeatWeight (s of travel per degree C, saved per material and
thickness; 0 = off) lets the tour compare the plain tour with two cutting
fronts and 2x2-6x6 blocks, scored by travel, 2 s per jump and the old
Gaussian heat estimate fed by the Cut Simulator's feeds.

A move to another block across parts already cut is a designed head raise:
the strict search raises that arrival and replay marks it HEAD RAISE, counted
in HeatRaises, not HeadRaises. Locked programs and cut-offs cannot carry the
mark, so they are reached head-down only as a last resort. The user approved
raising the head to jump between blocks, since these small parts can be tabbed.

At weight 0 nothing runs: fingerprint, serializer and plans are unchanged
(corpus part-order and characterization digests pass). On the 121-part 0.12 in
sheet, weight 0.1 lowers the hottest-zone P95 by 37% for 11% more cut time,
with 37 designed raises and no fallback raises.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-12-02 21:28:59 -05:00

72 lines
3.1 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;
/// <summary>
/// Travel seconds Plan Cutting may spend to cut a part one degree cooler (docs/plate-heat-map.md);
/// 0 orders by travel alone. Written only when set.
/// </summary>
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
public double HeatWeight { 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; }
}