perf: remove automatic angle sweep in linear fill

Remove NeedsSweep that triggered a 5-degree sweep (36 angles) when
the work area was narrower than the part. Position matters more than
angle for narrow areas, and the base angles (bestRotation + 90deg)
cover the useful cases. ForceFullSweep still works for training.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-20 14:43:38 -04:00
parent 884817c5f9
commit 708d895a04
2 changed files with 5 additions and 19 deletions

View File

@@ -29,18 +29,16 @@ public class AngleCandidateBuilderTests
}
[Fact]
public void Build_NarrowWorkArea_ProducesMoreAngles()
public void Build_NarrowWorkArea_UsesBaseAnglesOnly()
{
var builder = new AngleCandidateBuilder();
var item = new NestItem { Drawing = MakeRectDrawing(20, 10) };
var wideArea = new Box(0, 0, 100, 100);
var narrowArea = new Box(0, 0, 100, 8); // narrower than part's longest side
var wideAngles = builder.Build(item, 0, wideArea);
var narrowAngles = builder.Build(item, 0, narrowArea);
var angles = builder.Build(item, 0, narrowArea);
Assert.True(narrowAngles.Count > wideAngles.Count,
$"Narrow ({narrowAngles.Count}) should have more angles than wide ({wideAngles.Count})");
// Without ForceFullSweep, narrow areas use only base angles (0° and 90°)
Assert.Equal(2, angles.Count);
}
[Fact]