feat(nest): keep parts out of tabbed cutouts

A tabbed cutout's slug stays attached while the sheet is cut, but nesting
saw a closed hole and could place parts inside it. Nesting and layout paths
now read material through NestingMaterial.ForNesting, which drops closed
contours with tab spans so the slug counts as part. That covers part
outlines and collision lines, the cutout router, fill expansion, best-fit,
NestLayoutCheck and the GPU bitmaps. Area, overlap diagnostics and cutting
keep the hole, and programs without tabs read exactly as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
ajandClaude Opus 5.5 committed 2026-10-18 01:14:22 -04:00
1 parent ba39c3dc55
commit 0186ccfbff
12 files changed
+139 -21

No files matched your search

+1 -1
View File
@@ -101,7 +101,7 @@ namespace OpenNest.Engine.BestFit
{
var partEntities = ConvertProgram
.ToGeometry(part.Program)
.Where(e => SpecialLayers.IsMaterial(e.Layer))
.ForNesting()
.ToList();
foreach (var entity in partEntities)
+1 -1
View File
@@ -14,7 +14,7 @@ namespace OpenNest.Engine.BestFit
{
var entities = ConvertProgram
.ToGeometry(drawing.Program)
.Where(e => SpecialLayers.IsMaterial(e.Layer))
.ForNesting()
.ToList();
if (entities.Count == 0)
+1 -1
View File
@@ -662,7 +662,7 @@ namespace OpenNest.Engine.Fill
var prepared = new RingSet();
var entities = ConvertProgram
.ToGeometry(program)
.Where(e => SpecialLayers.IsMaterial(e.Layer))
.ForNesting()
.ToList();
if (entities.Count > 0)
+2 -4
View File
@@ -66,10 +66,8 @@ public sealed class JobPartGeometry
|| !double.IsFinite(m.CenterX) || !double.IsFinite(m.CenterY)))
throw new ArgumentException("Geometry must contain finite motions.", nameof(geometry));
var entities = ConvertProgram.ToGeometry(DrawingJobMapper.ToProgram(geometry));
var cutEntities = new List<Entity>();
foreach (var entity in entities)
if (SpecialLayers.IsMaterial(entity.Layer))
cutEntities.Add(entity);
// A tabbed cutout's slug stays attached, so its hole is no room for other parts.
var cutEntities = entities.ForNesting();
var contours = ShapeBuilder.GetShapes(cutEntities);
if (contours.Count == 0)
+1 -1
View File
@@ -577,7 +577,7 @@ public static class NestLayoutCheck
{
var entities = ConvertProgram
.ToGeometry(part.Program)
.Where(e => SpecialLayers.IsMaterial(e.Layer))
.ForNesting()
.ToList();
if (entities.Count == 0)