using System;
using System.Collections.Generic;
namespace OpenNest.TabbedCutouts
{
///
/// A cutout (a closed hole in a part) whose slug stays attached by uncut tabs. It is identified
/// by the source entities of the hole's contour. Building the drawing cuts the contour as open
/// pieces between the tabs, each entered from the slug with no lead-out, and keeps the tabs on
/// the layer so the hole still bounds material. All values are
/// in the source frame.
///
public sealed class TabbedCutout
{
public const double DefaultTabWidth = 0.0625;
public const int DefaultTabCount = 2;
public const int MinTabCount = 1;
/// Source entity IDs of the hole's closed contour.
public List EdgeIds { get; set; } = new();
/// Uncut length of each tab along the contour.
public double TabWidth { get; set; } = DefaultTabWidth;
///
/// Tab centers as distances along the contour, counterclockwise from its lowest-left
/// vertex (the smallest X, then Y), ascending. Empty means
/// evenly spaced.
///
public List TabCenters { get; set; } = new();
public TabbedCutout Clone() =>
new()
{
EdgeIds = new List(EdgeIds),
TabWidth = TabWidth,
TabCenters = new List(TabCenters),
};
}
}