mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-11-03 12:21:39 -05:00
Reopening a nest regenerated its cut-offs with built-in defaults (no overtravel, a different minimum segment) rather than the machine's settings it was made with, so a nest saved, reopened and posted could cut scrap that never separates. Plates now record the settings their cut-offs were last generated with, and files carry them; older files still load with the defaults. Saving over a nest file truncated it before writing, so any failure part way lost the only good copy, and the error reached the user as an unhandled exception after the save path had already changed. Nest and settings files are now written beside the target and swapped in, and a failed save is reported with the old file left intact. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
32 lines
1.2 KiB
C#
32 lines
1.2 KiB
C#
namespace OpenNest
|
|
{
|
|
public enum CutDirection
|
|
{
|
|
TowardOrigin,
|
|
AwayFromOrigin,
|
|
}
|
|
|
|
public class CutOffSettings
|
|
{
|
|
public double PartClearance { get; set; } = 0.02;
|
|
public double Overtravel { get; set; }
|
|
public double MinSegmentLength { get; set; } = 0.05;
|
|
public CutDirection CutDirection { get; set; } = CutDirection.AwayFromOrigin;
|
|
|
|
/// <summary>
|
|
/// Whether new cut-offs lock the head height and overcut past the nominal far sheet edge
|
|
/// by <see cref="HeadLockOvercut"/> (see <see cref="CutOff.HeadLockOvercut"/>). Off until
|
|
/// the machine's post has head-height lock codes.
|
|
/// </summary>
|
|
public bool LockHeadHeight { get; set; }
|
|
|
|
/// <summary>How far past the nominal far edge a head-locked cut-off cuts, in model units.</summary>
|
|
public double HeadLockOvercut { get; set; } = 1.5;
|
|
|
|
/// <summary>The head-locked overcut a new cut-off gets from these settings; zero when off.</summary>
|
|
public double NewCutOffHeadLockOvercut => LockHeadHeight ? HeadLockOvercut : 0;
|
|
|
|
public CutOffSettings Copy() => (CutOffSettings)MemberwiseClone();
|
|
}
|
|
}
|