fix: guard stepSize <= 0 in NfpSlideStrategy to prevent infinite loop

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-20 20:07:43 -04:00
parent 5f4288a786
commit 4d0d8c453b

View File

@@ -20,6 +20,10 @@ namespace OpenNest.Engine.BestFit
public List<PairCandidate> GenerateCandidates(Drawing drawing, double spacing, double stepSize)
{
var candidates = new List<PairCandidate>();
if (stepSize <= 0)
return candidates;
var halfSpacing = spacing / 2;
// Extract stationary polygon (Part1 at rotation 0), with spacing applied.