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>
This commit is contained in:
24
OpenNest.Engine/Nfp/SequenceEntry.cs
Normal file
24
OpenNest.Engine/Nfp/SequenceEntry.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
namespace OpenNest.Engine.Nfp
|
||||
{
|
||||
/// <summary>
|
||||
/// An entry in a placement sequence — identifies which drawing to place and at what rotation.
|
||||
/// </summary>
|
||||
public readonly struct SequenceEntry
|
||||
{
|
||||
public int DrawingId { get; }
|
||||
public double Rotation { get; }
|
||||
public Drawing Drawing { get; }
|
||||
|
||||
public SequenceEntry(int drawingId, double rotation, Drawing drawing)
|
||||
{
|
||||
DrawingId = drawingId;
|
||||
Rotation = rotation;
|
||||
Drawing = drawing;
|
||||
}
|
||||
|
||||
public SequenceEntry WithRotation(double rotation)
|
||||
{
|
||||
return new SequenceEntry(DrawingId, rotation, Drawing);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user