refactor: use IDistanceComputer and rename Type to StrategyIndex

Wire IDistanceComputer into RotationSlideStrategy, replacing inline
CPU/GPU branching. BestFitFinder constructs the appropriate implementation.
Replace PushDirection enum with direction vectors in BuildOffsets.
Rename IBestFitStrategy.Type and PairCandidate.StrategyType to StrategyIndex
for clarity (JSON field name unchanged for backward compatibility).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
ajandClaude Opus 4.6 committed 2026-03-21 00:04:19 -04:00
1 parent 4f21fb91a1
commit cdf8e4e40e
7 files changed
+57 -178

No files matched your search

+3 -3
View File
@@ -22,14 +22,14 @@ namespace OpenNest.Engine.BestFit
Polygon stationaryPerimeter, Polygon stationaryHull, Vector correction)
{
_part2Rotation = part2Rotation;
Type = type;
StrategyIndex = type;
Description = description;
_stationaryPerimeter = stationaryPerimeter;
_stationaryHull = stationaryHull;
_correction = correction;
}
public int Type { get; }
public int StrategyIndex { get; }
public string Description { get; }
/// <summary>
@@ -155,7 +155,7 @@ namespace OpenNest.Engine.BestFit
Part1Rotation = 0,
Part2Rotation = _part2Rotation,
Part2Offset = offset,
StrategyType = Type,
StrategyIndex = StrategyIndex,
TestNumber = testNumber,
Spacing = spacing
};