using System.Collections.Generic;
namespace OpenNest.BestFit
{
/// One saved best-fit pair result, as persisted in a .nest archive.
public sealed record SavedPairResult(
double Part1Rotation,
double Part2Rotation,
double Part2OffsetX,
double Part2OffsetY,
int StrategyType,
int TestNumber,
double CandidateSpacing,
double RotatedArea,
double BoundingWidth,
double BoundingHeight,
double OptimalRotation,
bool Keep,
string Reason,
double TrueArea,
IReadOnlyList HullAngles
);
/// The saved best-fit results for one drawing at one plate size and spacing.
public sealed record SavedPairSet(
double PlateWidth,
double PlateHeight,
double Spacing,
IReadOnlyList Results
);
///
/// Persists best-fit pair caches across .nest round trips. Implementations own their
/// cache; readers and writers never assume one exists, and a file without saved sets is
/// always valid because the data can be recomputed.
///
public interface IBestFitStore
{
///
/// Sets to save for , limited to the given
/// (plate width, plate length, part spacing) keys.
///
IReadOnlyList Export(
Drawing drawing,
IReadOnlySet<(double Width, double Length, double Spacing)> plateKeys
);
/// Restores saved sets for .
void Import(Drawing drawing, IReadOnlyList sets);
}
}