Files
OpenNest/OpenNest.Engine/NestItem.cs
T
ajandClaude Opus 5.5 be4b04c7b5 refactor: share NestItem copies, support analysis cache and lead selection
- NestItem.WithQuantity replaces eight hand-written copies that changed only
  the quantity, so a new field is copied everywhere.
- The WinForms support overlay uses Desktop's SupportAnalysisCache and
  SupportClearance instead of its own copy.
- CuttingParameters.LeadInFor/LeadOutFor replace the contour-type switches in
  ContourCuttingStrategy and ActionLeadIn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-29 11:28:56 -05:00

50 lines
1.4 KiB
C#

namespace OpenNest.Engine
{
public class NestItem
{
/// <summary>
/// The drawing to be nested.
/// </summary>
public Drawing Drawing { get; set; }
/// <summary>
/// Priority of the part determines nesting order. Higher numbers are nested first.
/// </summary>
public int Priority { get; set; }
/// <summary>
/// The number of parts to be nested.
/// </summary>
public int Quantity { get; set; }
/// <summary>
/// The rotation step in radians.
/// </summary>
public double StepAngle { get; set; }
/// <summary>
/// The rotation start angle in radians.
/// </summary>
public double RotationStart { get; set; }
/// <summary>
/// The rotation end angle in radians.
/// </summary>
public double RotationEnd { get; set; }
/// <summary>
/// A copy of this item with the given quantity and every other setting unchanged.
/// </summary>
public NestItem WithQuantity(int quantity) =>
new()
{
Drawing = Drawing,
Priority = Priority,
Quantity = quantity,
StepAngle = StepAngle,
RotationStart = RotationStart,
RotationEnd = RotationEnd,
};
}
}