Revert "refactor(compactor): deduplicate Push — PushDirection delegates to Vector overload"

This reverts commit 9012a9fc1c.
This commit is contained in:
2026-03-18 20:24:33 -04:00
parent 9012a9fc1c
commit e695e29355
5 changed files with 181 additions and 26 deletions

View File

@@ -109,9 +109,8 @@ namespace OpenNest.Tests
var moving = new List<Part> { part };
var obstacles = new List<Part>();
// direction = left
var direction = new Vector(System.Math.Cos(System.Math.PI), System.Math.Sin(System.Math.PI));
var distance = Compactor.Push(moving, obstacles, workArea, 0, direction);
// angle = π = push left
var distance = Compactor.Push(moving, obstacles, workArea, 0, System.Math.PI);
Assert.True(distance > 0);
Assert.True(part.BoundingBox.Left < 1);
@@ -125,10 +124,8 @@ namespace OpenNest.Tests
var moving = new List<Part> { part };
var obstacles = new List<Part>();
// direction = down
var angle = 3 * System.Math.PI / 2;
var direction = new Vector(System.Math.Cos(angle), System.Math.Sin(angle));
var distance = Compactor.Push(moving, obstacles, workArea, 0, direction);
// angle = 3π/2 = push down
var distance = Compactor.Push(moving, obstacles, workArea, 0, 3 * System.Math.PI / 2);
Assert.True(distance > 0);
Assert.True(part.BoundingBox.Bottom < 1);