fix: allow large parts to use remnant space on existing plates

Previously, parts classified as "Large" skipped all existing plates
and always created new ones. This caused one-unique-part-per-plate
behavior since most parts exceed half the plate dimension. Now large
parts search viable remnants on existing plates before creating new
ones, matching the intended part-first behavior.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-06 15:24:17 -04:00
parent 7c918a2378
commit 09f1140f54

View File

@@ -259,10 +259,9 @@ namespace OpenNest
var workArea = pr.Plate.WorkArea();
var classification = Classify(partBounds, workArea);
if (classification == PartClass.Large)
continue; // Large parts don't go on existing plates — they create new ones.
// Small parts only go into scrap zones; medium parts into viable remnants.
// Small parts only go into scrap zones to preserve viable remnants.
// Medium and Large parts go into viable remnants (large parts can
// still fit in remnant space left by other large parts).
var remnants = classification == PartClass.Small
? FindScrapZones(pr.Plate, minRemnantSize)
: FindViableRemnants(pr.Plate, minRemnantSize);