fix(bestfit): never reject pair candidates by utilization

Thin-framed, hollow, or concave parts (e.g. SULLYS-035's frame) have
inherently low part-to-bbox utilization yet nest tightly, so the 30%
MinUtilization floor wrongly dropped every candidate for them. Pair
quality is judged by the rotated pair bounding-box area the results
are already sorted on; utilization now only ever serves as the
high-aspect exception (UtilizationOverride), never as a rejection.

Adds a hollow-frame helper plus regression tests that kept pairs
exist with low utilization and results stay sorted by pair area.
This commit is contained in:
aj
2026-09-26 14:14:44 -04:00
parent 77b729e58c
commit 094c4c196b
3 changed files with 53 additions and 11 deletions
+17
View File
@@ -67,6 +67,23 @@ internal static class TestHelpers
return new Drawing("square", pgm);
}
public static Drawing MakeFrameDrawing(double w = 20, double h = 6, double t = 0.5)
{
// Thin-walled hollow frame: outer CW, inner cutout CCW (CNC convention).
var pgm = new Program();
pgm.Codes.Add(new RapidMove(new Vector(0, 0)));
pgm.Codes.Add(new LinearMove(new Vector(0, h)));
pgm.Codes.Add(new LinearMove(new Vector(w, h)));
pgm.Codes.Add(new LinearMove(new Vector(w, 0)));
pgm.Codes.Add(new LinearMove(new Vector(0, 0)));
pgm.Codes.Add(new RapidMove(new Vector(t, t)));
pgm.Codes.Add(new LinearMove(new Vector(w - t, t)));
pgm.Codes.Add(new LinearMove(new Vector(w - t, h - t)));
pgm.Codes.Add(new LinearMove(new Vector(t, h - t)));
pgm.Codes.Add(new LinearMove(new Vector(t, t)));
return new Drawing("frame", pgm);
}
public static Drawing MakeLShapeDrawing()
{
// CW winding matches CNC convention (OffsetSide.Left = outward)