From 09f1140f54bd09f2fc6775e476b4c6467bfe46c4 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Mon, 6 Apr 2026 15:24:17 -0400 Subject: [PATCH] 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) --- OpenNest.Engine/MultiPlateNester.cs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/OpenNest.Engine/MultiPlateNester.cs b/OpenNest.Engine/MultiPlateNester.cs index 82a0821..3cf3b16 100644 --- a/OpenNest.Engine/MultiPlateNester.cs +++ b/OpenNest.Engine/MultiPlateNester.cs @@ -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);