mirror of
https://github.com/ajisaacs/OpenNest.git
synced 2026-10-01 09:38:48 -04:00
PairEvaluator checked overlap on the raw candidate geometry before applying the pair's OptimalRotation, but BestFitResult.BuildParts (and everything downstream) rotates both parts by -OptimalRotation before placing them. Re-tessellating a rotated arc at the overlap chord tolerance samples different chord points than rotating an already-tessellated polygon, so a few tangent-corner candidates came out overlap-free in the raw frame but overlapping once actually placed. Move the landscape-normalization step before the overlap check and rotate part1/part2 the same way BuildParts does before tessellating and running Collision.HasOverlap, so Keep agrees with the geometry that's actually placed. Fixes OpenNest.Tests.BestFit.BestFitOverlapTests.KeptPairs_NoOverlap (was failing 3/1082 candidates). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>