Files
OpenNest/OpenNest.Engine/Nfp/INestOptimizer.cs
AJ Isaacs 9411dd0fdd refactor: extract PlacedPart/SequenceEntry types, add IFP caching
Move PlacedPart to its own file. Replace tuple-based sequences with
SequenceEntry struct for clarity. Add IProgress parameter to
INestOptimizer. Add IFP caching to NfpCache to avoid recomputing
inner fit polygons for the same drawing/rotation/workArea.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 14:42:50 -04:00

42 lines
1.2 KiB
C#

using OpenNest.Engine.Fill;
using OpenNest.Geometry;
using System;
using System.Collections.Generic;
using System.Threading;
namespace OpenNest.Engine.Nfp
{
/// <summary>
/// Result of a nest optimization run.
/// </summary>
public class OptimizationResult
{
/// <summary>
/// The best placement sequence found.
/// </summary>
public List<SequenceEntry> Sequence { get; set; }
/// <summary>
/// The score achieved by the best sequence.
/// </summary>
public FillScore Score { get; set; }
/// <summary>
/// Number of iterations performed.
/// </summary>
public int Iterations { get; set; }
}
/// <summary>
/// Interface for nest optimization algorithms that search for the best
/// part ordering and rotation to maximize plate utilization.
/// </summary>
public interface INestOptimizer
{
OptimizationResult Optimize(List<NestItem> items, Box workArea, NfpCache cache,
Dictionary<int, List<double>> candidateRotations,
IProgress<NestProgress> progress = null,
CancellationToken cancellation = default);
}
}